[Grace-core] 0..(size-1) or 1..size

James Noble kjx at ecs.vuw.ac.nz
Tue Jul 5 02:00:12 PDT 2011


> The answer (to me) is clearly 1 .. size.   That's how mathematicians index vectors and arrays, so it seems the natural default, and thus what one gets with a literal.

Well I'd like that - let's see what Kim says when he gets back.

> Naturally, the libraries will allow users to pick any specific lower and upper bounds that they want.

***no! more gratuitous complexity...***

right: so I really should write 

for (coll.bounds) do { i -> blah }

or we could do

for (coll) doWithIndex { e : Element, i : Number -> ... }
sending  along an extra argument that's a Number

(or support this with for/do if we can pass extra arguments to a block)

argh! we must sort out matching & typesystem & modules;
then get on to the libraries
J




More information about the Grace-core mailing list