lua-users home
lua-l archive

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


On 16 February 2011 11:15, steve donovan <steve.j.donovan@gmail.com> wrote:
> But the situation that Francesco is dealing with is template
> specialization, as a C++ programmer would understand it.  That
> requires re-compiling different cases.
>
> What is probably needed is a more sophisticated template expander
> that's less hard on the eyes...

You said you were playing with templating Francesco's code. Do share
if you find any particularly helpful tricks. I've just been using the
$() and # syntax in
http://snippets.luacode.org/snippets/Lua_Preprocessor_118, though
providing a preprocess function that takes an environment argument. A
simple helper for generating code in the form `local a = a; local b =
b; ... return function(...) ... end` has also cleaned things up a bit.

Alex