Discussion:
"CDR down the list..."
(too old to reply)
HenHanna
2024-07-11 05:50:50 UTC
Permalink
"PDL" -- which (in the old days) was often compared to
those Dish-dispensers (with Springs) in Cafeterias.



Another nostalgic term is to "CDR down the list..."

whch makes me imagine a hapless (Mr.)Pointer who can be
jetsoned(?) to ANY POINT in heap memory.

like the BALL in a pin-ball machine.

-- like the gumshoe (P.I.) in Citizen Kane
or another Noir film.


Maybe in Gauche, lists are allocated more like
Python Lists or vectors?
Peter Moylan
2024-07-11 05:57:57 UTC
Permalink
Post by HenHanna
Another nostalgic term is to "CDR down the list..."
It is indeed many years since I last used CAR and CDR in anger, but I
don't remember it with nostalgia.
--
Peter Moylan ***@pmoylan.org http://www.pmoylan.org
Newcastle, NSW
Lawrence D'Oliveiro
2024-07-11 06:39:07 UTC
Permalink
Post by Peter Moylan
Post by HenHanna
Another nostalgic term is to "CDR down the list..."
It is indeed many years since I last used CAR and CDR in anger, but I
don't remember it with nostalgia.
Proper CompSci terms should not have such proprietary origins.
Aidan Kehoe
2024-07-11 07:01:50 UTC
Permalink
Post by Lawrence D'Oliveiro
Post by Peter Moylan
Post by HenHanna
Another nostalgic term is to "CDR down the list..."
It is indeed many years since I last used CAR and CDR in anger, but I
don't remember it with nostalgia.
Proper CompSci terms should not have such proprietary origins.
“Contents of the decrement register,” wasn’t it? Not horrific on that front.
But yes, a more general word would be ideal.

A (the) codebase I work on has a Lisp implementation as well as a lot of C. The
Lisp data types and related functions are easily available to the C code.
Nonetheless there are loads of C structures that just incorporate their own
next pointer and roll their own linked lists that way, requiring separate list
traversal, searching, sorting, cycle detection code ...
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after fourteen pints of stout’
(C. Moore)
Lawrence D'Oliveiro
2024-07-11 07:21:09 UTC
Permalink
Post by Aidan Kehoe
“Contents of the decrement register,” wasn’t it?
Might have been “displacement register”. Not sure.

There was another language from the late 1960s or so that included list
processing as well as a bunch of other features, called “POP-2” (later
variants included “POP-11” and also a combination with Prolog called
“Poplog”). That one decided to use the selectors “hd” and “tl” in place of
“car” and “cdr”. Actually these names invoked functions that did “lazy
evaluation”, allowing for lists that were not completely filled out at
initial creation time. There were underlying selectors called “front” and
“back” if you wanted to get at the elements of the actual pair that held a
realized element of the list.
Kaz Kylheku
2024-07-11 07:24:19 UTC
Permalink
Post by Aidan Kehoe
Post by Lawrence D'Oliveiro
Post by Peter Moylan
Post by HenHanna
Another nostalgic term is to "CDR down the list..."
It is indeed many years since I last used CAR and CDR in anger, but I
don't remember it with nostalgia.
Proper CompSci terms should not have such proprietary origins.
“Contents of the decrement register,” wasn’t it? Not horrific on that front.
But yes, a more general word would be ideal.
John MacCarthy obviously cared about naming. The FLPL (Fortran List
Processing Language) had awful function names like XCARF and XCDRF.

He had the presence of mind to drop the gratuitous X and F.

However, he was fine with the names like CAR and CDR and used that in
papers before Lisp existed.

The two fields of a binary cell can be used in a myriad ways with
as many meanings. Therefore names for their parts which have no meaning
are fitting; they do not skew the interpretation of the program with
inappropriate connotations.

When you see nothing but a bunch of car and cdr in code, you know it's
just working with shape. Whatever meaning the shape has has is imposed
elsewhere.
Post by Aidan Kehoe
A (the) codebase I work on has a Lisp implementation as well as a lot of C. The
Lisp data types and related functions are easily available to the C code.
Nonetheless there are loads of C structures that just incorporate their own
next pointer and roll their own linked lists that way, requiring separate list
traversal, searching, sorting, cycle detection code ...
Inside a Lisp-in-C impementation, the garbage collected Lisp list are
not always the most efficient thing to use, and could even cause
problems in code that interacts with the memory mangement and GC.
When internal structures use their own links, it's a clean separation.

Another consideration is that in C we often use intrusive containers,
including lists. The objects contain the link node as part of their
representation, and so can be put on a list without having to allocate
a list cell. This constrains them to be one one list at a time
(if they have one link field) and that is actually enough in
many situations.

Intrusive lists and other data structures can be had in a generic way;
for instance with the BSD TAILQ macros. You don't have to write
multiple sort or cycle detection routines.
--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @***@mstdn.ca
Aidan Kehoe
2024-07-13 07:19:50 UTC
Permalink
Post by Kaz Kylheku
Post by Aidan Kehoe
A (the) codebase I work on has a Lisp implementation as well as a lot of
C. The Lisp data types and related functions are easily available to the C
code. Nonetheless there are loads of C structures that just incorporate
their own next pointer and roll their own linked lists that way, requiring
separate list traversal, searching, sorting, cycle detection code ...
Inside a Lisp-in-C impementation, the garbage collected Lisp list are
not always the most efficient thing to use, and could even cause
problems in code that interacts with the memory mangement and GC.
When internal structures use their own links, it's a clean separation.
The internal structures are also subject to garbage collection and protection
therefrom in this case.
Post by Kaz Kylheku
Another consideration is that in C we often use intrusive containers,
including lists. The objects contain the link node as part of their
representation, and so can be put on a list without having to allocate
a list cell. This constrains them to be one one list at a time
(if they have one link field) and that is actually enough in
many situations.
That’s the one benefit of the current approach in this codebase, a little less
memory for a couple of hundred fairly small objects, at the expense of a larger
code segment with more bugs.
Post by Kaz Kylheku
Intrusive lists and other data structures can be had in a generic way;
for instance with the BSD TAILQ macros. You don't have to write
multiple sort or cycle detection routines.
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after fourteen pints of stout’
(C. Moore)
Nils M Holm
2024-07-11 08:35:42 UTC
Permalink
?Contents of the decrement register,? wasn?t it? Not horrific on that front.
Content of the Decrement part of a Register. Some instructions on the
704 divided 36-bit words into four parts: prefix, decrement, tag, and
address:

-3-|-------15------|-3-|-------15------
PPP DDDDDDDDDDDDDDD TTT AAAAAAAAAAAAAAA

CAR and CDR extracted the D(ecrement) and A(ddress) parts. Because the
machine had 15 address lines, a CONS could be stored in a single machine
word. Personally, I like the names CAR and CDR and how they extend, e.g.
CADR, CDDR, etc.
--
Nils M Holm < n m h @ t 3 x . o r g > http://t3x.org
Adam Funk
2024-07-11 10:09:31 UTC
Permalink
Post by Peter Moylan
Post by HenHanna
Another nostalgic term is to "CDR down the list..."
It is indeed many years since I last used CAR and CDR in anger, but I
don't remember it with nostalgia.
<https://www.zazzle.co.uk/my_other_car_is_a_cdr_bumper_sticker-128776132386843273>
--
books by the blameless and by the dead
lar3ryca
2024-07-12 06:26:22 UTC
Permalink
Post by Adam Funk
Post by Peter Moylan
Post by HenHanna
Another nostalgic term is to "CDR down the list..."
It is indeed many years since I last used CAR and CDR in anger, but I
don't remember it with nostalgia.
<https://www.zazzle.co.uk/my_other_car_is_a_cdr_bumper_sticker-128776132386843273>
My favourite "My other car" bumper sticker is:

My other car is also junk.
--
All you need in this life is ignor­ance and confi­dence,
and then success is sure.
~ Mark Twain
Kaz Kylheku
2024-07-12 06:51:13 UTC
Permalink
Post by lar3ryca
My other car is also junk.
This would make a nice one: "Parts from my other car got this one moving."
--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @***@mstdn.ca
Adam Funk
2024-07-12 12:07:40 UTC
Permalink
Post by Kaz Kylheku
Post by lar3ryca
My other car is also junk.
This would make a nice one: "Parts from my other car got this one moving."
One of my friends used to have two air-cooled VW vans, which he
maintained and repaired himself. Usually one was in service at a time.
--
Gentlemen, you can't fight in here! This is the War Room.
---President Muffley
Kaz Kylheku
2024-07-12 12:17:24 UTC
Permalink
Post by Adam Funk
Post by Kaz Kylheku
Post by lar3ryca
My other car is also junk.
This would make a nice one: "Parts from my other car got this one moving."
One of my friends used to have two air-cooled VW vans, which he
maintained and repaired himself. Usually one was in service at a time.
The other was being ... air-cooled at the moment.
--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @***@mstdn.ca
lar3ryca
2024-07-12 21:04:47 UTC
Permalink
Post by Kaz Kylheku
Post by lar3ryca
My other car is also junk.
This would make a nice one: "Parts from my other car got this one moving."
One that I never had, but only saw, was:

All parts falling off this car are of the finest British workmanship.

I really wanted one for my TR3.
--
Chris: Hey can I borrow a ten?
Kristen: Sure.
Christen: Thank you.
Kris: You're welcome.
Lawrence D'Oliveiro
2024-07-11 05:59:08 UTC
Permalink
Post by HenHanna
Another nostalgic term is to "CDR down the list..."
The trouble with being a jack-of-multiple-trades is when you get these
terminology collisions between different application areas.

For example, in telephony, “CDR” stands for “Call Data Record”.

Just as well the “CD-R” usage is just about obsolete ...
Loading...