On 1 juil. 2013, at 12:19, Igor Stasenko wrote:
On 30 June 2013 15:48, Damien Cassou <damien.cassou@gmail.com> wrote:
On Sun, Jun 30, 2013 at 2:54 PM, Camillo Bruni <camillobruni@gmail.com> wrote:
But you know that you can do this right now?
I think these examples only show that some verifications are missing. I don't know any source code using that. To me it's more a bug than a feature. I would keep things simple: applying a trait to a class applies the classTrait to the metaclass.
but that's far less simpler than: - applying trait to behavior (object), applies it only to that object and nothing else (no meta-mess).
Yet the current trait model is based on trait and class trait, and that's consistent with the class model. If you want trait to be applied only on one side: - we have to refactor a lot of stuff, because a lot of our current code rely on this model. - you have to provide a new way for managing instance/class-side dependancies: For example, if one the class side you have: "self class blah" how can you ensure that the class side has the implementation you expect? On the other hand if you want a trait to be applied only on the instance side: provide only instance-side methods. And if you want a trait to be applied only on the class-side: provides only class-side methods. So everything's fine with this regard IMO. Don't change it, just ensure the missing verification in the class builder.
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
-- Best regards, Igor Stasenko.