What does “my other car is a cdr” mean?

前端 未结 3 1317
滥情空心
滥情空心 2021-02-01 00:22

Can anyone well versed in lisp explain this joke to me? I\'ve done some reading on functional programming languages and know that CAR/CDR mean Contents of Address/Decrement Reg

3条回答
  •  一个人的身影
    2021-02-01 00:44

    Yes, definitely a geek joke.

    The names come from the IBM 704, but that's not the joke.

    The joke is (bad) pun on "my other car is a ___." But the in-joke is about recursion.

    When you loop/manipulate/select/invoke/more in lisp you use a combination of car (the first element in the list) and cdr (the rest of the list) to juggle functions.

    So you've got a car, but your other car is your cdr because you can always get a car from a cdr since the cdr is always (in recursion) more elements. Get it? Laugh yet?

    You'll probably have to learn lisp to actually chuckle a bit, or not. Of course, by then, you'll probably find yourself chuckling randomly for no apparent reason because:

    Lisp makes you loopy.

提交回复
热议问题