From: gabriele renzi Date: 2003-07-13T04:04:26+09:00 Subject: Re: do...end vs. begin..end il Sat, 12 Jul 2003 19:13:28 +0100, "daz" ha scritto:: >> > >That's my (less-experienced) understanding, also. >There is a method in Kernel called 'loop' which provides: > > loop do > puts 'something' > break # on some condition > end > >but the need rarely arises. > well, that is the same thing...try with loop { } this is one of those typical 'other language in ruby' thing :) > >I'll live dangerously and say that begin...end are there for when you >have the requirement, whereas do...end is required almost immediately >and is very common in both its forms (the brace form, as Brian >mentioned above, is [#] identical). just forget 'block': do..end delimits the code for a Proc object begin..end enclose a part of your code, mainly to be used with rescue/ensure statements my 2c