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

[REBOL] Re: Using BREAK keyword

From: rotenca:telvia:it at: 21-Sep-2003 8:35

Hi Brett,
> to use the Break keyword of Parse so that I could add it as a comparison. > Unfortunately I wasn't sure of how to do it to give the same results. > Any ideas?
[end skip] and [break] are not the same. The first fails the second breaks. Examples: parse "a" [some [break] "a"] ;== true 'some halts, but not fails. parse "a" [some [end skip] "a"] ; == false 'some halts, because it fails. With 'any, the difference cannot be detected, because its result is alway positive, also if the rule fails. parse "a" [any [end skip] "a"] ; == true parse "a" [any [break] "a"] ;== true There is little difference between break in parse and break in a cycle like this: forever [ break ] It only breaks the cycle without changing its result. --- Ciao Romano