[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Short function definition syntax; thoughts on Lua
- From: "Juris Kalnins" <juris@...>
- Date: Mon, 07 Dec 2009 12:18:04 +0200
On Mon, 07 Dec 2009 10:10:27 +0200, steve donovan
<steve.j.donovan@gmail.com> wrote:
This is the best way to accommodate everybody and their 'special
needs'. I'd suggest looking into a new API for the token-filter patch
so (a) it has minimal impact on programs that don't need it (b) that
it cannot be accidently invoked by defining a global FILTER and (c)
that different token filters can co-exist.
Token filter patch is rather invasive, does not really provide C interface,
and bulks up code. What would be good to see is something similar to the
lua_Reader callback interface, and have the standard Lua lexer
implemented using this interface. Something similar to:
int mylex(lua_State *L, void *data, void *dst) {
struct MyLexData *d = (struct MyLexData *) data;
...
return TK_LE;
...
return luaX_string(L, dst, TK_GLOBAL, s, len);
...
return luaX_num(L, dst, n);
...
return TK_EOS;
}
...
MyLexData d;
...
lua_xload(L, &mylex, &d);
- References:
- [ANN] GSL Shell new beta release with anti-gran graphics module, Francesco Abbate
- Re: [ANN] GSL Shell new beta release with anti-gran graphics module, Norman Ramsey
- Short function definition syntax; thoughts on Lua (was Re: [ANN] GSL Shell new beta release...), Doug Rogers
- Re: Short function definition syntax; thoughts on Lua (was Re: [ANN] GSL Shell new beta release...), steve donovan
- Re: Short function definition syntax; thoughts on Lua (was Re: [ANN] GSL Shell new beta release...), Luiz Henrique de Figueiredo
- Re: Short function definition syntax; thoughts on Lua (was Re: [ANN] GSL Shell new beta release...), spir
- Re: Short function definition syntax; thoughts on Lua, David Kastrup
- Re: Short function definition syntax; thoughts on Lua, spir
- Re: Short function definition syntax; thoughts on Lua, Mark Hamburg
- Re: Short function definition syntax; thoughts on Lua, Juris Kalnins
- Re: Short function definition syntax; thoughts on Lua, steve donovan