(a) More mnemonic names tend to be over-specific (not all cdrs are tails), and (b) after a week of using Lisp, car and cdr mean the two halves of a cons cell, and languages should be designed for people who've used them for more than a week.
-
-
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Thoughts on hd & tl? Shorter and more mnemonic? Just doesn’t have the same history as car and cdr.
-
More mnemonic, yes, but too mnemonic: when you're using cons cells to represent binary trees, the right subtree is not a tl.
- Show replies
New conversation -
-
-
If you don’t have constraints on the length, why not just give them full names that clearly indicate what they do? If it’s important to write copy in decks and blog posts using clear and simple language, why not a codebase?
-
You use them so often that any name would be equally mnemonic after a week, so you might as well pick a pair that are short.
- Show replies
New conversation -
-
-
I like the length, composability and specificity. My only issue: I find them just slightly too close visually. Why not something like car and ctr? (Other than historic reason)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
What do you think about fst (for first) & rst (for rest)?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
It seems in Clojure such names aren’t so important since we don’t use them as much as other Lisps. Because we use maps so much we’re 50% of the time using keywords to navigate our data structure. The other 49% we just use destructuring, because of its brevity and simplicity.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
My CompSci prof. introduced it as "car and coolder". It stuck with me for over a decade now.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.