Hacker News new | ask | show | jobs
by mumblemumble 1825 days ago
It's not a Common Lisp book, but I'd highly recommend The Little Schemer if you're looking to grok lisp.
1 comments

The little schemer is great, especially in understanding recursion and tail call optimization (pass an accumulator to track the result as a parameter). However I was never able to understand the chapter that builds the y combinator (and I actually was never able to understand that concept)...
If it helps, I'm rather fond of this explanation: https://mvanier.livejournal.com/2897.html

Especially this part, from toward the beginning:

> Before I get into the details of what Y actually is, I'd like to address the question of why you, as a programmer, should bother to learn about it. To be honest, there aren't a lot of good nuts-and-bolts practical reasons for learning about Y. Even though it does have a few practical applications, for the most part it's mainly of interest to computer language theorists.

The article goes on to explain why you should learn it, anyway, but, still, it's not like monads and Haskell. Despite the concept's intellectual cachet, you don't need to understand it to be an effective lisper. That said, this opinion is mine and mine alone, and stands in direct contradiction to the sentiment expressed in the following paragraph.

Thanks for the link I'll take a look. I agree that you don't need to understand y to be an effective lisper. I have used lisp and various other functional languages over the years in various projects and there wasn't a use case for y combinator...
Its official use case is hacking recursion into a language that doesn't support recursion, but does have first-class functions. To the best of my knowledge, the only language that fits this description is the lambda calculus itself.

There is a paper, Y in Practical Programs ( https://blog.klipse.tech/assets/y-in-practical-programs.pdf) that presents some interesting things you can layer on top of the technique. I'll leave it up to others to debate whether doing so is genuinely practical, or more of a game of functional code golf.