On Fri, 8 Oct 1999 [EMAIL PROTECTED] wrote:
> Hi
> The question:
>
> Why if
> parse "the radio" ["the" "radio"]
> parse "the radio" ["the" "radio"]
> parse " the radio" ["the" "radio"]
>
> are all true,
>
> parse " the radio " ["the" "radio"]
>
> is false?
To my thinking this is because although parse by default does ignore
spaces, it can only ignore them for as far as it gets.
How far into the string parse gets is determined by your rules and is
limited by the end of the string.
Only if parse happens to get to the end of the string will it returns true.
In your last example as far as parse knows it reached the end of your
rules and was not at the end of the string, therefore the string could go
on for pages.
When I want to use parses return value I put a "to end" rule at the end of
my rules, if any of my rules are false the "to end" is never seen,
if all of my rules are true, either I am at the end of the string and the
"to end" is redundant,
or it will skip over any amount of material I do not care about.
... nice weather eh [EMAIL PROTECTED]