![]() Here’s one way we can make a pair: ( def church-pair ( fn ( fn ( selector a b)))) How would you do it? It’s sensible to use a map or a class or a record to represent a pair. Say you wanted to make a data structure for pairs: ( def pair ( make-pair 0 1 )) ( first pair) => 0 ( second pair) => 1 ![]() Let’s step out into the wilderness a bit. ![]() We’re so accustomed that it would surprise us to find the myriad of ways we can bend functions to do just about anything. Here’s what we think functions do: ( def square ( fn ( * x x))) It’s the same with programmers and functions. 0: Intuition with PairsĬity dwellers who drive SUVs rarely consider their cars as ferocious machines that traverse rocky deserts and flooded rivers. In the end you’ll have built just about every programming concept: numbers, booleans, you name it…just with functions. In this essay, we’ll find out what it’s all about, and do things with functions that we’d never have imagined. The most famous, of course, is PG’s Y Combinator. Lambda Calculus is so cool that many hackers use it as their secret handshake - a “discreet signal” if you will. Even cooler is that those very ideas affect us today: anytime you use a function, you owe a hat tip to Mr. It was a phenomenal innovation, given that there weren’t even computers for him to test out his ideas. In 1935, a gentleman called Alonzo Church came up with a simple scheme that could compute…just about anything.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |