3 ms·
If you have function application, then you don't truly need a primitive conditional. You can represent Boolean values and conditional functions with the Church
by tmhedberg 14y ago
If you have function application, then you don't truly need a primitive conditional. You can represent Boolean values and conditional functions with the Church encoding [1]. This is how conditionals are represented in, for instance, the lambda calculus.
[1] http://en.wikipedia.org/wiki/Church_encoding#Church_booleans http://en.wikipedia.org/wiki/Church_encoding#Church_booleans
- btilly 14y agoGood point. But you need to have first class functions for that. This toy language does not. And converting from "this native number equals that native number" to your encoding of "true" is going to be an interesting trick.