As names, car and cdr are great: short, and just the right visual distance apart. The only argument against them is that they're not mnemonic. But this is a weak argument.
-
-
Why did you go with “pair” instead of “cons” in bel?
-
Because cons is not the primitive that makes them. That's join. It would have been weird for join to make things with the name of a function built on top of it. So I could use cons for the name of the function or the name of the type, but not both, and I chose the former.
End of conversation
New conversation -
-
-
It's easy to come up with something better, e.g. glc/grc for get left/right of cell. I've used car/cdr for years (and the Tezos VM even has them as opcodes) and I still find myself thinking: "cdr, d comme droite".
-
glc/glr are not as pronounceable as car/cdr
- Show replies
New conversation -
-
-
Is it necessarily true that you can't use Lisp for more than a week without being aware of how it's implemented? And if yes, is this a good thing? The fact that Lisp has cons cells as a basic data type seems like exactly the sort of implementation detail which shouldn't matter.
-
It sounds like you may be conflating conses and lists. If conses were only used for lists, then it would be an implementation detail that they were made of pairs. But conses aren't only used for lists.
- Show replies
New conversation -
-
-
Most likely an accident, but the mix-n-match of a’s and d’s (as in “cadar” = (car (cdr (car …))) ) still improves program brevity quite a bit when working a lot with lists in ways that are hard to recover when using more proper names.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
This is the flaw for something like spacemacs, trying to push everything to mnemonics. Learning a new system or language should reduce complexity (with new words with unique meaning, like car/cdr) not increase it by requiring on-the-fly composition (most software)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I wonder if these names are too general. The meaning seems different based on the data structure. Clojure does something interesting: first, second, and rest functions cover car and cdr There is cons for lists, but different constructors for other types
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
This Tweet is unavailable.
-
Wheeo... I followed through to the Wikipedia pages on cons cells and algebraic datatypes: Voila there's a ref to the HOPE "programming language". Nostalgia rush running through my vains. The derivative icHope was my introduction to abstract datatypes at
@unirostock
End of conversation
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.