Re:Please reconsider the Boolean evaluation of midnight
by StefanKarpinski on Thursday March 06, 2014 @07:16PM
(#7357526)
This is a nice clean criterion, but it's still pretty unclear to me why the zero element of a monoid should be considered falsey at all.
[ Parent
| on HN ]
Re:Please reconsider the Boolean evaluation of midnight
by chrismonsanto on Thursday March 06, 2014 @08:24PM
(#7357872)
Because when writing a recursive function, the zero element is generally the base case.
if x:
<destructure x, recurse on subparts>
else:
return <something>
This applies to (natural) numbers as well--'destructuring' usually means decrementing the number.