From: "JeremyWoertink@..." Date: 2007-09-07T04:51:02+09:00 Subject: Re: Is this a bug or a feature? I would say this is a feature to answer you question. Just think of what gets printed when you do i = 1 i = i + 1 so you are saying until (i = i + 1) > 5 p i end the second time the i is evaluated is in the until loop. ~Jeremy On Sep 6, 12:00 pm, Martin Jansson wrote: > irb(main):002:0> i=1 > => 1 > irb(main):003:0> until (i+=1)>5 > irb(main):004:1> p i > irb(main):005:1> end > 2 > 3 > 4 > 5 > => nil > irb(main):006:0> RUBY_VERSION > => "1.8.3" > > The condition is evaluated before the first iteration. > > At least it's consistent: > > irb(main):005:0> i = 1 > => 1 > irb(main):006:0> p i until (i+=1)>5 > 2 > 3 > 4 > 5 > => nil > > I think it makes "until" less useful. Why would anyone want this? > -- > Posted viahttp://www.ruby-forum.com/.