From: Pit Capitain Date: 2005-09-20T17:08:56+09:00 Subject: Re: ruby idiom for python's for/else while/else William James schrieb: > ... > (2...50).select{|n|(2..Math.sqrt(n).to_i).select{|x|n % x == 0}.empty?} > --> > [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47] Should be a little bit more efficient: (2...50).reject{|n|(2..Math.sqrt(n)).find{|x|n % x == 0}} It's not what the OP wanted, though. Regards, Pit