From: "David A. Black" Date: 2005-11-23T03:42:00+09:00 Subject: Re: semenatics of if/unless/while statement modifiers Hi -- On Wed, 23 Nov 2005, mathew wrote: > > On Nov 22, 2005, at 10:11 AM, ts wrote: > >>>>>>> "m" == mathew writes: >>>>>>> >> >> m> I'm guessing that's why Ruby doesn't have post-test loops either--to >> m> discourage "German sentence" programming. >> >> What is a post-test loop ? This >> >> moulon% ruby -e 'i = 0; begin puts i; end while i > 0' >> 0 >> moulon% > > > > That's a block and a single statement, rather than a loop construct. > > A real post-test loop would be something like > > repeat ... until x > > with no extra do ... end required. > > And I think that do ... end while x is ugly too. I tend to prefer doing > something to make the loop condition true initially, then doing a normal > while loop. There's no "do" in the example; it's begin...end. The "begin" isn't "extra" (any more than "repeat" would be), since otherwise you'd have no way to know where the body started. I think it's plenty "real" as is :-) David -- David A. Black dblack@wobblini.net