[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How to implement this with LuaMacro?
- From: Pavel Shevaev <pacha.shevaev@...>
- Date: Fri, 22 Jan 2010 15:51:32 +0300
> 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
Best regards, Pavel