[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LPeg and Lua 5.3 operators
- From: William Ahern <william@...>
- Date: Wed, 14 May 2014 23:14:28 -0700
On Wed, May 14, 2014 at 05:24:10PM -0700, Coroutines 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.
Wouldn't it make more sense to use the concatenating operator, ..?
In boolean algebra + means or and - looks quite similar to the standard
negation sign (it's missing the vertical bar at the corner). So it's
actually quite reasonable the way it is.
See http://en.wikipedia.org/wiki/List_of_logic_symbols