> I do not know how to do the n-ary selector (and I doubt that it is
> possible). I can do it for the Church encoding of that function
> though, [...] As for printf-like, yes, you can do that - you just
> need to write things in CPS.
Aha, thanks, it's good to know that it can be done if necessary.
I'm not sure I want normal programmers to use Church numberals or
CPS though. I don't expect such complicated encodings in
metaprogramming, which is already more complicated than normal
programming, to have good large-scale software engineering properties.
There is a reason why mainstream languages have a built-in type
for numbers, rather than relying on Church numerals, and why
CPS is not the default way of returning a result from a function.