lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Sep 23, 2010 at 7:36 PM, Patrick Mc(avery
<spell_gooder_now@spellingbeewinnars.org> wrote:
> Your library looks interesting. I tried to search for more information about
> Erlang regular expressions and what they might be best suited for but I am
> encountering a rather obvious problem, all the examples are in Erlang! A
> language I cannot program in.
> Could you tell me a just little bit about Erlang regular expressions and why
> someone would want to use them?
   It's "pattern matching", not regular expressions. I say
Erlang-style because languages that have dynamically typed pattern
matching (Erlang, Prolog, and now Lua) use it a bit differently than
those with statically typed pattern matching (such as Haskell, OCaml,
and SML).

   I plan on writing more documentation for tamale soon (probably over
the weekend), including a good explanation for people not already
familiar with pattern matching. Mainly, it's useful because you can
program declaratively - you just specify *what* you want, rather than
having to write a tangle of if / else if / switch / etc. code to
search and unpack tables. It's much easier to read, reason about, and
maintain.

Scott