Providing traits, apis, generics, qualities, prototypes,

Right, we got part-way through implementing some ideas at https://github.com/andyferris/Traitor.jl

The system worked in a limited set of circumstances. I paused development because it was impossible to have both “traitor” methods and standard methods on the same function (*), making it of limited usefulness. However, I can see the traits will be exceedingly useful, and IMHO the syntax worked really well.

Implementation relied on a generated function implementing a certain type of multiple dispatch. In what I can only describe as feeling particularly “Julian”, it was like instead of having multiple-inheritence on types, it was that the method signatures used multiple type or “trait” trees, one for each nominated trait, where Type{} is reduced to just one of such trait trees. I say “particularly Julian” in that multiple dispatch and generic methods take center stage unlike other object-oriented systems that support multiple inheritance. I think such a multi-faceted, multiple-dispatch algorithm could reasonably be built into Julia, with the caveat of even slower dynamic dispatch…

(*) - the main blocker at the time (**) was that there is no way to recover pre-existing methods. For this. it would have been useful to either have access to the raw (pre-lowered) code of a method or a way of using lowered code, so I can both override a method and insert its code into a different method.

(**) - I’m not even sure if the code runs anymore, since it was doing “interesting” things from @generated functions…