[mercury-users] State variables as function arguments.

Julian Fondren ayrnieu at gmail.com
Sat Feb 10 20:08:46 AEDT 2007


Peter Schachte wrote:
> If you can find a convenient way to use predicates instead of functions where
> you want to do I/O, it would work out better for you.  Perhaps you could make
> the second argument to or_die be a predicate rather than a function, and thread
> the IO state through it:

*nod*, I can certainly do with this program with predicates.
I only had them as functions so that I could return the success
of an underlying C call, after trying at first with semidet I/O.

  _ = foo, _ = bar.

is surely some kind of red flag, as well.

Thanks for your explanation!  I really feel better about this,
after the error message's simple 'invalid use' language.

Julian.
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list