[m-dev.] Syntactic sugar for functor matching

Michael Day mikeday at bigpond.net.au
Thu Nov 1 15:15:12 AEDT 2001


> Solving the problem Fergus is referring to would mean Mercury would have to
> forbid a type having two constructors with the same name (and different
> arities).  At least as far as I can see allowing a syntax that doesn't
> specify the arity but still uniquely determines a constructor seems to mean
> that the functor name alone must determine the constructor.  But if you're
> willing to accept that, here's a suggestion.

Presumably types could still have two constructors with the same name but
different arity as long as neither of them were used in the pattern
matching you've described (if aforementioned pattern matching is smart
enough, anyway).

Michael


--------------------------------------------------------------------------
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