Hi,

In message "Re: yield does not take a block"
    on Wed, 29 Jun 2005 02:30:05 +0900, Daniel Brockman <daniel / brockman.se> writes:

|I feel strange when I see these are not equivalent:
|
|  def foo1 &block
|    block.call &bar
|  end
|
|  def foo2
|    Proc.new.call &bar
|  end
|
|  def foo3 &block
|    yield &bar
|  end

|If foo1 and foo3 are not equivalent, then we have an inconsistency.

Indeed we have inconsistency here if those two are not equivalent, but
I don't think consistency matters most in this case.  Using yield
emphasizes passing a value and control to a block given to the method.
On the other hand, "call"ing an block argument (&block) emphasizes
treating a block as a procedural object.  If they are focusing
different aspect, they might not be exact same.

It's not a technical issue.  Just a matter of how we feel when we see

  yield &bar

or

  yield {...}

I feel something strange (bad strange) when I see this, just because
it passes a block to another block, which is apparently strange,
whereas

  block.call &bar

does not make me feel bad strange, since it is valid syntax in the
microscopic view, even when it is semantically strange.

If you have shown me the reason "yield &bar" is not strange (and is
useful) other than consistency, I'd be glad to apply the Nobu's patch
in [ruby-talk:146636].

							matz.