On Monday 01 December 2003 03:49 pm, Yukihiro Matsumoto wrote:

> I like the basic idea.  the "shortcut notation" would be a key.  I
> couldn't think of a good one for years.  But someone might be able to.

If I understand correctly, 

In ruby-core:1792, Mathieu Bouchard hints at:

  { || ... }  -or-  { |*| ... }

Could something like that work? Or would it be too ambiguious with blocks?

  def pshooter(a)
    a.call
    yield if block_given?
  end

  pcatch( {|| puts "p" } ) { puts "block" }

  #> p
  #> block


BTW: why does this happen?

  a = proc { puts "p" }
  pshooter a  # => p
  pshooter a { puts "block" }  
  # => undefined method `a' for main:Object (NoMethodError)


T