Programing: Lisp: I Can Not Find a Word Better than “car”

By Xah Lee. Date:

On 2009-06-14, Stefan Ram 〔r…@zedat.fu-berlin.de〕 wrote:

I was searching for a word referring to the »x« and »y« in the
relation »R(x,y)«. Assume, for a moment, the word would be
»alpha« and »beta«, respectively, then I would like to write
this explanation of "is a":

  "is a"
  the relation, where the alpha is an instance of the beta
                          ¯¯¯¯¯                       ¯¯¯¯
I looked up these web pages to find common, simple words for
the placeholders »alpha« and »beta«:

http://en.wikipedia.org/wiki/Binary_relation
http://en.wikipedia.org/wiki/Relation_algebra

.

I found none.

So actually, »CAR« and »CDR« are the nicest words for these
concepts I am aware of. I can pronounce them, I do not think
of IBM 704 registers when I use them. And they are well
established. Or are there any other terms, I could use instead
of »alpha« and »beta« above?

I could use »first component« and »second component«, but this
is a two-word term (compound term). I do not deem compound
terms to be appropriate for such fundamental concepts. For the
same reason, I prefer »pair« to »2-tuple«. A 2-tuple might
have a »first component« and a »second component«, but a pair
should have a CAR and a CDR (or some other single-word term).

On 2009-06-14, Stefan Ram 〔r…@zedat.fu-berlin.de〕 wrote:

I was searching for a word referring to the »x« and »y« in the relation »R(x,y)«.

In your case, first of all, you need to give a context. Without a particular specialization, “first element” and “last element” is perfect.

Your question seems idiotic to me. It seems to be from the college student who has nothing to do. Philosophizing is a good thing, but your thinking on the issue as presented in your post is quite newbie. I'll explain a bit.

I was searching for a word referring to the »x« and »y« in the relation »R(x,y)«.

Ok. I'm expecting some context, or special field, that requires some special terminology. However, you didn't give much in the rest of your post. Fuzzily, you seem just want to rename the terms used in lisp langs. i.e. your context, is lisp languages cons cells. But are you considering this as for a new lisp lang? or do you mean this to be a thought experiment about “What terms would it be if we were to update lisp lingoes”? For a new lisp lang, trying to find a new term for things similar to traditional lisp's car cdr is sensible. For updating lisp lingoes, of course it won't fly in reality, but as a philosophization, that's ok, however, the context is different from say if you are writing a new lisp lang, and thus the candidate set of good terms differ in the two contexts.

Ok, so now suppose we are looking for a term for the first/second element of lisp's cons cell, and we are waxing philosophy on this, but other than that, no other specifics. Then, i think, “first” and “second”, is good enough. Alpha and Beta is good, x and y could also be employed.

Also note that, the traditional term, “car” and “cdr”, are functions that access the first or second elements. They don't refer to the first or second elements themselves, it's just that it is also convenient to use them to mean the first and second elements in practice, because there's generally no ambiguity. More properly, you'd say the “car component” or “cdr component”, or “first element of cons cell” and “second element of cons cell”.

Assume, for a moment, the word would be »alpha« and »beta«, respectively, then I would like to write this explanation of "is a": "is a" the relation, where the alpha is an instance of the beta

Several things wrong here.

First, please don't use the “is a” term. The usage doesn't make sense. Did you pick up the “is a” phrase from the object oriented programing community?

Secondly, the second element in a cons cell is not a “instance” of its first element. The 2 elements in a cons cell do not have hierarchical relation in any sense. Their only relation, is ordinal. i.e. one comes after the other, as in B comes after A, 2 comes after 1, u comes after i.

Now, taking a lead from your fashion of thinking, i'm thinking what possible good terms would be if we wax mathematics in… Mmm, there is in fact a close analogue: complex numbers. So, your “car” can be called the real part, and your “cdr” can be called imaginary part, and a fashionable coder could say, that the cons cell has a “is a” “relation”, where the “complex” part is a “instance” of the “real” part. (I LOL)

I looked up these web pages to find common, simple words for the placeholders »alpha« and »beta«:

http://en.wikipedia.org/wiki/Binary_relation

http://en.wikipedia.org/wiki/Relation_algebra

.

I found none.

Let me give a analogy that illustrate your folly.

Suppose i'm creating a lisp-like lang, and in my lisp, i have a cons like thing, except it has 3 cells. Suppose this “cons with 3 cells”, is called “fons” in my lang. Fons has 3 accessors, called “car”, “cbr”, “cdr”. These terms are based on lisp tradition. But now suppose, i'm dissatisfied with these terms, so i looked up 3-body problems in mathematics. JESUS, I FOUND NONE! Therefore, in actualality, car, cbr, cdr are the best! When i see them, i don't think of IMB 666 registers. I could use “first component”, “middle component”, “third component”, but that constitute the ill of wordygidiss!

I could use »first component« and »second component«, but this is a two-word term (compound term). I do not deem compound terms to be appropriate for such fundamental concepts. For the same reason, I prefer »pair« to »2-tuple«. A 2-tuple might have a »first component« and a »second component«, but a pair should have a CAR and a CDR (or some other single-word term).

Have you considered weet and woot?

Further readings:

By the way, )please( do )not( reverse the role of matching pairs such as )1( ]2[ }3{, »because, )you see?(, it fcks up senses.«

On this issue, please have a read at: The Moronicities of Typography, bottom, on the section «Quotation Marks».

Ask me question on patreon