[CM] range

Rick Taube taube@uiuc.edu
Thu, 16 Feb 2006 06:17:31 -0600


:stepping values are applied _between_ items:


CM> (setf x (new range :from 60 :stepping (new heap :of '(1 -1 1 -1 1)) 
:for 5))
#<range #x86878C6>
CM> (next x t)
(60 59 58 59 60)
CM> (next x t)
(60 59 58 59 60)
CM> (next x t)
(60 61 62 61 60)
CM> (next x t)
(60 59 58 59 60)
CM> (next x t)
(60 59 60 59 60)



On Feb 16, 2006, at 1:58 AM, Johannes Quint wrote:

> rick,
> i dont understand the behaviour of 'range' when i write the following:
>
> (setf x (new range :from 60 :stepping (new heap :of '(1 -1 1 -1 1)) 
> :for 6))
>
> as result of 
>
> (next x t) 
>
> i would expect a list which always contains 61 at the end, but i get 
>
> => (60 61 60 61 60 59) 
>
> as well as 
>
> => (60 59 58 59 60 61) 
>
> etc.
> what is going wrong?
> thanks - johannes.
>
> _________________________
>
> Johannes Quint
> Rilkestr.55
> D-53225 Bonn
> 0228 468256
> johannes.quint@web.de
> http://www.johannes-quint.de
>
>
>