lua-users home
lua-l archive

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


Peter Drahoš wrote:
> I did play a little with it and made a quick non-global
> polluting variant[1] that can be used from plain LuaJIT2 on OSX.
> [...] I will clean up the code a bit and refine this as a module
> for LuaDist.

While you're cleaning it up:

* local xyz = ffi.C.xyz is against recommendations:
  http://luajit.org/ext_ffi_tutorial.html#cache

* CGPoint = ffi.metatype("CGPoint", {}) ... etc.
  Global-polluting and pointless. Probably wants to use ffi.typeof().

* typeEncodingToCType() could use a hash-table and/or string.gsub.

* readMethod() is very inefficient. And all those log() calls
  always evaluate their arguments ...

* Those __index methods do unspeakable horrific things ...

Oh well ...

--Mike