[mercury-users] Empty conjuncts?

Alan Baljeu alanb at cornerstonemold.com
Fri Jul 22 22:39:23 AEST 2005


> Hi...
>
> Would it be possible to relax mercury's syntax a little, and allow
empty
> elements in conjunctions? In other words, this should be valid:
>
> main(!IO) :-
>     io.print("Hello ", !IO),
>     ,
>     (if 1 = 0 then
>        true,
>      else
>        true,
>      ),
>     ,
>     io.print("World\n", !IO),
>     .
>
Here's the simple workaround: End every conjunction with a ", true".
Then you can add and remove clauses without ever getting a syntax error
because _every_ important clause end in a ",".

E.g.
 main(!IO) :-
     io.print("Hello ", !IO),
     A = 3,
     B = A,
     true.

--------------------------------------------------------------------------
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