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

[REBOL] [PARSE] The THRU keyword description?

From: peta:mailinator at: 5-Dec-2008 15:43

Hi all, I wonder how to best define what the THRU keyword is doing? When I saw the description of the THRU keyword in the official documents, the following recursive idiom came to my mind: a: [thru b] ; is defined recursively as: ar: [b | skip ar] ; Tests: b: #"x" parse "ab" a ; == false parse "ab" ar ; == false parse "abx" a ; == true parse "abx" ar ; == true b: "xy" parse "ab" a ; == false parse "ab" ar ; == false parse "abxy" a ; == true parse "abxy" ar ; == true ; so far so good, but now: parse "ab" [thru end] ; == false ; while: b: [end] parse "ab" ar ; == true Comments? Peta