lua-users home
lua-l archive

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


On Sun, Oct 23, 2011 at 7:31 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> What you need metamethods for is not `and`, `or` and `not`.  It's metamethods
> for `&`, `|` and `~` (or `!`), which are not in Lua yet.  They'd be
> nice to have,
> being predefined for boolean and number (i.e. bit32.band, bit32,bor
> and bit32.bnot)

Nice one, Dirk!  Not only useful in themselves, but full of
entertaining overloading possibilities.

E.g. the pipe operator | (assuming the correct associativity) for
process chains.

steve d.