[mercury-users] Mercury needs a Tutorial

Peter Schachte schachte at cs.mu.OZ.AU
Tue Feb 16 10:52:20 AEDT 1999


On Tue, Feb 16, 1999 at 12:21:30PM +1300, Richard O'Keefe wrote:

> [input and output streams] are not
> parameters of a program heading, not least because Ada hasn't any
> program headings at all.  *Any* parameterless top-level procedure can
> be the entry point of an Ada program.    ^^^^

Perhaps this would be a good way to handle "main" in Mercury: the main
of a program would be determined by an mmc switch, supported by a
variable in the standard generated Mmakefile.  Any predicate with the
signature

	pred(io__state::di, io__state::uo) is cc_multi. % (or det)

could be the main.  If no switch is passed to choose the main, the
default would be the predicate named `main' in the first specified
module to link.  This might not quite be backward compatible, but
probably wouldn't mess up many existing programs.  It would also allow
multiple mains, as I requested, and wouldn't require any new syntax.


-- 
Peter Schachte                     The significant problems we face cannot
mailto:schachte at cs.mu.OZ.AU        be solved by the same level of thinking
http://www.cs.mu.oz.au/~schachte/  that created them.
PGP: finger schachte at 128.250.37.3      -- attributed to Albert Einstein 



More information about the users mailing list