[ruby-core:73050] Re: [Ruby trunk - Feature #12012] [Open] Add Boolean method

From: Matthew Kerwin <matthew@...>
Date: 2016-01-21 21:43:41 UTC
List: ruby-core #73050
On 21/01/2016 8:38 PM, <ka8725@gmail.com> wrote:
>
> What do you think, guys, about this suggestion?
>

There is a real risk inherent in mixing natural truthiness (`!!foo`) and an
arbitrary definition of what we may consider "usefully true".

Compare your set of truthy-y values to mine here:
https://github.com/phluid61/mug/blob/master/lib/mug/bool.rb

It defitinitely needs a strong, consistent rationale to describe what is
truthy-y and what isn't. In my case, testing for zero, blank, and empty
were useful for me, so I created my #to_b to do that.

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next