From: Robert Klemme Date: 2010-07-31T19:14:27+09:00 Subject: Re: .any?{} Behavior 2010/7/30 Jarmo Pertman : > I'd have to agree with John on this one. It is really bizarre that > [].any? returns false and [].all? returns true. It is just not what to > expect without reading documentation and thinking about every word > written in there and trying things out in irb. This behavior is _exactly_ what I expect from these methods. Otherwise it would break all sorts of boolean logic. These methods are defined the way they are with good reason - even if this does not meet your expectation here. It's the most reasonable definition in light of boolean logic and De Morgan's laws which I believe *everybody* writing software must know by heart and understand because it is at the very foundation of our profession. > I love Ruby because most of the time everything just works as you'd > expect without reading any documentation at all and this is not the Frankly, this is a dangerous thing to do. Generally doing away with documentation will bring you in trouble sooner or later. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/