What is `N` in `Array{T,N}`?

As in the title, what is N in Array{T,N} ?
When dealing with parametric types, the doc shows the parameter being a Type, but here it is an integer.
The doc actually says: " it can be any type at all (or a value of any bits type, actually, although here it’s clearly used as a type). Point{Float64} is…"

Is this the case?

It’s intended to be the number of dimensions (i.e. 1 for a Vector, 2 for Matrix etc). However, syntactically, you can make it whatever you want. Array{Float64, 'q'} is a valid type, even if you can’t instantiate it.

That’s what you have here. For Array{T,N}, the parameter N is the value of a bits type (an Int value), indicating the dimensionality of the array.

2 Likes