REBOL 3.0

PARSE: last few changes are too disruptive

Carl Sassenrath, CTO
REBOL Technologies
14-Oct-2009 4:39 GMT

Article #0272
Main page || Index || Prior Article [0271] || Next Article [0273] || 14 Comments || Send feedback

The OS X version of R3 A89 would not boot. On closer inspection, there was an infinite loop in the CLEAN-PATH function that is called during the boot.

The problem was this line within the PARSE rules for CLEAN-PATH:

| copy f [to #"/" | to end]

If it had not been so fresh on my mind, I'm not so sure I would have noticed the problem. In that line the TO END is always TRUE. That creates two different behaviors from before:

  1. The SOME block which holds this rule is now an infinite loop.
  2. The COPY f always creates a string (it's never NONE).

It took me a minute to figure out the fix. It was to add:

end break

at the top of the SOME loop. Kind of ugly really.

This situation got me rethinking the definitions of ANY and SOME, especially in light of changes over the last few days.

The ANY and SOME keywords are provided as shortcuts for ease of use. They are for us normal coders who want "smart defaults".

It was a mistake to change ANY and SOME to ignore the state of the input series... instead, we should have left those alone, and added a new keyword for users who want a loop that is independent of the input series.

Now, we need a good name for it. ALWAYS, LOOP, FOREVER, suggestion?

14 Comments

REBOL 3.0
Updated 11-Dec-2017 - Edit - Copyright REBOL Technologies - REBOL.net