There is no generic built-in mechanism for this. For the special (and quite common) case when you want the container to “inherit” functionality from an element, some packages have macros that implement this, eg Lazy.@forward.
I believe that should make a relatively performant custom array type (haven’t tested it at all so there might be errors). Most of the AbstractArray methods have default methods that will fallback to these definitions (e.g. length calls size by default).
Though, until you use v0.7 and implement broadcast_similar and friends broadcasting the custom array type will result in an Array rather than a MyCustomArray.
This lack of inheritance is a disappointing aspect of Julia for me, though I understand its reasoning with multiple dispatch and I’ll prefer multiple dispatch anyday.
For example I need to extend StatsBase.Histogram to include some fields like min, max, sum, and it just requires the creation of several pass-through functions. I’d say it’d be nice to get them for free, but nothing in Java or C++ is for free, and I’d have the same problems with R.
If anyone does know of a drop-in replacement for StatsBase.Histogram then please chime in!