lua-users home
lua-l archive

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

Hello Luiz,

Luiz Henrique de Figueiredo <>:
> If you want to experiment with this, try my ltokenp [1], a token
> processor for Lua.

I'm afraid I've already implemented the syntax and a couple transforms
with the respective operators, so I do have something to experiment

> It'll probably be easier if the new syntax is
> `f(...)`, because you can use f to decide what to do.

This would kind of defeat the purpose of the changes proposed. Suppose
I wrote an optimized version of e.g.

string.sub(<var>, 1, #<const str>) == <const str> and
string.sub(<var>,#<const str>+1)

and named it "consume" for some reason. Now a reader unacquainted with
the code would need to learn what consume() does when it's called (and
would need to build the C extension library just to try out the code).
In the syntax proposed, the code would literally say what it does, and
the code would still be runnable without building a C module.

Best regards,