unknown wrote:
> Hi --
> 
> On Fri, 7 Sep 2007, Mark Volkmann wrote:
> 
>>>> 3
>>>> irb(main):005:0> i = 1
>>> What other behavior would you want, and why?
>> end
> You can do:
> 
>   begin
>     # do stuff
>   end until condition
> 
> 
> David

Thats just confusing. Why does that work different then "do_stuff until 
condition".

I'm used to do things like this:
 a= n
 until (a*= 3.0)<=450.0
   # do stuff
 end

I think it is more readable. You get the start value, the incrementer 
and the stop condition nicely grouped together. You also get more 
effective code, if the penalty for evaluating the condition is high. I'm 
not a native english speaker, but I think it feels more in line with 
natural languages as well as "mathematical language". And it's a lot 
more like how you do things in real life.

Using the loop method would mean that I had to introduce a new scope. 
Which, sometimes, means that I have to remember to "declare" a lot of 
variables outside that scope. Even those that are never used. A lot of 
unecessary code attract bugs like sugar. I like Ruby's block iterators, 
but many times it is wrong to use them.
-- 
Posted via http://www.ruby-forum.com/.