Hi --

On Fri, 31 Jul 2009, Rob Biedenharn wrote:

> On Jul 30, 2009, at 11:15 AM, Lloyd Linklater wrote:
>
>> I have the answer.  fyi, it is that
>> 
>> doSomething until condition
>> 
>> does not work at all like
>> 
>> begin doSomething end until condition
>> 
>> In the first case, the condition is checked BEFORE the doSomething is
>> run.  In the second case, the condition is checked AFTER the doSomething
>> is run.  I am not sure just why this is or how I could have figured it
>> out intuitively.  It seems to me that it would be better to have
>> something like this (to mimic pascal)
>> 
>> doSomething while condition #check condition before
>> 
>> doSomething until condition #check condition after
>> 
>> Thanks for all your input everyone!  I finally got there.  :)
>
> Well, I didn't believe you until I tried it myself. Seems that both until and 
> while behave similarly when applied to a block rather than a simple 
> expression.

I don't think you'd want it otherwise, though. "until" really just
means "while not". So the two should always behave the same as each
other in any given construct.


David

-- 
David A. Black / Ruby Power and Light, LLC / http://www.rubypal.com
Q: What's the best way to get a really solid knowledge of Ruby?
A: Come to our Ruby training in Edison, New Jersey, September 14-17!
    Instructors: David A. Black and Erik Kastner
    More info and registration: http://rubyurl.com/vmzN