Project

General

Profile

Bug #15987

Updated by sawa (Tsuyoshi Sawada) over 5 years ago

Some boolean options (such as the `exception` option in `Kernel#Complex`, `Kernel#Float`, `Kernel#Integer`, and `Kernel#Rational`) distinguish `false` vs. other values. 

 ```ruby 
 Integer("z", exception: false) #=> nil 
 Integer("z", exception: nil) #>> ArgumentError: invalid value for Integer(): "z") 
 ``` 

 But in most other cases where a boolean notion is concerned (for example, the `chomp` option in `Kernel#gets`), the distinction is between falsy vs. truthy values. 

 I request the distinction to be falsy vs. truthy. In other words, I would like the value `nil` to work on the falsy side rather than the truthy side like this. 

 ```ruby 
 Integer("z", exception: false) #=> nil 
 Integer("z", exception: nil) #=> nil 
 ``` 

 side. I listed some such options here, but perhaps there are other options that I missed. I would like the request to be applied for those options too.

Back