[mercury-users] Partially instantiated modes

Robert Ernst Johann JESCHOFNIK rejj at cat.cs.mu.OZ.AU
Fri Nov 12 12:36:16 AEDT 1999


On Fri, 12 Nov 1999, Thomas Conway wrote:

> Actually I lied slightly - the code was already a DCG wrt the io__state.
> This is (as Peter Schachte has pointed out more than once) the problem
> with DCGs. Maybe there is something to his Syntactically Quiet Threading
> (TM) (aka global variables) after all....

Here is a message that I saved, knowing that it would be usefull one day
:)

>From Herr Conway himself, 13th May 1999:
FWIW, since one ends up wanting a mini-dcg inside another predicate,
here is a programming trick I use:

        ... some non-dcg code ...
        call((pred(in, out) is det -->
                set_a(1),
                set_b('c'),
                set_c("dee"),
                set_d(X)
        ), OldState, NewState),
        ...


Why not reorder the variables, and then do a `call' like this to thread
your states through?



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