From: Andy Delcambre Date: 2005-12-13T11:11:23+09:00 Subject: Re: Idiom wanted: do-while The begin end one functions like a do while loop, the body will always get executed at least once, wherease the while will only get exectuted if the cond is true. irb(main):001:0> begin irb(main):002:1* p "once" irb(main):003:1> end while nil "once" => nil irb(main):004:0> p "once" while nil => nil - Andy Delcambre On 12/12/05, Mark Ericson wrote: > I did, and I was curious about the statement > > > Because it's hard for users to tell > > > > begin end while > > > > works differently from > > > > while > > > > > in what ways are they different? Any code examples to show the difference? > > > On 12/12/05, James Edward Gray II wrote: > > > > On Dec 12, 2005, at 6:19 PM, Adam Shelly wrote: > > > > > I was certain I had tried that.... > > > But that works exactly the way I want. > > > > But hopefully you followed the Ruby Core link in this thread and saw > > Matz explaining how he would like to remove it from the language so > > we shouldn't be using it. Stick with loop do ... end. > > > > James Edward Gray II > > > > > >