[EMAIL PROTECTED] wrote:
> Yes. This would be useful, and I have been thinking about adding it for many months.
> Do you think it is better as:
>
> thru ["a" | "b" | "c"]
>
> The first match is the winner.
Oooh great, sixth sense, I somehow knew you will reply to this post :-)
I thought about thru ["a" | "b" | "c"] too, and also about to ["a" | "b" | "c"]
above is probably more consistent, but 'first could be more flexible, as it would
enable us to combine above two: first
[thru "a" | to "b" | thru "c" | some non-alpha] etc.
I also remember how I strugged with 'skip. I could not find X Y skip usefull somehow,
but rather wanted to "skip thru
non-alpha" e.g., but I think it's solvable with current rules ...
-pekr-
>
>
> -Carl
>
> At 1/6/00 11:04 PM +0100, you wrote:
> >Hi,
> >
> >would it be usefull to have 'first available to parse? I just can't find
> >example right now, but let's say I want to find something, but apply my
> >rule according to what is found first, so we could have better tree of
> >possibilities:
> >
> >parse str ["sometext" [thru "a" | thru "b" | thru "c"] to end]
> >parse str ["sometext" first [thru "a" | thru "b" | thru "c"] to end]
> >
> >
> >the problem is - with above rule - it doesn't matter, if "a" is found
> >later than "b" or "c". The second and the third part of subrule have not
> >equal rights to first part of subrule - "a". So I thought extending
> >parse dialect by 'first could help here, as each OR could be applied
> >from the same position, and the winner is an option with lower 'index?
> >
> >I can't find any practical usage right now, it just came to my mind :-)
> >
> >hmmm ...
> >
> >"I can't find any practical usage right now, it just came to my mind
> >:-)"
> >
> >["I can" [thru "just" | thru "any" | to "now"] "practical" to end] ;
> >will fail ...
> >
> >["I can" first [thru "just" | thru "any" | to "now"] "practical" to
> >end] ; would not have to ...
> >
> >Or is it just work around for 'thru and 'to not accepting subrules?
> >
> >-pekr-
> >