Block_given? with send

[email protected]$G$9!%e(B

e$B!!e(Bsend e$B$rMxMQ$7$F<B9T$7$?e(B block_given? e$B$,e(B 1.8
e$B$N<B9T7k2L$N$h$&$K$J$ke(B
e$B$N$O$3$&$$$&$b$s$G$7$g$&$+!%e(B

p send(:block_given?)
p send(:block_given?){}

1.8 false, true

1.9 false, false

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:34812] block_given? with send”
on Fri, 23 May 2008 01:16:22 +0900, SASADA Koichi [email protected]
writes:

|e$B!!e(Bsend e$B$rMxMQ$7$F<B9T$7$?e(B block_given? e$B$,e(B 1.8 e$B$N<B9T7k2L$N$h$&$K$J$ke(B
|e$B$N$O$3$&$$$&$b$s$G$7$g$&$+!%e(B
|
|p send(:block_given?)
|p send(:block_given?){}
|# 1.8 false, true
|# 1.9 false, false

p (block_given?{})

e$B$,e(Bfalsee$B$J$s$Ge(B1.8e$B$G$be(Bfalse,
falsee$B$G$"$k$Y$-$G$7$g$&$M!#$3$N%?e(B
e$B%$%_%s%0$GD>$9$N$,[email protected]:v$+$I$&$+$O$H$b$+$/!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs