[m-dev.] Introduce !! rather than ^elem() for indexing

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Oct 12 13:09:37 AEST 2001


On 12-Oct-2001, Michael Day <mikeday at bigpond.net.au> wrote:
> 
> More seriously though, what kind of beast is the term [X] ? I imagine now
> it expands into something like [|](X, []) ?

Yes, '[|]'(X, []) to be precise.

> Which would prevent me from
> using it as a single argument type constructor?
>
> :- type [T] == list(T).	% for example

Yes.  That, which is equivalent to

	:- type '[|]'(X, []) == list(T).	% for example

would be illegal because the arguments of the type constructor on the LHS
of a type definition must all be variables, but here [] is not a variable.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  | "... it seems to me that 15 years of
The University of Melbourne         | email is plenty for one lifetime."
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- Prof. Donald E. Knuth
--------------------------------------------------------------------------
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