So, thanks to blocks, Apple’s new extension to C, you can now do basic object-orientation. Have a look over at GitHub for a short example on how to do it.
To break it down, an object is a struct, which contains both fields and blocks which act as the object’s methods.
This creates a String
object which inherits from Object
and has a field
_value
, and methods getValue
and setValue
.
More to come… maybe.