Jump to content


Photo

The Class implementation?


  • Please log in to reply
2 replies to this topic

#1 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1862 posts
  • Gender:Not Telling

Posted 11 October 2018 - 11:00

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.



#2 Conner_Bw

Conner_Bw

    Probably More God or Borg Than Human Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 7183 posts
  • Gender:Male
  • Location:Montreal, Quebec, Canada

Posted 11 October 2018 - 14:04

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

 

http://oberon00.gith...ua-classes.html

 

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

 

https://github.com/luabind/luabind


cpu Lenovo X220, Intel i7-2640M @ 2.80GHz ×4 os Windows 10 / Ubuntu 16.04 LTS
My Homepage » : My Renoise Tools » : Normalize Your Sig » : MBC Archives »


#3 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1862 posts
  • Gender:Not Telling

Posted 11 October 2018 - 14:21

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.


Edited by joule, 11 October 2018 - 18:25.