lua-users home
lua-l archive

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


Hey Eric

On 23 November 2016 at 14:08, Eric Wing <ewmailing@gmail.com> wrote:
My only thinking here is it would be nice if we could make it easy for
somebody to switch back to 5.1. Though honestly, at this point in
time, I don't expect there to be many changes in LuaCocoa and I don't
really expect anybody new to ask for 5.1 at this point.

I think it could mostly all be handled with #ifdefs. Your call - I don't ever plan on going back to 5.1, but I know a lot of people do still use it.
 
This protects you in case something throws an exception on the system
when you are in a pcall. This could happen if either a user or system

Oh that's very cool! Thanks for the explanation :)
 
One additional thought, I would like to try to stay as close to the
Lua 5.3 default definitions as possible (just to simplify people
having to remember what definitions were used). I don't think
LUA_COMPAT_MODULE is a default, so it might be nice to work towards
removing this.

So I set that mainly so it would make the changes to luaL_register() call sites as small as possible. If I understand LuaCocoa correctly, the various Function/Selector/Struct/Subclass parts of the code, use luaL_register() (and now luaL_openlib()) to layer up a single "LuaCocoa" table with all of their functions.

This could certainly be done in other ways - possibly the simplest being to pull over the functions that LUA_COMPAT_MODULE includes, to LuaCocoa's source.

I'm not sure I grok the complete mechanisms going on there, to rewrite the Function/Selector/Struct/Subclass code to do this in a different way, but as with the 5.1 compatibility, it's your project, so I defer to your judgement :)

Thanks very much for your feedback!

--
Cheers,

Chris