4 ms·
In Racket, a vector is a fixed-size contiguous array of memory. The values in each slot of a vector are tagged pointers so values like fixnums don't require any
by Bogdanp 3y ago
In Racket, a vector is a fixed-size contiguous array of memory. The values in each slot of a vector are tagged pointers so values like fixnums don't require any indirection to reach (i.e. they're unboxed). Racket also has specialized vector types for storing fixnums (fxvector), floats (flvector), strings (string) and bytes (bytes).
Other Schemes and Common Lisp have similar constructs. Just because a language is a lisp doesn't mean its primitives have to be implemented using cons cells.
- soegaard 3y agoAs an example of other Schemes, here are the details of the representation used by Larceny (a Scheme): https://www.khoury.northeastern.edu/home/lth/larceny/notes/note2-repr.html https://www.khoury.northeastern.edu/home/lth/larceny/notes/n...