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

[REBOL] Re: parse, again... (or rather: still!)

From: hallvard::ystad::helpinhand::com at: 6-Nov-2001 10:24

Ladislav Mecir skrev (Tuesday 06.11.2001, kl. 10.03):
>The problem is, that [to end] must work as it does to work correctly. See >this: > > parse "" [to end to end] ; == true > >I am sure, that this behaviour is correct regardless of the quantity of >[to >end] you put in there. That is why any attempt to write > > parse "" rule: [to end rule] > >or > > parse "" [any [to end]] > >Correctly ends up in an infinite cycle, because PARSE is unable to finish >its work.
Just a sec... Why does parse "" [to end to end] yield 'true? What happens when 'parse has done the first [to end]? Where is 'parse at then? And wouldn't it be simple for rebol to know that once 'parse has reached 'end, all further parse instructions must fail or be ignored? (I just feel the infinite loop is unneccessary).
>It's up to the user to write a rule that really parses through >INPUT and doesn't try to pretend it's doing anything useful when it >actually >isn't.
That's just my debuggin' everyday life...! ~H