LAMBEAU Bernard wrote:
> Works under Ruby 1.8.x, not with ruby 1.9.0 (I did not try with Ruby
> 1.9.1, which is more stable but not available yet under Ubuntu).

The only difference is the 'who' block parameter which is nil in 1.9. 
If you really want that, this works on both 1.8 and 1.9:

class A
  def doit(&block)
    if RUBY_VERSION >= "1.9.0"
      instance_exec(self, &block)
    else
      instance_eval(&block)
    end
  end
  def sayhello(who)
    puts "hello #{who}: #{object_id}"
  end
end

A.new.doit do |who|
  sayhello("me")
  who.sayhello("who")
end
-- 
Posted via http://www.ruby-forum.com/.