[REBOL] Re: Parse and and recursion local variables?
From: moliad:gmai:l at: 19-Mar-2007 17:08
what people do not immediately see is that to and thru do not match rules,
they only "match" charsets or strings, they really are like find and
actually, to and thru really only skip content, they don't match it. which
is a big difference with the rest of parse which must match it. Which is
why parsing is so hard. one must identify all the patterns which can match,
often innwards out . I too, was tempted into using to and thru when I
started... but I quickly understood that I could not go very far with parse,
and in fact, probably one of the reasons I eventually didn't get to use it.
inserting rules here would be extremely powerfull, but also very taxing and
possibly even impossible, as it would mean actually tring all the rules at
every byte. the first index of any of the rules which match completely
would be returned... the compound effect of having many of these rules could
lead to impposible parses or exponentially slow rules, which is usually not
the case with even very large parse dialects.
this is probably very close to internal regexp use in fact, but also why its
so slow and as such becomes almost unuable on any long string or when a few
conditional rule depths are built on any serious regexp string... I've used
regexp and was dumbfounded by how quickly it slows down... even on current
not trying to bust the bubble, just trying to explain why some of the things
are like they are. Parse is meant to be screaming fast, for many reasons...
a lot of rebol is built using it (view, LNS, etc).
we could argue that adding those things add to the options, true, but they
might also become the de facto use, since they are easier to adopt, yet in
the long run, might give a bad view of parse, which becomes "so slow". And
few of use would learn and use the "real" parsing.
Funny I'm sooo opinionated when a few months ago I was still clueless, ;-)
On 3/19/07, Christian Ensel <christian.ensel-gmx.de> wrote: