4 ms·
This is neat, but doesn't it beg the question a little bit? You've used a conditional here in your definition. Can you define cond using only lambdas? (My ap
by sevensor 8y ago
This is neat, but doesn't it beg the question a little bit? You've used a conditional here in your definition. Can you define cond using only lambdas? (My apologies if the linked article does this, I haven't made it all the way through yet.)
- edflsafoiewq 8y agoYes. You encode true as λx.λy.x and false as λx.λy.y and then (if p then a else b) becomes just (p a b). See https://en.wikipedia.org/wiki/Church_encoding#Church_Booleans https://en.wikipedia.org/wiki/Church_encoding#Church_Boolean.... That page also has encodings of pairs and lists.
- sevensor 8y agoWhoa. That's really cool! Thanks for the link.