[m-dev.] for review: add ++ and -- operators

schachte at cs.mu.OZ.AU schachte at cs.mu.OZ.AU
Tue Aug 8 08:54:57 AEST 2000


> I suggest that you adopt that predencence and associativity of ++ that
> haskell uses.

Why?  The syntax of haskell is nothing like that of Mercury; I see no
reason to trust their decisions on syntax issues to be right for
Mercury.

I suggest you use first principles:  adopt whatever precedence and
associativity makes likely input strings parse the way one would
intuitively expect or want.  Since concatenation is associative, either
associativity should give the same result.  So making ++ right
associative would seem like a good idea because for right recursive
structures, it'll be more efficient.  Of course, -- is not associative,
so it should be left associative, which people will tend to expect, or
perhaps neither associativity (xfx), forcing explicit parentheses when
nesting is wanted. It should have precedence somewhere between = and
the module and type qualification operators.

-- 
Peter Schachte                     The use of COBOL cripples the mind; its
mailto:schachte at cs.mu.OZ.AU        teaching should, therefore, be regarded
http://www.cs.mu.oz.au/~schachte/  as a criminal offense.
PGP: finger schachte at 128.250.37.3      -- E. W. Dijkstra 

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list