Functional syntax (Was: RE: [mercury-users] Hi, and determinism)

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Jan 30 00:43:35 AEDT 2001


On 29-Jan-2001, Mattias Waldau <mattias.waldau at abc.se> wrote:
> As noted in previous entries, semidet can hide some variable problems.
> 
> The solution is obvious: Remove the variables, and that can in many cases be
> done by using functional syntax (even if the functions are nondet).

Well, it's not obvious to me that that is the right solution.
Firstly, you can't get rid of all of the variables in that way, so
it's not a complete solution.  Secondly, using intermediate variables
is often useful for documentation purposes; it would be unfortunate
if there was a tension between using carefully named intermediate
variables to better document your code and avoiding intermediate
variables to reduce the occurrence of unintended semidet unification
problems.  Thirdly, the real problem seems to be unintended semidet
unifications, not variables as such, and so I think you're attacking
it at the wrong end.

> There were some proposals like this in the eighties.

Do you have a more specific reference?

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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