Skip to content

Referencing

Uri edited this page Jul 15, 2021 · 3 revisions

Ref

Every element of array can be accessed using function Ref.

Indices counting from 1 (not zero!). Negative indices has meaning "from the end of array". If no element available Ref returns #false.

> (define m (Matrix [1 2 3 4]
                    [5 6 7 8]))
> (Ref m 1 1)
1
> (Ref m 2 2)
6
> (Ref m -1 3)
7
> (Ref m -1 -1)
8
> (Ref m 1234 122)
#false
> (Ref m 2)
#(5 6 7 8)
Clone this wiki locally