I imitate the follow code that comes from Helpin'Red
a: "big black cat"
parse a [ to "black" insert "FAT "]
print a
big FAT black cat
with mine:
b: [1 2 3]
parse b [to 2 insert 4]
print b
4 4 1 2 3 ;; but what I mean is "1 4 2 3".
What's wrong with my code? And how to get the result I want?
tomatches the input up to a specified rule until it succeeds or the end is reached.2matches a specified number of times.insert 4inserts a value at the current position, and always succeeds.2 insert 4inserts two4's and succeeds.to"advances" the input up to a matched2 insert 4: I say "advances" because it really doesn't, insertion happens at the head.To achieve what you want you need to escape
2usingquote:FYI, Parse has official reference documentation.