[Grace-core] minor language issues
James Noble
kjx at ecs.vuw.ac.nz
Mon May 25 22:28:35 PDT 2015
Hi Andrew
we did talk about this a bit in the teleconference. We confirmed we’ll permit “()” for null varargs lists,
which addresses the immediate problem.
> The thing that you refer to as “built in sequence” is not part of the Grace language.
right. but we could put it or something like it back in.
> You may be confused because minigrace still accepts it;
> that’s because the minigrace compiler still uses it, and when I took it out, the compiler slowed down unacceptably.
there is also the “what *varargs” get bound to “sequence” or whatever.
> Removing it altogether is still on my list, but not a really high priority.
I wouldn’t have it has a high priority.
> If we make various kinds of brackets user-definable methods, then we could have uniform syntax and use [ ] for sequences. But that would mean using more brackets, which you don’t like doing … although there are lots of them.
right, or combinations of operator brackets [+ +] or [- -] or something.
talking briefly after the telecon, basically the issues are (as we known)
- ambiguity between < > as “operators" and as generic parameters
requiring space around binary operators, and delimited arguments resolves this...
- ambiguity between [ ] (or other brackets) as “indexing” vs as “collection constructors” (matchfix / circumfix operators)
IF those brackets can count as delimited then there is a real ambiguity
we could resolve with spaces (as I think minigrace did) a[x] -> indexing, a [x] -> pass collection of [x] to a
but as Michael (I think) pointed out that’s to subtle a distinction
we could give up on indexing (which many of you have reached already) which resolves this...
- we’d still have to have some basic varargs functionality anyway,
to gather up the contents of the collection constructors / matchfix operators
although it could be restricted to just those operators.
I still fantasize about occasionally simplifying things.
James
More information about the Grace-core
mailing list