Commit Graph

18 Commits

Author SHA1 Message Date
Julien Fischer
66c1448fb0 Fix spelling.
samples/interpreter.m:
    As above.
2022-03-30 18:02:08 +11:00
Zoltan Somogyi
84223268a0 Delete the tests/general/interpreter test case.
tests/general/interpreter.{m,inp,exp}:
tests/general/Mmakefile:
    As above: delete this test case.

samples/interpreter.m:
    Delete reference to the deleted test case.

tests/debugger/interpreter.m:
    Delete reference to the deleted test case in this copy of
    samples/interpreter.m.

tests/debugger/interpreter.exp:
tests/debugger/interpreter.exp2:
    The last update of interpreter.exp was in 2003. The command we invoke
    this test case with has changed several times since then, but none
    of them have been reflected in interpreter.exp, so now there is no way
    for it to be matched. This diff deletes interpreter.exp, and renames
    the old interpreter.exp2 to become the new interpreter.exp.

tests/general/arithmetic.nl:
tests/general/interpreter.nl:
tests/general/string_test.nl:
    Delete these relics of the time when we compared output generated
    by Mercury to output generated by NU-Prolog, since NU-Prolog is long dead.

tests/general/arithmetic.m:
tests/general/string_test.m:
    Update programming style, and factor out common code.
2022-03-04 17:25:20 +11:00
Zoltan Somogyi
92f60e5c70 Standardize on one interpreter.m.
samples/interpreter.m:
    Make this the primary copy of interpreter.m. Incorporate the improvements
    from the other two versions in tests, and generalize them to be suitable
    as a sample program.

tests/debugger/interpreter.m:
tests/general/interpreter.m:
    Make these copies of the primary version.

tests/debugger/Mmakefile:
tests/general/Mmakefile:
    Keep the tests copies of the primary version.

tests/general/interpreter.exp:
    Expect an output now generated for parameter-less invocations.
2022-03-04 14:45:01 +11:00
Julien Fischer
f5fdc98426 Style updates for benchmarks and samples. 2020-05-20 17:06:20 +10:00
Zoltan Somogyi
f8aab8e53e Update the programming style of this program. 2016-02-10 22:21:58 +11:00
Julien Fischer
9c96387183 Fix formatting of sample programs.
samples/Mmakefile:
    Add the beer program to list of targets.

samples/*.m:
    Convert (C->T;E) to (if C then T else E).

    Delete trailing whitespace.

    Use predmode syntax instead of separate pred and mode
    declarations.

samples/interpreter.m:
    Fix up one predicate that had some clauses that used
    DCGs and others that used state variables.

    Don't use the name 'IO' for something that isn't the I/O state.

samples/diff/*.m:
samples/c_interface/c_calls_mercury/mercury_main.m:
samples/c_interface/short_example.m:
    Delete trailing whitespace.
2015-12-14 16:06:13 +11:00
Julien Fischer
168b4cf26d Improve style of Prolog interpreter example.
samples/interpreter.m:
	Use io.format/4 is better style than using a sequence
	of calls to io.write_{string,int}.
2013-04-29 18:06:30 +10:00
Julien Fischer
012962fd17 Change the argument order of predicates in the varset module to make
Branches: main

Change the argument order of predicates in the varset module to make
them more conducive to the use of state variable notation.

library/varset.m:
	As above.

library/parser.m:
library/term_io.m:
library/svvarset.m:
compiler/*.m:
samples/interpreter.m:
tests/debugger/interpreter.m:
tests/general/interpreter.m:
tests/hard_coded/bigtest.m:
tests/hard_coded/deep_copy_bug.m:
tests/hard_coded/lp.m:
tests/hard_coded/pprint_test.m:
tests/hard_coded/type_spec_ho_term.m:
	Conform to the above change and remove dependencies on the svvarset
	module.
2011-05-05 03:59:00 +00:00
Julien Fischer
a20fb1cf57 Further code and formatting cleanups. There are no changes
Branches; main, 11.01

samples/*.m:
	Further code and formatting cleanups.  There are no changes
	to any algorithms.
2011-01-10 02:29:33 +00:00
Peter Ross
f4f361d888 Update to use the new term.variable type.
Estimated hours taken: 0.1
Branches: main

samples/interpreter.m:
	Update to use the new term.variable type.
2006-11-01 23:11:23 +00:00
Julien Fischer
566e036247 Conform to recent changes in the standard library.
Estimated hours taken: 0.1
Branches: main

samples/*.m:
	Conform to recent changes in the standard library.
2006-06-28 09:11:07 +00:00
Zoltan Somogyi
5fb5874ba3 Fix some violations of good style in the sample programs.
Estimated hours taken: 0.3
Branches: main, release

samples/*.m:
	Fix some violations of good style in the sample programs.
2005-08-12 04:50:37 +00:00
Ian MacLarty
c3e0be6dca Bring some samples up to date with current coding standards.
Estimated hours taken: 1.0
Branches: main and 0.12

Bring some samples up to date with current coding standards.

samples/calculator.m
samples/calculator2.m
samples/cat.m
samples/e.m
samples/eliza.m
samples/expand_terms.m
samples/hello.m
samples/interpreter.m
samples/sort.m
samples/ultra_sub.m
	Bring up to date with current coding standards.
2005-02-09 08:41:13 +00:00
Fergus Henderson
02751f887e Add calls to `io__flush_output', so that the input and output
Estimated hours taken: 0.1

samples/calculator.m:
samples/eliza.m:
samples/interpreter.m:
	Add calls to `io__flush_output', so that the input and output
	are interleaved properly when you run the programs with output
	redirected to a pipe, e.g. "./calculator | tee logfile".
1999-11-04 03:16:52 +00:00
Fergus Henderson
086d75a334 New file. An example of the use of tr_store.m.
Estimated hours taken: 0.1

extras/trailed_update/samples/interpreter.m:
	New file.  An example of the use of tr_store.m.

samples/interpreter.m:
	Add pointer to extras/trailed_update/samples/interpreter.m.

extras/trailed_update/Mmakefile:
extras/trailed_update/samples/interpreter.inp:
extras/trailed_update/samples/interpreter.exp:
extras/trailed_update/samples/vqueens.exp:
	New files.  Some testing infrastructure.
1997-09-29 15:25:58 +00:00
Fergus Henderson
2c4bd735b4 Add comment "This source file is hereby placed in the public domain".
Estimated hours taken: 0.25

samples/*:
	Add comment "This source file is hereby placed in the public domain".
1997-09-10 11:01:12 +00:00
Zoltan Somogyi
dd9619d20b s/varset__lookup/varset__search/
Estimated hours taken: 0.1

interpreter:
	s/varset__lookup/varset__search/
1996-03-17 04:22:44 +00:00
Fergus Henderson
3cea9507db Add `interpreter.m' to the samples directory.
Estimated hours taken: 0.1

Add `interpreter.m' to the samples directory.
1996-03-03 22:56:52 +00:00