[m-dev.] Syntactic sugar for functor matching
Thomas Conway
conway at cs.mu.OZ.AU
Wed Oct 31 16:28:56 AEDT 2001
On Wed, Oct 31, 2001 at 04:07:40PM EST, Ralph Becket wrote:
> Occasionally one comes across code like this:
>
> p(constructor1(_, _, _), ...) :- ...
> p(constructor2(_, _, _, _, _), ...) :- ...
> p(constructor3(_, _, _, _), ...) :- ...
> p(constructor4(_, _, _, _, _, _, _), ...) :- ...
>
> Which looks rather awkward. Would there be any merit in extending
> the language so that one could write
>
> p(constructor1/3, ...) :- ...
> p(constructor2/5, ...) :- ...
> p(constructor3/4, ...) :- ...
> p(constructor4/7, ...) :- ...
I would argue that Mercury has quite enough syntactic cruft as it is!
That's not to say that such a feature might sometimes be useful, but
rather that the language contains lots of crufty syntax already, and
we would probably be better of migrating to a cleaner syntax.
<syntax wars>
Thomas "error - no matching end tag for `syntax wars'" Conway
--
Thomas Conway )O+
<conway at cs.mu.oz.au> 499 User error! Replace user, and press any key.
--------------------------------------------------------------------------
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