Files
mercury/samples
Simon Taylor d348b24af5 Fix an old-style `:- pragma c_code' declaration.
Estimated hours taken: 0.1

samples/c_calls_mercury/c_main_int.m:
	Fix an old-style `:- pragma c_code' declaration.

samples/c_calls_mercury/mercury_lib.m:
	Add a missing import.
1999-03-24 03:20:29 +00:00
..
1998-11-07 05:42:46 +00:00
1998-11-04 17:41:20 +00:00

This directory contains some example Mercury programs.

hello.m			"Hello World" in Mercury.

cat.m                   An implementation of a simple version of the
			standard UNIX filter `cat', which just copies
			its input files or the standard input stream to
			the standard output stream.

sort.m                  An implementation of a simple version of the
			standard UNIX filter `sort', which reads lines
			from its input files or the standard input
			stream, sorts them, and then writes the result
			to the standard output stream.

calculator.m            A simple four-function arithmetic calculator,
			with a parser written using the Definite Clause
			Grammar notation.

committed_choice.m	An example illustrating committed-choice
			nondeterminism in Mercury.

interpreter.m		An simple interpreter for definite logic programs.
			A demonstration of meta-programming in Mercury.

expand_terms.m		Another example meta-program, showing how to
			emulate Prolog's `expand_term' mechanism.

e.m			A small program which calculates the base of
			natural logarithms to however many digits you
			choose.  It illustrates one way to achieve
			lazy evaluation in Mercury.

Mmake			The file used by `mmake', the Mercury Make program,
			to build the programs in this directory.

There are also some sub-directories which contain examples of multi-module
Mercury programs.

diff                    This directory contains an implementation of a
			simple version of the standard UNIX utility
			`diff', which prints the differences between
			two files.

c_interface		This directory contains some examples of mixed
			Mercury/C/C++/Fortran programs using the C interface.

rot13			This directory contains a few implementations of
			rot-13 encoding.