[mercury-users] An opinion about Mercury

Paul Bone pbone at csse.unimelb.edu.au
Wed Feb 4 09:01:23 AEDT 2009


On Tue, Feb 03, 2009 at 11:00:03PM +1100, Jonathan Morgan wrote:
> On Tue, Feb 3, 2009 at 8:17 PM, Raphael Collet
> >
> > I am not sure there is so much to fix.  Maybe the tutorial could propose a
> > list like "10 sins in Mercury".  One of them could be:
> >
> >  * Use I/O in a predicate that is used by many other predicates in your
> > program; all these other predicates will have to thread state variables and
> > be deterministic; this will make your program harder to maintain.
> 
> In this regard, the tutorial really needs to mention trace goals.  You
> just don't want people going to a lot of trouble to alter their
> program to allow I/O passing when all they want is a bit of tracing or
> debug prints.
> 

That's a good point.  One user was telling me that he had invented his
own 'unsafe_perform_io' for Mercury (he had to write foreign C code)
to which he could pass a closure that required the IO state.  He used
this for debugging only so what he really wanted (but didn't know it)
was trace goals.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/users/attachments/20090204/5a517a79/attachment.sig>


More information about the users mailing list