I\'m reading through the excellent Ruby on Rails Tutorial and have encountered the following code.
if 0 true else false end
The above r
In Common Lisp, 0 is also treated as true. For example, the following code returns true.
true
(if 0 'true 'false)
No doubt, Ruby is following the same design decision made in Lisp. In Lisp, only an empty list (represented by nil) is false.
nil