It sounds great in theory, except that it returns an object of the wrong
type half of the time (for example, similar, copy, sub, slice, etc.) and
half the time it will happily do an invalid or meaningless operations (such
as taking dot products of Cubes or mutating them to have the wrong
dimensions) simply because such operations are reasonable on the base type.
And that's just generally worse than useless.

On Sat, Apr 25, 2015 at 1:55 PM Marcus Appelros <[email protected]>
wrote:

> Feels somehow sufficient to direct all functions to the data field. We can
> have a macro like
>
> @foranyfunction f(c::Cubes,a::AnyArgs)=f(c.data,a)
>
>
> "What you really want to be able to do is delegate everything to the .data
> member, but there's no convenient way to do that"
> There are some existing macros that take a list of functions and define
> them on a type, we can wrap a macro that acts on all functions in
> methods(T).
>
> Or allow inheriting from concrete types.
>
> Or allow specifying abstract types like AbstractArray{T,N}.
>

Reply via email to