From: Huw Collingbourne Date: 2008-05-27T23:02:56+09:00 Subject: Re: OOP in Ruby? Robert Dober wrote: > I agree upto here, but... >>- that is, just writing a block in code does not make it an >> instance of a Block (or Proc) class. > I however believe it does, if you write a block in Ruby it is always > passed on to a method Therein lies the difference. If you write a block in Smalltalk it has an independent existence. It does not demand a receiver method in order to justify its existence. In other words, a Smalltalk block is just the same as an other object. It is an instance of its class and comes with all the methods of its class. In fact, send it the 'class' message and it will reply Block (or BlockClosure or whatever a specific Smalltalk class library may have named it). In Ruby, if you create a free-standing block, Ruby regards it as a syntax error. So, unless a Proc object is instantiated using a block, I don't believe that a Ruby block meets the essential criterion required to be described as an object. best wishes Huw SapphireSteel Software Ruby and Rails In Visual Studio http://www.sapphiresteel.com -- Posted via http://www.ruby-forum.com/.