[m-dev.] manifest sets

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Aug 16 16:28:32 AEST 2000


On 16-Aug-2000, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> Here's a solution to allow reasonable-looking manifest set constants.
> 
> I'm sure someone can tell me how to avoid the need to split this into to
> modules by using submodules or something like that.  Is there some reason some
> adaptation of this code shouldn't be put in set.m?

Your code allows `{1, 2}', but it doesn't allow `{1}' or `{}'.
If we're going to support set notation, we should allow the latter to.

Also, the overloading that this technique involves is likely to lead
to some potentially confusing error messages, e.g. for simple code such
as

	main --> print({1,2}).

It's not clear that advantage of the the syntactic convenience is
worth the confusion that such problems will cause.

> The other question is:  will this still work with the proposed new tuple
> syntax?

No, it won't.  With the proposed new tuple syntax, "{ 1, 2, 3, 4 }" will get
parsed as "'{}'(1, 2, 3, 4)", rather than as "'{}'(','(1,','(2,','(3,4))))".

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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