From: Tom Clarke Date: 2012-02-09T03:50:50+09:00 Subject: Re: Require bug confirmation: possible 'times' method error --bcaec54ee942beb65204b8785ff2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, I realised what Randy was trying to say about 5 minutes after I stepped away from my computer (I often think best away from it). Apologies for being short with you Randy, I understand what you were trying to say now., thank you for your help Thank you to Ian and Matma for your explanations also. Cheers, Tom 2012/2/8 Bartosz Dziewo=C5=84ski > Calling num.times{|i| ...} counts from 0 to num-1, *not* from 1 to num. > > Therefore, using 6 here will never trigger the condition (since 5 is > not greater than 5), the explicit return will not be used, and the > method will return the value of last expression. This expression is > the #times block, and #times returns the receiver (ie., the number it > was called on) - in this case, 6. Then the multiple assignment will > assign 6 to first variable, and nil to the second one. > > -- Matma Rex > > --bcaec54ee942beb65204b8785ff2--