[m-dev.] @ syntax (was: Freeze the compiler)
Ralph Becket
rbeck at microsoft.com
Tue Nov 14 20:41:12 AEDT 2000
>From Michael Day on 14/11/2000 08:07:27
>
> > It would just be a syntactic transformation.
> > You would just declare e.g.
> >
> > :- func elem(map(K, V), K) = V.
> > :- func 'elem :='(map(K, V), K, V) = map(K, V).
>
> In the 'elem :=' example, must the space be preserved exactly? Will
> including an extra space or two produce obscure error messages?
I believe that the correct syntax is to have no spaces at all
before the `:=' (I would have voted for one, but I shan't quibble).
> > It seems a bit excessive to have _four_ different syntaxes for
> > accessing array elements:
>
> So does this mean the @ syntax won't be included? Is it complicated (ie:
> will it take long) to add the extensions to the ^ syntax?
The @ syntax should not be included.
The original @ syntax would be nice for *just* lookup
operations, but the concensus (of which I am now one) seems to be that
extending the `^' notation and completely forgetting `@' is the way
to go. The syntax combining `^' and `@' is horrible.
--
Ralph Becket | MSR Cambridge | rbeck at microsoft.com
--------------------------------------------------------------------------
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