Cool @samdphillips, tiny reminds me of this little class-based system for Lua :slightly_smiling_face: (https://github.com/rxi/classic/).
Hum the only part I don’t get is this, (define ((%object-var var) obj)
, I mean I kind of get the body (I think?) but how come the head is a list in the definition..?
Ah it’s a curry short-hand, get it now!
So if I understand racket’s class system basically follows open-closed principle right? Despite classes being first-class you can only really extend them that way right? https://en.wikipedia.org/wiki/Open%E2%80%93closed_principle
If I understand correctly, Lua, Ruby and Javascript and to some degree Python don’t follow this principle I think?
And I mean without using macros note!
You can override methods, not sure if that counts as closed?
think that counts as extension, so yeah closed!
An open class would be a nice feature for what I’m working on
Hum what I basically meant was classes in racket are closed for modification but open for extension, right? No way to truly modify them without a macro, yeah..?
Being open in that sense was something I found quite fun in Ruby and Lua..!
Classes are first class, but there aren’t any documented operations on them except extension and instantiation.
You can also create functions with arguments that return classes
Don’t forget mixins.
Yes, the racket class system is open/closed in that sense