fakir/examples/array.fk

20 lines
332 B
Plaintext

(assert= 8 (ref [2 6 2 8 9] 3))
(assert= 9 (ref [[3 6] [9 2]] 1 0))
($ a ['a' [[2 true] 2.3]])
(assert= 'a' (ref a 0))
(assert= 2 (ref a 1 0 0))
($ (second arr)
(ref arr 1))
(assert= 6 (second [2 6]))
($ (produce)
[2 4 6])
(assert= 4 (second (produce)))
($ arr [2 'bim' produce false])
(assert= 6 (ref ((ref arr 2)) 2))