[mercury-users] query

Peter Moulder pmoulder at csse.monash.edu.au
Tue Mar 18 12:54:44 AEDT 2003


On Mon, Mar 03, 2003 at 10:26:24PM +1100, Ralph Becket wrote:

> % Start of hello.m
> :- module hello.
> :- interface.
> :- import_module io.
> 
> :- pred main(io, io).
> :- mode main(di, uo) is det.
> 
> :- implementation.
> 
> main(!IO) :- io.write_string("Hello, World!\n", !IO).
> % End of hello.m

For a version that works with older versions of Mercury, replace the
`main' line above with:

main(S0, S) :- io__write_string("Hello, World!\n", S0, S).

I think that should work on all publicly-released versions of Mercury.

pjm.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list