[Grace-core] collections interface for new classes

Andrew P Black black at cs.pdx.edu
Tue Dec 8 14:30:18 PST 2015


On 8 Dec 2015, at 05:42 , James Noble <kjx at ecs.vuw.ac.nz> wrote:

> the question of whether we have varargs or some kind of 
> built-in collection literals, probably affects the API design too.

Absolutely it does.  We agreed in Claremont, I think, that we were going to replace varargs with a notation for sequences.  This would make sewunces "special", but then they are special now, anyway, because a * argument is made on by magic.

We also agreed, long ago, that collections should be "built-in", so that novices can just use list, set and sequence without having to import them.  Are you suggest ing that we revisit that?

One advantage of sequence.empty over sequence [] is that the former can return a constant.  But maybe this is not a problem if sequence literals are built-in.

I don't understand what your `all` wrapper would do.   When we had varargs, I was arguing for something like `all`, so that a client with a collection could use it to request a varargs method.  (And I thought that you argued against it ;-)  But now we have got rid of them, what do you want `all` to do?

Finally, the place for this discussion is in the gracelang/languages issue tracker.

	Andrew




More information about the Grace-core mailing list