I am looking at self-modifying rules and wondering what exactly the semantics are and how they would work at all. That's a pretty broad question, but I'll use a specific "how would I do this" to turn it into a more focused one. (^(64) being the hex ascii for lowercase "d" so it doesn't get found)
rule: ["a" "b" (insert find rule "^(64)" "c" probe rule) "d" "e"]
parse "abcde" rule
If I run that, I get (in both Rebol and Red):
["a" "b" (insert find rule "d" "c" probe rule) "c" "d" "e"]
== false
The rule seems to have been updated, and it was updated in a fairly "safe-seeming way" (if there is any such thing as safe). There are more evil versions:
rule: ["a" "b" (clear rule probe rule) "d" "e"]
parse "abcde" rule
In both Rebol and Red that gets:
[]
== false
I'm sort of confused how it doesn't crash. But assuming it's been bulletproofed somehow, is there a way to get the first example to work?