------ art_527_1893201.1329496577104
Content-Type: multipart/alternative;
boundary --- art_528_9443442.1329496577104"
------ art_528_9443442.1329496577104
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Some time ago, I suggested that it might be worth considering a design
where Ruby classes remain free of any direct method definitions, and
instead act only as containers for mixins. And that any method defined
directly on the class syntactically would in actuality be added to a
pre-class anonymous mixin under the hood.
I bring this up again, not only because I think it's worth considering, but
also I recently realized an experimental implmentation of it has already
been created by Loren Segal called `metamorph`.
https://github.com/lsegal/metamorph
Though certainly not a complete or optimized implementation, it is
something that can be tried out.
The advantages of this idea include:
* Simpler conceptual model, i.e. -- classes are just module containers.
* Classes and modules become truly distinct --no more `class Class <
Module`.
* Better control of mixin order, including easily implemented "prepend"
functionality.
On the disadvantage side, the "Double Inclusion Problem" might become more
pronounced, and it remains to seen what kind of speed hit it might entail.
------ art_528_9443442.1329496577104
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Some time ago, I suggested that it might be worth considering a design where Ruby classes remain free of any direct method definitions, and instead act only as containers for mixins. And that any method defined directly on the class syntactically would in actuality be added to a pre-class anonymous mixin under the hood.<br><br>I bring this up again, not only because I think it's worth considering, but also I recently realized an experimental implmentation of it has already been created by Loren Segal called `metamorph`.<br><br> https://github.com/lsegal/metamorph<br><br>Though certainly not a complete or optimized implementation, it is something that can be tried out.<br><br>The advantages of this idea include:<br><br>* Simpler conceptual model, i.e. -- classes are just module containers.<br>* Classes and modules become truly distinct --no more `class Class < Module`.<br>* Better control of mixin order, including easily implemented "prepend" functionality.<br><br>On the disadvantage side, the "Double Inclusion Problem" might become more pronounced, and it remains to seen what kind of speed hit it might entail.<br><br>
------ art_528_9443442.1329496577104--
------ art_527_1893201.1329496577104--