Feature #13933
open
Note that Range#size
currently returns nil
for ranges of string, so it's not clear what empty?
would return for ranges of strings.
Range mixes in Enumerable so you can use #none?.
('a'..'b').none? #=> false
('b'..'a').none? #=> true
I think the semantics between ".none?" is not the same as ".empty?". At
the least the latter appears to be more explicit to me.
But it's also not that important to me personally, I am fine either way. :-)
Also available in: Atom
PDF