The problem with not specifying D is type inference. I actually have more 
entries in Foo and would like

type Foo{D}
baz::Array{D}
bar::Array{D+1}
end


I want to use Foo in calculations and for D = 1 I am doing something like

baz + bar[:,1]
baz + bar[:,2]


For D = 2:

baz + bar[:,:,1]
baz + bar[:,:,2]


I *could* instead (for D = 2) move the third dimension to extra columns...


On Wednesday, June 1, 2016 at 8:56:28 PM UTC+2, Robert DJ wrote:
>
> I have a custom type with a TypePar denoting a dimension and would like to 
> define the following:
>
> type Foo{D}
> bar::Array{D+1}
> end
>
> However, this does not work. As D is only 1 or 2 it would OK with
>
> type Foo{1}
> bar::Matrix
> end
>
> type Foo{2}
> bar::Array{3}
> end
>
> but unfortunately this isn't working, either. 
>
> Can this problem be solved?
>
> Thanks!
>

Reply via email to