You could achieve much of the same effect with a macro, but then you would 
have to specify the maximum number of elements as a code constant. 

kl. 16:47:56 UTC+1 tirsdag 28. oktober 2014 skrev Andrew Gibb følgende:
>
> Is there a way to create a parameterised type where the parameter 
> describes the number of items, ie
> type Thing{N<:Integer}
>     for i = 1:N
>        a_i::Float64
>    end
> end
>
> I realise one could achieve this simple example with an array, but I'm 
> trying to create a type which holds scale space. My current thinking is 
> this would consist of  a parameterisable number of images each with a 
> parameterisable number of layers. And each image in the sequence has the 
> two spatial dimensions (not the number of layers) reduced by a factor of 
> two. 
>
> I guess you cold do some tricks with array packing, but I guess I'm 
> looking for something more elegant. Is there any way to use the type 
> parameter to indicate a number of elements in this way?
>
> Andy
>

Reply via email to