lua-users home
lua-l archive

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


On Wed, Jun 29, 2011 at 5:48 PM, Lorenzo Donati
<lorenzodonatibz@interfree.it> wrote:
> For example, consider math vectors:
>
> W = V1 :x: V2 + V3
> W = V1:cross_product(V2) + V3   -- less readable

OK, good one. But you could overload ^ for that, and * for dot
product. (And % is also available)

True, :x: is cute. To answer your question, one thing that LuaMacro
can not do is parse infix expressions. You could define ':x:' as a
lexical token and replace it by '%', that kind of thing.  But for such
a simple step, gsub is your friend ;)

steve d.