1. 31
  1.  

  2. 13

    If you like combinatory logic and this kind of deconstruction, I highly recommend Raymond Smullyan’s book “To Mock a Mockingbird,” which teaches combinatory logic through an extended tale of birds in a forest, and poses a variety of puzzles to compose birds (combinators) together to produce different results!

    1. 3

      Oh, thank you. I have Smullyan’s guide to mathematical logic and it’s a good read. I’ll add this to the list.

    2. 9

      Looks like they discovered some lambda calculus idiom, if you squint hard enough it looks like fixed-point function / Y combinator.

      1. 6

        I saw the title, clicked, searched for Y combinator to verify that was what the article was about and … didn’t find it. I wouldn’t expect someone to stumble upon it on their own any more, given that picking up enough background to be able to get there will usually acquaint you with it. But apparently that still happens, which seems like it would be a very nice experience to have.

      2. 6

        after sifting through a bunch of “No you can’t do this” answers I found a particularly funny looking expression that claimed to be the solution.

        I know it’s internet, but actually citing the source benefits everyone.

        For those who don’t know, here is a possible source: http://rosettacode.org/wiki/Y_combinator#Python

        1. 3

          Knowing these kinds of combinators does come in handy in some cases, for example if you need to memoize a recursive function, or if you need to express mutual recursion in a parser combinator in a strict language.

          1. 3

            FYI: the title is a reference to: I have no mouth, and I must scream. Didn’t read the book, but played the video game, liked it very much ;)

            1. 2

              You can, of course, do everything with lambdas in Python, you just need to have enough of them

              1. 2

                This exact problem is why arguments.callee exists in javascript