Re:CAR and CDR
by yati on Wednesday November 20, 2013 @05:41AM
(#6767285)
Same here, but cons cells can be used to model things other than lists, where semantically first and rest don't make sense.
[ Parent
| on HN ]
Re:CAR and CDR
by thaumasiotes on Wednesday November 20, 2013 @06:17AM
(#6767389)
I 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.