[REBOL] parse question
From: princepawn:mailandnews at: 14-Sep-2000 5:18
In order to improve my skills with the REBOL parse word, I thought I would go
through "Mastering Regular Expressions" by Jeffrey Freidl and do all the
examples in REBOL. Here is my first attempt and it does not work.
The script is supposed to take a list of files and indicate whether the word
occurs equally, more, or less than the number of times that the word
Title: "Balance setsize and resetsize"
;; q1 in my head: how do I do word boundaries?
to "resetsize" (size-cmds: size-cmds - 1)
to "setsize" (size-cmds: size-cmds + 1)
proc: func [ filenames [block!] ] [
foreach file filenames [
parse read to-file file rules
prin reform [ "in" file ": " ]
either size-cmds = 0 [
print "resetsize cmds matched # of setsize cmds"
][ either size-cmds > 0 [
print "resetsize cmds > # of setsize cmds"
][ print "resetsize cmds < # of setsize cmds" ]
terrence-brannon: [[princepawn--yahoo--com] perl-refugee myth-gamer]
; all the above is real REBOL code, believe it or not.