I’m not the author of this package but I found this really useful in my work just now and I thought it deserves some more love. It allows you to forward a number of methods for your wrapper types in one macro, and even implement entire standard interfaces! My use case was creating a “world line” type, mapping time values to events, and I wanted additional methods on my type. Rather than having to implement the whole dict interface myself, I found this package and it was as simple as doing this.
julia> using DataStructures, ForwardMethods
julia> struct W{T, V} d::SortedDict{T, V} end
julia> @forward_interface W{T, V} field=d interface=dict
julia> function W{T, V}()
return W{T, V}(SortedDict{T, V}())
end
julia> w[1.0] = 1
1
julia> w[2.0] = -1
-1
julia> w[0.5] = -1
-1
julia> w
W{Float64, Int8}(SortedDict{Float64, Int8, Base.Order.ForwardOrdering}(0.5 => -1, 1.0 => 1, 2.0 => -1))
I thought it was just really neat. Julia has quite a lot of really good packages that just get abandoned (through no fault of anybody), and I think just showing some acknowledgement for small useful packages would be nice. Post any other packages y’all think don’t get enough love. I’d love to start using them.
P.S, I feel like defining more interfaces for this package would be super cool. I may look at trying to add the interface for AbstractGraph
myself as a PR!