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

Kim Bruce kim at cs.pomona.edu
Tue Jul 5 14:43:37 PDT 2011


I still like 1..size!  I believe we are in violent agreement ... First time ever?

Sent from Kim's iPhone

On Jul 5, 2011, at 2:00 AM, James Noble <kjx at ecs.vuw.ac.nz> wrote:

>> 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
> 
> 
> _______________________________________________
> Grace-core mailing list
> Grace-core at cecs.pdx.edu
> https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core


More information about the Grace-core mailing list