programdemos/arrays.xtl

Arrays: dense arrays, 1-origin indexing, the structural built-ins and scalar extension. Run it with "xetal run demos/arrays.xtl" (or "./demos/arrays.xtl"); it prints the result of each line after the definition of m: the matrix, its shape, a row, the last row, the matrix times ten, a row joined to more items and powers of ten. Read it for how r_eshape, s_elect, t_ake and c_at treat a matrix.

source

The matrix

m : Int

value · line 12

m: a 2 by 3 matrix holding 1 to 6, row by row.

m ← 2 3 r̲eshape r̲ange 6