lua-users home
lua-l archive

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


On Mon, Jul 12, 2010 at 1:31 PM, Juris Kalnins <juris@mt.lv> wrote:
>> 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.
>
> ??

Sorry, I meant that it could be useful to mark uses of macros so that
they are more visible.

@import a,b,c  (expands to local a,b,c = a,b,c)

makes it clear that this is not plain vanilla Lua, and guarantees that
any other use of the symbol 'import' will not be trashed.

(Although it would be simple to extend LuaMacro do this at the moment)

As for performance of token-filtering, my unsystematic benchmarks
showed that it's hard to detect any slow-down of compilation speed
using the lhf patch if you are _not_ actually doing any token
filtering.  That's the key consideration.