Re:Both true and false: a Zen moment with C
by bediger4000 on Wednesday June 27, 2012 @11:56AM
(#4167604)
Super cool, but I was hoping for a "bluff combinator" like C value. See: "How to circumvent church numerals", Mayer Goldberg and Mads Torgersen, Nordic Journal of Computing, Volume: 9, Issue: 1, 2002. Sometimes I can find a PDF, but right now, I can't.
[ Parent
| on HN ]
Re:Both true and false: a Zen moment with C
by gwillen on Wednesday June 27, 2012 @01:08PM
(#4167926)
Assuming the 'bluff combinator' is like what I think it is, you can do similar things in C++ by creating classes with overloaded operators. E.g. overload operator (bool) to return true, and overload operator ! to also return true.