[mercury-users] Mercury needs a Tutorial

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Feb 17 00:11:37 AEDT 1999


On 16-Feb-1999, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> 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.

That proposal is arguably a (small) improvement on the status quo.
Unless there are any objections, I'd be happy to support it.

However, someone would need to implement and document it.
I myself am not volunteering for that task ;-)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh>  |   but source code lives forever"
PGP: finger fjh at 128.250.37.3        |     -- leaked Microsoft memo.



More information about the users mailing list