6 ms·
I love this, but it's an awful lot of complexity to print '9' to stdout. The first time I ran it through a python interpreter, I thought I made a mistake.
by ghiotion 19y ago
I love this, but it's an awful lot of complexity to print '9' to stdout. The first time I ran it through a python interpreter, I thought I made a mistake.
- apgwoz 19y agoI bet you think computing prime numbers with Church Numerals is complex too! :)
- ghiotion 19y agoSee, this is why I love this place so much. I'd never heard of Church Numerals before. From the wikipedia entry: >Many students of mathematics are familiar with Gödel numbering members of a set; Church encoding is an equivalent operation defined on lambda abstractions instead of natural numbers. Utter clarity. Or, at least as clear as the python code the original post points to :-)
- llimllib 19y agogo out and buy Godel, Escher, Bach: Eternal Golden Braid. Right now! It will make your life better.
- ghiotion 19y agoI've always meant to pick that up. Looks like google books has a decent online copy: http://books.google.com/books?id=aFcsnUEewLkC&dq=godel+escher+bach+eternal+golden+braid&pg=PP1&ots=FLMXfhfBwY&sig=A-zkU_v_89SVleKe63f6ipttMP0&hl=en&prev=http://www.google.com/search?q=Godel,+Escher,+Bach:+Eternal+Golden+Braid&sourceid=mozilla-search&start=0&ie=utf-8&oe=utf-8&sa=X&oi=print&ct=title&cad=one-book-with-thumbnail#PRA1-PA1,M1 http://books.google.com/books?id=aFcsnUEewLkC&dq=godel+e... I had a buddy of mine in highschool who used to bring that book with him every time we took LSD. Of course, he's now got his Ph.D. in physics from Purdue.