3 ms·
Same here, but cons cells can be used to model things other than lists, where semantically first and rest don't make sense.
by yati 13y ago
Same here, but cons cells can be used to model things other than lists, where semantically first and rest don't make sense.
- thaumasiotes 13y agoI once wrote an in-place quicksort in common lisp where I kept pointers to locations of interest in the list as halves of a cons cell. Was kind of fun coming across it later and figuring out what it did. That cons cell made no semantic sense as a linked list; it was just a pair of pointers.