[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: precompiled regex's to lua
- From: Mike Pall <mikelu-0611@...>
- Date: Fri, 10 Nov 2006 01:54:59 +0100
Edgar Toernig wrote:
> It may sound weird by I was thinking about that when I was
> looking for a nice and powerful case statement: precompiled
> lex-like finite automatons as a super case statement.
You may want to have a look at how pattern matching in Haskell
works. Also check their lazy regex combinators.
One idea is to integrate the pattern matching language into the
core language. Then you can easily tag captures with variable
names and make them available to the bodies. This also simplifies
compiling and optimizing the pattern matches together with the
core language constructs.
But I guess it would look really ugly in any language with an
Algol-like syntax (such as Lua).