Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: cyclic values

From: carl:cybercraft at: 30-Sep-2002 9:01

On 30-Sep-02, Tom Conlin wrote:
> Hi Pat, >>> colors: [red green blue] > == [red green blue] >>> forever [append colors colors] > == [red green blue red green blue] > == [red green blue red green blue red green blue red green blue] > ... > will get you to forever quickly ;)
Indeed. But it suggests a way I haven't seen posted...
>> colors: [red green blue]
== [red green blue]
>> forever [print color: colors/1 remove append colors color]
red green blue red green blue red green blue red green blue red green blue red (escape) Has the advantage of no extra words being needed. The disadvantages being the contents of the colors block is cycling, (might or might not matter), and it may be slower than Joel's best effort. It should have a consistant speed though. Comments Joel? -- Carl Read