PARSE: which is proper COPY result?

Carl Sassenrath, CTO
REBOL Technologies
9-Oct-2009 4:30 GMT

Article #0264
Main page || Index || Prior Article [0263] || Next Article [0265] || 5 Comments || Send feedback

While looking over the new decode-url bug, the source of the problem comes from this small difference in parse:

>> chars: charset "abc"
>> parse "x" [copy s [some chars | none]]
>> s
== ""

before the rewrite, s was set to NONE. The question is, which result is correct?

This situation also exists for blocks:

>> parse [a] [copy b [some 'x | none]]
>> b
== []

The fact that both s and b have values is an indication that the rule succeeded. The prior parse behavior came from the fact that if the input did not advance, then the result was NONE.

We need to make a decision on this. The code change is minor, but we must weigh the issues of compatibility with correctness.


Updated 23-Jun-2024 - Edit - Copyright REBOL Technologies -