[mercury-users] Libraries and DCG convenience...

Thomas Conway conway at cs.mu.OZ.AU
Wed Jun 23 11:45:32 AEST 1999


On Tue, Jun 22, 1999 at 11:26:44PM EST, Peter Ross wrote:
> On 21-Jun-1999, Luke Evans <Luke.Evans at seagatesoftware.com> wrote:
> > Threading the graph variables through all this is painful and seems (IMHO)
> > to be exactly what DCG's were designed for.   Of course, I can write
> > wrappers for the standard predicates which reorder the arguments to present
> > the <Graph state before> and <Graph state after> arguments at the end of the
> > argument list, but this becomes a real overhead to using the standard
> > library.
> > 
> You can use higher-order functions to avoid writing wrapper functions.
	[deletia]
Unfortuantely, although this approach is quite good, my experience
say that in reality two problems come up that mean you end up
writing several versions of switch, so that wrappers start looking
like a good idea again:
	- you can curry extra inputs, but you can't curry outputs
	- modes (di, uo/mdi, muo, etc) and determinism.

Still, it's useful in many cases.

-- 
 Thomas Conway )O+     Every sword has two edges.
     Mercurian            <conway at cs.mu.oz.au>
--------------------------------------------------------------------------
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