From: "Christopher D." Date: 2012-04-04T04:24:18+09:00 Subject: Re: fibonacci and defining variables Bartosz Dziewoński wrote in post #1054858: > W dniu 3 kwietnia 2012 19:29 użytkownik Christopher D. > napisał: >>    i, p = p, i+p > > Here, the variables are assigned "at the same time" - first, values on > right-hand-side are computed ("p" and "i+p"), and then these values > are assigned to "i" and "p" variables, respectively. > > >>    i = p >>    p = i+p >>  end > > In this case, the assignments are "sequential" - value of "p" is > assigned to "i", and then values of "i+p" is assigned to "p". Since > "i" has changed in the meantime (!) to be equal to "p", this code > gives different results (essentially doubling "p" on each iteration). > > -- Matma Rex Cool, that makes sense, is there any way to do it sequentially without it being on the same line? -- Posted via http://www.ruby-forum.com/.