The Class implementation?


(joule) #1

Is the Renoise class implementation available as lua code somewhere?

I’m asking since it would be nice to easily reuse some of the stuff made, but in other environments.

Apart from being ‘userobject’ and oprint compatible, It looks as if _G.class and _G.property are just syntactic sugar for “OOP” tables/metatables and could be implemented with lua.


(Conner_Bw) #2

Last time this was discussed, Renoise classes came from here:

http://oberon00.github.io/luabind/lua-classes.html

because that’s the library Renoise was using to implement Lua.

https://github.com/luabind/luabind


(joule) #3

Yes, but isn’t class/property implemented as normal LUA code?

That’s what most signs tell me…

  1. “class ‘MyClass’ (protoclass)” is actually valid lua syntax, belive it or not. It’s not some syntactic addon.

  2. property getter/setter hints that we’re dealing with normal metatables… setter requiring obj the same way mt.__newindex does. Simple wrapping(…)

Maybe it’s all provided via C in some strange way, but that would seem like a detour.

EDIT: Yeah, it seems to be all C. But other than support for type() and oprint(), it seems possible to make a fully compatible lua module that would allow class and properties outside Renoise.