[grammarians] 'nother little bit of fun syntax

MenTaLguY mental at rydia.net
Mon Dec 12 21:48:15 EST 2005


Learned this today.

 begin
   ...
 end while condition

Same as C's:

 do {
   ...
 } while condition;

Matz wants to deprecate it, but it'll probably be around for the
remainder of the 1.8 series anyway.

Note that it is distinct from the normal meaning of suffix-while:

 # prints: foO!
 begin
   puts "foO!"
 end while false

 # prints nothing
 puts "foO!" while false

-mental
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051212/ddba29bf/attachment.bin


More information about the Rubygrammar-grammarians mailing list