[mercury-users] Syntactic sugar for higher order types and mo des
Tyson Dowd
trd at cs.mu.OZ.AU
Wed Jul 26 09:23:35 AEST 2000
On 26-Jul-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 25-Jul-2000, Ralph Becket <rbeck at microsoft.com> wrote:
> > Precedences could be changed to do away with the need for unwanted
> > parentheses.
>
> This is actually easier said than done. The difficulty is that the
> operator-precedence term parser doesn't know when `->' is part of an
> if-then-else and when it is part of a mode definition, so `->' needs
> to have the same precedence for both usages.
A solution is not to use -> for mode definitions.
It looks nice and all, but we just don't use it often enough to justify
screwing up the rest of the syntax for it.
For backwards compatibility we could accept :: and -> for a while, but
if using == some other operator should be used. Wouldn't `-' work OK?
:- mode foo == free - ground.
:- mode foopair == (free - ground) - (ground - ground).
--
Tyson Dowd #
# Surreal humour isn't everyone's cup of fur.
trd at cs.mu.oz.au #
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
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