[m-dev.] And yet another, tuples of state variables.

Ralph Becket rafe at csse.unimelb.edu.au
Fri Jan 12 12:49:37 AEDT 2007


Ondrej Bojar, Friday, 12 January 2007:
> Hi,
> 
> Another construction I tend to type way too often is:
> 
>   foldl(
>     (pred(Elem::in,
>           {!.Aku1, !.Aku2}::in,
>           {!:Aku1, !:Aku2}::out) is det :- ..
> 
> which could be simplified to:
> 
>   foldl(
>     (pred(Elem::in,
>           {Aku1, Aku2}::!(in, out)
> %       or possibly rather
>           !{Aku1, Aku2}::!(in, out)
> 
> In other words, !{A, B}  would be considered equal to
>       {!.A, !.B}, {!:A, !:B}
> 
> How does it sound to you?

This one is not so good: you'd have to recursively push
the !s inside the term and I can't see it improving
readability.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list