Home   Archive   Permalink



Parse evalution

rules: [
     any [
         'clear (append string "^(1B)[J") |
         'at set arg pair! (append string rejoin ["^(1B)[" arg/x ";" arg/y "H"]) |
         set arg string! (append string arg)
     ]
]
    
Would anyone like to complain the usage of the second "|"
    
How does the (parse [clear at 10x10 "Hi World!" ] rules) match the "Hi World!" string! type?

posted by:   limux       26-Nov-2010/10:27:08-8:00



This parse rule means "order is not important"
And also any of them can be missing:
    
>> parse [at 10x10 "x" clear] rules
== true
    
>> parse ["x"] rules
== true
    
Look at this example:
>> parse [a 1x2 b 3 c "x"] [any ['a pair! | 'b integer! | 'c string!]]
== true
    
>> parse [c "x" b 3] [any ['a pair! | 'b integer! | 'c string!]]
== true


posted by:   Endo       27-Nov-2010/3:45:48-8:00