3 ms·
It's interesting that there are no classes, and that there are only Objects, where you just mix everything in. As I understand it, javascript objects are like
by iamwil 18y ago
It's interesting that there are no classes, and that there are only Objects, where you just mix everything in.
As I understand it, javascript objects are like this, except you only add in methods one at a time, instead of mixing in and out modules.
It doesn't look like there are inheritance trees. I'm not sure what you'd do to prevent namespace clashes when mixing in different modules or if/how modules share and work on object attribute data, but so far in Ruby, that hasn't been too much of a problem.
- richcollins 18y agoSee http://iolanguage.com/ http://iolanguage.com/
- nihilocrat 18y agoI think you'll have a "well, duh" reaction if you implement an OO system in pure C. It is basically just a bunch of structs (data) with a bunch of functions which take a struct pointer as their first argument. Mixins just let you randomly add or remove these functions without any extra shenanigans, which you can also easily do in our pure C OO system.
- davidmathers 18y ago"I'm not sure what you'd do to prevent namespace clashes when mixing in different modules or if/how modules share and work on object attribute data" Read the traits paper: http://www.iam.unibe.ch/~scg/Research/Traits/ http://www.iam.unibe.ch/~scg/Research/Traits/