REBOL 3.0

PARSE: CHANGE added

Carl Sassenrath, CTO
REBOL Technologies
1-Oct-2009 4:31 GMT

Article #0257
Main page || Index || Prior Article [0256] || Next Article [0258] || 6 Comments || Send feedback

For A85, the CHANGE command has been added to the parse dialect.

Syntax is:

change rule |only| value

Where only is an optional word to treat the value as a single value (same as /only in the change action.)

Examples:

>> parse d: "abc" [change "ab" "xy"]
>> d
== "xyc"
>> parse d: "abc" [change skip 123]
>> d
== "123bc"
>> parse d: [a b c] [change 'a [x y z]]
>> d
== [x y z b c]
>> parse d: [a b c] [change 'a only [x y z]]
>> d
== [[x y z] b c]

It is likely that bugs may exist. We will take a sweep over all parse bugs in the next release, once we've agreed on the primary design of these enhancements.

Also: you should know that this change may affect change, insert, and append for all series! datatypes. This is due to a merge between the datatype and parse modification functions.

6 Comments

REBOL 3.0
Updated 25-Apr-2017 - Edit - Copyright REBOL Technologies - REBOL.net