I would like to generate a matrix (perhaps with numbers from a process, used 0 for simplification as below) in racket. I tried
(array (for/vector ((x (range 4)))
(for/vector ((y (range 4)))
0)))
which gives
(array '#(#(0 0 0 0) #(0 0 0 0) #(0 0 0 0) #(0 0 0 0)))
Silly enough though,
(matrix? (array (for/vector ((x (range 4)))
(for/vector ((y (range 4)))
0))))
gives #f, and so does (array '#(#(0 0 0 0) #(0 0 0 0) #(0 0 0 0) #(0 0 0 0))). Yet
> (matrix? (array #(#(0 0 0 0) #(0 0 0 0) #(0 0 0 0) #(0 0 0 0))))
#t
So what's going wrong with it?
EDIT: the matrix module is imported from math/array and math/matrix.