From: Bertram Scharpf Date: 2009-02-21T07:17:53+09:00 Subject: Re: while vs loop Hi, Am Samstag, 14. Feb 2009, 15:16:16 +0900 schrieb Nobuyoshi Nakada: > At Sat, 14 Feb 2009 15:03:03 +0900, > Vetrivel Vetrivel wrote in [ruby-talk:328175]: > > what is the Difference between loop and while in ruby ? > > > > loop is a kernel method which takes a block. A block > introduces new local variable scope. > > while doesn't. > In other words: $ irb irb(main):001:0> Kernel.private_instance_methods.grep /loop/ => ["loop"] irb(main):002:0> Kernel.private_instance_methods.grep /while/ => [] Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de