[m-rev.] for review: convert samples/REAMDE to Markdown

Julien Fischer jfischer at opturion.com
Sun Jan 2 15:42:39 AEDT 2022


For review by anyone.

I intend to rename this file to README.md as well -- this means that when 
the samples directory is viewed in GitHub it should be rendered 
appropriately.

Note: it isn't really possible to preserve the two-column layout used in
much of this file in Markdown (at least in a way that preserves
readability as plain text file).

-----------------------------

Convert samples/README to Markdown.

Convert the samples README file to Markdown.  The aim is to improve the way
this file appears when viewed in GitHub.

Fix a number of small errors.

samples/README:
     As above.

Julien.

diff --git a/samples/README b/samples/README
index 14930eccd..ac5588e15 100644
--- a/samples/README
+++ b/samples/README
@@ -1,79 +1,72 @@
+Mercury Sample Programs
+-----------------------

  This directory contains some example Mercury programs.

-hello.m			"Hello World" in Mercury.
+* (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.
+* (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.
+* (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.
+* (calculator.m) -- A simple four-function arithmetic calculator, with a parser
+  written using the Definite Clause Grammar notation.

-calculator2.m		A simple four-function arithmetic calculator,
-			which uses the parser module in the standard
-			library with a user-defined operator precedence
-			table.
+* (calculator2.m) -- A simple four-function arithmetic calculator, which uses the
+  `mercury_term_parser` module in the standard library with a user-defined
+  operator precedence table.

-interpreter.m		An simple interpreter for definite logic programs.
-			A demonstration of meta-programming 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.
+* (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.
+* (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.

-Mmakefile		The file used by `mmake', the Mercury Make program,
-			to build the programs in this directory.
+* (Mmakefile) -- The file used by `mmake`, the Mercury Make program, to build the
+  programs in this directory.

-The `solutions' sub-directory contains some examples of the use of
+The (solutions) sub-directory contains some examples of the use of
  nondeterminism, showing how a Mercury program can compute 
-	- one solution,
-	- all solutions, or
-	- some solutions (determined by a user-specified criteria)
+
+- one solution,
+- all solutions, or
+- some solutions (determined by a user-specified criteria)
+
  for a query which has more than one logically correct answer.

-The `concurrency' sub-directory contains examples of how to use Mercury's
+The (concurrency) sub-directory contains examples of how to use Mercury's
  concurrency interface, i.e. using threads in Mercury programs.

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

-appengine               A simple Google App Engine servlet.
-
-diff                    This directory contains an implementation of a
-			simple version of the standard UNIX utility
-			`diff', which prints the differences between
-			two files.
+* (appengine) -- A simple Google App Engine servlet.

-c_interface		This directory contains some examples of mixed
-			Mercury/C/C++/Fortran programs using the C interface.
+* (diff) -- This directory contains an implementation of a simple version of the
+  standard UNIX utility `diff`, which prints the differences between two files.

-java_interface		This directory contains some examples of mixed
-			Mercury/Java programs using the foreign language
-			interface.
+* (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.
+* (java_interface) -- This directory contains some examples of mixed Mercury/Java
+  programs using the foreign language interface.

-muz			This directory contains a syntax checker / type checker
-			for the specification language Z.
+* (rot13) -- This directory contains a few implementations of rot-13 encoding.

-solver_types		This directory contains an example solver type
-			implementation and some sample applications.
+* (muz) -- This directory contains a syntax checker / type checker for the
+  specification language Z.

-lazy_list		This directory contains an example of the lazy module
-			can be used to implement lazy data structures, in this
-			case a lazy list.
+* (solver_types) -- This directory contains an example solver type implementation
+  and some sample applications.

+* (lazy_list) -- This directory contains an example of how the `lazy` module in
+  the standard library can be used to implement lazy data structures, in this
+  case a lazy list.


More information about the reviews mailing list