PARSE: allow switching input series?
Allowing the LIMIT concept in parse is quite difficult. The problem is that it affects too many sub-functions, like those that find subseries. It won't be in 3.0.
However, as I thought about it more, you can do LIMIT yourself by chopping up the input series in advance.
You could even handle all the pieces in a single parse... except... if you attempt to switch the input series:
>> b: "this"
>> parse "test" ["test" :b "this"]
** Script error: PARSE - attempt to change input series: :b
That restriction comes from the fact that we often need to backtrack the input, and if you change the input series, backtracking becomes problematic.
However, REBOLers are smart coders... so, perhaps we should remove this single series restriction, and just let them do what they want.
What say you? Allow switching horses in midstream?
9 Comments
|