Structura
A blog about programming languages and patterns
Monday, January 17, 2011
Conditionals via callable booleans
I bumped into a language called "tofu" which has an interesting conditional concept:
(number < 0)(-1, 1)
or, in simplified terms:
true(-1, 1)
which translates to:
true ? -1 : 1
I'm not sure it's my favorite way to do it, but still an interesting concept.
Tofu Programming Language
Newer Post
Older Post
Home