lua-users home
lua-l archive

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


On Mon, 12 Jul 2010 14:10:06 +0300, steve donovan <steve.j.donovan@gmail.com> wrote:

On Mon, Jul 12, 2010 at 12:29 PM, Juris Kalnins <juris@mt.lv> wrote:
porting it between Lua versions), but it would be interesting
to know if it is possible to make such "token filter" interface that:
 - wouldn't slow down normal Lua.
 - wouldn't complicate or increase Lua implementation.
 - would allow such token filtering with comparable performance
   without requiring changes in the core.

So e.g. we could have identifiers beginning with $ and @ etc?

And ability to do all other tokenfilterisms, like macros
or low overhead parsing of XML.
But I like the ability to reference, say, global X, without
worrying about characters in the name X, and whether there is
some variable with name X in the lexical scope.


I'm a supporter of lhf-style token-filtering making its way into the
mainstream, but also concerned that it might hurt performance even if
not used - the good old "only pay for the features you use" motto of
C++.

By looking at LexState and company in the llex.h I cannot see
how that interface can be exposed in a clean way
without adding overhead. So I guess it won't happen :(


Also, as we know from C, preprocessor macros are yet another variable
scope to worry about;  if macros would always start with @ or $ then
they would always remain visible and there would be no namespace
clashes.

??