Intervals

Jarvis, Robert P. Jarvisb at timken.com
Tue Nov 30 21:58:35 UTC 1999


> -----Original Message-----
> From:	David N. Smith (IBM) [SMTP:dnsmith at watson.ibm.com]
> Sent:	Tuesday, November 30, 1999 2:45 PM
> To:	squeak at cs.uiuc.edu
> Subject:	RE: Intervals
> 
> I do think that #includes:, if allowed for an interval, should answer 
> true for all values that 'anInterval asArray' includes (or, the 
> equivalent, the set values passed to a #do: block) and false for 
> others. This is not unreasonable and someone else today posted a 
> solution (the same method that's in Collection).
> 
> However, it cannot be done with a simple computation. Fudge factors 
> can only make it look right for your test cases. Try this interval 
> with your code:
> 
>     (1.0e-200 to: 5.0e-200 by: 1.0e-200) asArray
>     => (1.0e-200 2.0e-200 3.0e-200 4.0e-200 5.0e-200 )
> 
> Aren't floats fun!  :-)
> 
You know, I'm having a "deja vu all over again" experience.  I just looked
at the Interval class methods and noticed that Interval>>from:to: and
from:to:by: all seem to assume, based on the parameter names, that Intervals
will be created only with integer first, last, and step values.  I've been
thinking that we hashed this over a while back.  <sigh>  To everything turn,
turn, turn...  :-}

Bob Jarvis
Compuware @ Timken





More information about the Squeak-dev mailing list