Files
mercury/samples
Fergus Henderson 53aa3ff948 The #include of "mercury_lib.h" should be the first #include,
Estimated hours taken: 0.25

samples/c_calls_mercury/c_main.c:
	The #include of "mercury_lib.h" should be the first #include,
	because that includes "imp.h" which may define global
	register variables that need to be declared before any
	inline functions in other header files.
1997-02-01 13:54:05 +00:00
..
1996-07-15 14:14:21 +00:00
1995-05-30 18:35:34 +00:00
1995-05-09 08:19:09 +00:00
1995-05-09 08:19:09 +00:00
1996-02-08 18:34:36 +00:00
1995-05-30 18:35:34 +00:00
1995-05-09 08:19:09 +00:00
1995-05-09 08:19:09 +00:00
1996-03-17 04:22:44 +00:00
1995-05-09 08:19:09 +00:00
1996-07-25 17:14:21 +00:00
1995-10-08 11:26:50 +00:00
1995-10-08 11:26:50 +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.

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.

diff/file.m		A module which defines a `file' abstract data type
			to hold the lines of text in a file.

diff/lcss.m		A module which defines a `diff' abstract data type;
			it exports a routine for computing the difference
			between two `file's, represented as a `diff',
			using the "least common subsequence" algorithm,
			and routines for printing `diff's in a couple
			of different formats.

diff/diff.m		The top-level driver for the `diff' program;
			it contains some "glue" code which handles
			the processing of command-line arguments
			and calls the routines in file.m and lcss.m.

diff/Mmake		An example of a very short Mmake file.

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

c_interface/c_calls_mercury	This directory contains a detailed
				example of C code calling Mercury code.

c_interface/mercury_calls_c	This directory contains a detailed
				example of Mercury code calling C code.

c_interface/short_example.m	A short example of Mercury code calling C.