lua-users home
lua-l archive

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


On Wed, May 14, 2014 at 7:24 PM, Coroutines <coroutines@gmail.com> wrote:
> Thoughts on using Lua 5.3's new operators in LPeg?
>
> patt1 + patt2    -->    patt1 | patt2
> patt1 - patt2    -->    patt1 ~ patt2
> -patt    -->    ~patt
>
> I know * was chosen for "concatenating patterns" because it closer
> resembles the dot operator, but imo it'd make sense to use + for that.
>
> Anyway, this is what I'd prefer -- what do you other people want? :-)
>
> The biggest criticism I see against this is that it would be a bad
> move to mess with a an already established set of operators.
>
> Should it change at all?
>
> PS: I was trying to figure out a way that << or >> could be used for captures.
>

Well, consider the backwards compatibility question. Is the value higher?

It would be fun to augment lpeg with the additional metamethods. I'm
not sure what *i'd* do << or >>, but it's fun to puzzle over.

-Andrew