Mauro
Mauro
Hm, runtime dispatch, that is even worse than not inlining!
With the traitor syntax this will be hit more often as the type often gets gensym'ed: ``` julia> @traitfn f(a::::Tr) = a f (generic function with 2 methods) julia> @traitfn...
I prototyped this in https://github.com/mauro3/SimpleTraits.jl/tree/m3/associated-types, which includes an [example](https://github.com/mauro3/SimpleTraits.jl/blob/2a97b7376457fef0059dee4992c9441d1a865426/example/associated-types.jl): ```julia using SimpleTraits # This is a trait of one type `Ar` with two associated types `T,N`: @traitdef LikeArray{T,N}(Ar) # NOTE:...
No worries, no need for quick response. In a nutshell it would allow for traits to have parameters just like abstract types, where things like `T,N` in `AbstractArray{T,N}` can be...
Would be interesting to discuss/hack this at JuliaCon 2018, if anyone is interested.
Note that traits can have several super-traits.
Some initial work on this branch: https://github.com/mauro3/SimpleTraits.jl/tree/m3/subtraits
I added a test that all trait parameters need to be specified for it to be a valid trait: https://github.com/mauro3/SimpleTraits.jl/blob/2d5112b3d50ec9d67eec7c9a5a06073fb079ff87/src/SimpleTraits.jl#L94 But that test only works if `Not` is not abstract....
Ok, I added that reference as a second commit. As stated over in #264, a full summary of what package to use when would be good, but in another PR.
Note sure what the test-failure is about. One thing to consider is (and maybe test) is what happens when one wants to store a `BSONDict` itself. Maybe best to error...