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

Another possibility is LHS and RHS for Left Hand Side and Right Hand Side (if you want to emphasize the use of a cons cell as a pair rather than a linked list).


    Date: 5 March 1980 08:54-EST
    From: Mark L. Miller <MILLER at MIT-AI>
    To:   Dave.Touretzky at CMU-10A, RWK
    cc:   KMP, HIC, BUG-LISP
    Re:   CAR and CDR
    
    Of course, you could rename them to, e.g., "LHS" and "RHS" for "Left Hand
    Side" and "Right Hand Side".  This would address the composition argument
    in favor of CAR and CDR: CADR -> LRHS (left-hand-side of right-hand-side),
    CDADADR -> RLRLRHS, and so on.   It's easy to provide these as macros.
    
    Later, you can explain that the original names are CAR and CDR, and isn't
    that silly, etc.
         Regards, Mark


Shows you how resilient car and cdr have been against decades of complaining and bikeshedding. That just reaffirms them.


I would accept that if Lisp were a runaway success, but it's not. It is very nearly a dead language [1]. It is entirely possible that the unwillingness of the Lisp community to give up in this obscure terminology in favor of something more user friendly contributed to its demise.

[1] Look at e.g. https://madnight.github.io/githut/. The most popular Lisp is Clojure, with a whopping 0.33% market share. Scheme and Common Lisp don't even make it to the top 50.


> It is entirely possible that the unwillingness of the Lisp community to give up in this obscure terminology in favor of something more user friendly contributed to its demise.

What more-user-friendly terminology do you suggest?


Did you not read the upstream comments? FST and RST, or LHS and RHS depending on whether the intent is to access the cons as a linked list or a pair.


The D in CDR already corresponds to "dexter-" (right); we just need "L" for "levo-":

CLR: cell levo/left reference.

CDR: cell dexter reference.

Organic chemistry uses these letters and prefixes. E.g. "L-glutamine", "D-glucose" (a.k.a "dextrose").

The H and S (hand side) don't really contribute anything. (Yes, left is side and a hand).


The whole point of this exercise (if it has a point at all) is not to come up with acronyms with justifiable expansions, but to come up with something that is less newbie-bostile. I'm not sure CLR/CDR fits the bill any better than CAR/CDR. Part of the problem with CAR/CDR is that CAR is an English word that means automobile, and people get a little hung up on that when they first see it. Likewise, CLR is usually a shortened form of the word "clear". So I'm not sure that CLR/CDR is any better than CAR/CDR. One of the advantages of LHS/RHS and FST/RST is that none of those trigrams have any semantic baggage associated with them other than their intended meaning.


Why trigrams: (cl x) (cr x). cell left, cell right.

I don't think car and cdr are newbie hostile; they are rather troll-fertile.


CL was #45 in the car quarter of 2017; by cadr, it slipped into the long(er) tail.




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

Search: