Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: got my brainfart parse answer

From: jeff:rebol at: 6-Jun-2001 23:06

Hello, EAT: Sure -- I remember bo.
> remember bo? > > this is what he showed me: > > rule: [thru "x" mark: to "y" y: :mark to "z" z: (either > (index? y) < index? z [a: copy/part mark y][a: copy/part > mark z]) >]
In which case you are really just using PARSE as if it were a fancy FORALL (but less efficiently since the above method goes over the string multiple times). Your code might be cleaner, more understandable, and thereby easier to maintain if you went ahead and used FORALL instead: xYorZ: func [src /local x][ x: find/tail src "x" copy/part x forall x [if find "zy" x/1 [break/return x]] ]
> ... now i have to redesign my data structures as well as a > significant portion of the script... *sigh*
Sounds very tightly coupled. Best of luck-- -jeff