lua-users home
lua-l archive

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

> Sorry about the two-part post. It is important that the macro
> definitions be read before the code is parsed. So I'm assuming that
> test.lua has an __include mymac where mymac.lua contains definitions
> for PARAL etc.  In fact, this should work fine as well in test.lua:
> __def 'PARAL(body) parallel(function(self) body end)'
> ...
> <use PARAL>

Yep, I got it :)

One more stupid question though... While I know how to require 'macro'
library before any parsing in cli mode(using -l switch) I don't know
how to achieve it using Lua C api. luaL_openlibs is used for standard
libraries but what about non-standard ones? Should I use luaL_register
for that?

Best regards, Pavel