Hacker News new | ask | show | jobs
by tmhedberg 5166 days 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

1 comments

Good 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.