Range>>at: patch

Brian T. Rice water at tunes.org
Tue Aug 3 19:24:27 PDT 2004


Ken Causey wrote:

> This patch has a couple of points.
> 
> 1.  It was not checking the indices correctly and was needlessly using
> the step twice.  Lee caught this before me.
> 
> 2.  at: 0 didn't work even though that should be the first value in the
> range.
> 
> 3.  It was not limitting the argument to an Integer and family.  I'm
> assuming here that Range is meant to be non-continuous.  I'm also not
> sure if this is the best way to do it or not.
> 
> Ken

It looks good, although I modified it to use isCloseTo: (which uses 
SingleFloat tolerance) and keyNotFoundOn:, although that isn't really 
precise enough - I just don't like error: if I can avoid it.

We can generalize the keys to be Magnitudes, in principle. I'll keep it 
as Integer until someone hollers.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: water.vcf
Type: text/x-vcard
Size: 208 bytes
Desc: not available
Url : /archives/slate/attachments/20040803/6b23bb0d/water.vcf


More information about the Slate mailing list