They also are printed and read in similar to racket, starting with #(, however there is not yet support for putting a number in between the # and the (
The main difference between directly writing Vector literals and using (vector v ...) is that the former works with a smaller set of values than the latter, partially because I'm not sure the best way how to make it work great with lists. Writing the literal does not evaluate anything inside of it, while using the vector keyword will evaluate the expressions within.
Added support for vectors, mirroring https://docs.racket-lang.org/reference/vectors.html
Vectors can be created via:
(make-vector size [v])
(vector v ...)
They also are printed and read in similar to racket, starting with
#(
, however there is not yet support for putting a number in between the#
and the(
The main difference between directly writing Vector literals and using
(vector v ...)
is that the former works with a smaller set of values than the latter, partially because I'm not sure the best way how to make it work great with lists. Writing the literal does not evaluate anything inside of it, while using the vector keyword will evaluate the expressions within.I also implemented the functions
(vector-length vec)
(vector-ref vec pos)
(vector-set! vec pos v)
(vector-cas! vec pos old-v new-v)