From: Dennis Decker Jensen Date: 2001-06-19T03:14:20+09:00 Subject: [ruby-talk:16595] Re: RCR: Enumerable: every() and none() "Mathieu Bouchard" wrote: > > On Tue, 19 Jun 2001, Hugh Sasse Staff Elec Eng wrote: > > > > def every(&block) > > find_all(&block) == to_a() > > end > > > > def none(&block) > > reject(&block) == to_a() > > end > > instead: > > def all? ; each {|x| return false if not yield x }; true ; end > def none?; each {|x| return true if yield x }; false; end > > is this right? (this is a shortcutting version) Yes, it is right. This is not the first time this RCR has been up though... For instance see [ruby-talk12330] and [ruby-talk:5017] I certainly would like to see the operators in the former suggestion :-) Dennis