People new to Lisp quickly encounter the functions
which have seemingly nonsensical names. They originate in the machine
instructions of computers made in the 1950s. In computer terms that is
archaic. The names also do not describe what the functions actually do.
Many new Lispers then wonder whether
cdr are still used,
given that Common Lisp is often punted as a modern language.
The answer is: Yes, Common Lisp (and some other dialects) still use
cdr. They have equivalents named
rest which perform the same functions.
The elements of a cons cell are called
cdr. Lists are
stored using cons cells and since they are an integral part of Lisp’s design,
the archaic names are here to stay.
Some CL programmers use
distinguish between conceptually different data sets. One possibility is to use
cdr to access non-linear sequences such as trees and graphs and
rest to access linear sequences such as lists. This is
only a personal style which may make the code easier to follow but mixing the
functions will still give the same results.