Hi,
In message "[ruby-talk:17628] Strange warning"
on 01/07/11, Bob Alexander <balexander / rsv.ricoh.com> writes:
|What exactly does Ruby's warning message
|
| "warning: block for Proc#call is useless"
|
|mean?
You might expect
p = Proc::new{ yield 55 }
p.call{|x| p x}
to print 55, but it won't, but you'll get this warning. Because Proc
object themselves have already captured the context including the
block of the place where Proc was created, so that invoking "call"
with block cause warning.
matz.