[mercury-users] "What do you think about Mercury ?"

Dan Hazel d.hazel at mailbox.uq.edu.au
Sat Aug 28 09:23:54 AEST 1999


Renaud Paquay writes:

 > - Threading variables is a pain (DCG is not an elegant solution)
 >   e.g:
 >      foo(In, Out):-
 >          pred1(In, Out1),
 >          pred2(Out1, Out2),
 >          pred3(Out2, Out3),
 >          pred4(Out3, Out4),
 >          pred5(Out4, Out).
 > 
 >      Adding a call between pred2 and pred3 will force me to rename
 >      every variable from pred2.
 >   

You only have to rename two variables:

       foo(In, Out):-
           pred1(In, Out1),
           pred2(Out1, Out2a),
           newpred(Out2a, Out2b),
           pred3(Out2b, Out3),
           pred4(Out3, Out4),
           pred5(Out4, Out).

but what's inelegant about:


       foo -->
           pred1,
           pred2,
           pred3,
           pred4,
           pred5.

?
Dan Hazel
--------------------------------------------------------------------------
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