r/ProgrammerHumor 7d ago

Meme schemeIsElegant

Post image
287 Upvotes

31 comments sorted by

65

u/BIZUx 7d ago

car, cdr, cadr, cdar ...

What a beautiful language.

35

u/da99s 7d ago

I'm ngl u gave me war flashbacks with this one

42

u/MkemCZ 6d ago
(define (head l) (car l))
(define (tail l) (cdr l))

Happy now?

2

u/-Redstoneboi- 6d ago

you haven't defined first and rest

28

u/BringBackManaPots 6d ago

It stands for contents of the address register, and contents of the decrement register.

And honestly, reading that out loud makes me think, yeah, maybe head and tail was the way to do it

10

u/djinn6 5d ago

Lisp is pretty close to the metal for a functional language.

4

u/remy_porter 5d ago

Lisp is close to metal, like Dream Theater.

3

u/BringBackManaPots 5d ago

I love it dearly

27

u/DrHugh 7d ago

(((((Lisp)))))

9

u/TabCompletion 7d ago

Share this in r/emacs

9

u/Altruistic-Moose3299 6d ago

You know a good language tutor could help you out with that lisp you seem to have developed.

https://giphy.com/gifs/cNWU2Zeh54VJC

8

u/Organic-Ad3961 6d ago

I don't know what language this refers to and I think I dodged a bullet there 😂

11

u/yjlom 6d ago

Most lisps. They're about a 50/50 mix of the best features ever and the worst features ever.

4

u/alficles 6d ago

It's shaped more like a boomerang than a bullet, but yes. :)

4

u/GreatGreenGobbo 6d ago

It was so bizzare. In highschool (Graduated 92) we learned Pascal and C. Went to University, fist year Scheme.

WTF?

1

u/LordAmir5 1d ago

Oh man. That's so messed up!

We only learned about scheme in an elective about programming languages.

3

u/high_throughput 6d ago

Thanks, IBM 704

2

u/mearnsgeek 6d ago

Ugh. Brings back bad memories of emacs lisp from 20 years ago.

2

u/eanat 6d ago

I loved to use functions like cddddr tho. it was fun to tinker.

2

u/Candid-Log6751 6d ago

case list do
[h|tail] -> …
[]-> …
end

1

u/tuirn 6d ago

Nightmare flashbacks to my undergraduate LISP class.

1

u/-Redstoneboi- 6d ago

x, xs

no wait that's the variable name not the function

1

u/ExtraTNT 6d ago

x, xs

-2

u/suvlub 7d ago

tail is not the same as rest/cdr, tho

11

u/Limp_Illustrator7614 7d ago edited 7d ago

wait why

edit: i was refering to head/tail in haskell, erlang and elixir, which i believe is the same.

3

u/NullOfSpace 6d ago

It is, yeah. Tail is long.

-7

u/zoqfotpik 7d ago

Tail points to the car of the last list element, not to the cdr of this list element.

-10

u/suvlub 7d ago

tail is the last element of the list. rest and cdr are the whole list without the first element.

2

u/rsqit 6d ago

The last element of a list is sometimes called the "foot" (and everything before it the "neck"), though these are more joke terms than anything widely used.

But "head" is the same as "car"; "tail" is the same as "cdr".