Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



As 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/n...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: