[mercury-users] Ref manual addition: State variable syntax in lambda expressions

Mark Brown mark at cs.mu.OZ.AU
Fri May 26 12:14:05 AEST 2006


On 26-May-2006, Nicholas Nethercote <njn at csse.unimelb.edu.au> wrote:
> 
> Hi,
> 
> I have this lambda expression:
> 
>     WriteBanner = (pred(When::in, !.IO::di, !:IO::uo) is det :-
>         io.write_string("-- " ++ FileName ++ ": " ++ When ++ " " ++ 
>         StageName
>             ++ " --------------\n", !IO)),
> 
> The reference manual section on lambda expressions 
> (http://www.cs.mu.oz.au/research/mercury/information/doc-latest/mercury_ref/Lambda-expressions.html#Lambda%20expressions). 
> doesn't explain how to use state variables with lambda expressions.  It 
> would be nice if it did, because I've worked this out and then forgotten it 
> again more than once.

It's documented in the section on state variables (sec 2.10), though not
as clearly as it could be.  Probably an example should be added there.

Cheers,
Mark.

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