May 2018
Beginner to intermediate
290 pages
6h 43m
English
Depending on your programming background, the truthy/falsy approach to logic will seem either completely mundane or like an outrage to all that is right and moral. If you lean toward the outrage school of thought, please keep in mind that the false and nil are false and everything else is true rule is not a minor aberration that only pops up when some programmer isn’t careful. There is a lot of code in Clojure that takes advantage of this behavior. For an example of this, look no further than and. While (and true true) does indeed evaluate to true and (and false false) is comfortably false, the and function can and will return some decidedly un-Boolean values:
| | (and true 1984) ; Evaluates to 1984, which is truthy. |
| |
Read now
Unlock full access