[REBOL] Re: Parse Problem
From: al:bri:xtra at: 30-Oct-2001 16:52
Louis wrote:
> Why doesn't the following program work?
> parse ibidem [any [to field/1 mark: (change mark field/2) skip]]
'parse doesn't understand path! datatypes in it's rules block. As others
have mentioned, probably the best solution (for now) is to use a temporary
variable, like:
f1: field/1
f2: field/2
parse ibidem [any [to f1 mark: (change mark f2) skip]]
along with Greg's change/part suggestion.
Alternatives are using 'compose, which isn't easy to use if you have actions
mixed in the rules, like:
parse string compose []
this is better for things like syntax checking.
Or you could use 'reduce, which requires quoting all words and prefacing all
blocks with reduce:
parse string reduce ['any reduce ['to f1 ; and so on.
I hope that helps!
Andrew Martin
ICQ: 26227169 http://valley.150m.com/