From: Robert Klemme Date: 2013-03-06T03:33:04+09:00 Subject: Re: How `next` works in ruby with `unless` ? On Tue, Mar 5, 2013 at 7:23 PM, wrote: > Am 05.03.2013 19:18, schrieb Kumar R.: > >> Kumar R. wrote in post #1100105: > > >>> line : "next puts "hi" unless n == 5 " . >> >> >> next generally used to skip the part of execution and send the control >> to the beginning. But how the in between part puts "hi" has been >> executed. Why does next not skip this statement ? Probably because arguments are always evaluated before the "method" they are handed over to. > Nobody writes code like this, so why care. I wasn't even aware that next accepts an argument - funnily it won't accept two (syntax error). Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/