D.size differ from d.send(:size) where d is SimpleDelegator.new([])

e$B0J2<$N$h$&$K!"e(Bsize e$B$H$$$&4X?t$,Dj5A$5$l$F$$$k$H$-!"e(B
SimpleDelegator.new([]) e$B$KBP$7!"e(Bd.size e$B$He(B d.send(:size)
e$B$N7ke(B
e$B2L$,0[$J$j$^$9!#e(B

% ./ruby -ve ’
require “delegate”
d = SimpleDelegator.new([])
def size
:foo
end
p d.size
p d.send(:size)

ruby 1.9.2dev (2009-08-23 trunk 24629) [i686-linux]
0
:foo

e$B$3$l$K$h$j!"0J2<$Ne(B e == d e$B$N7k2L$,e(B mkmf e$B$re(B require
e$B$7$?$+$Ie(B
e$B$&$+$GJQ$o$j$^$9!#e(B

% ./ruby -ve ’
require “delegate”
e = SystemCallError.new(0)
d = SimpleDelegator.new(e)
p e == d
require “mkmf”
p e == d

ruby 1.9.2dev (2009-08-23 trunk 24629) [i686-linux]
true
false

e$B$=$7$F!"0J2<$N<:GT$,e(B test-all e$B$G5/$-$F$$$^$9!#e(B

test_systemcallerror_eq(TestDelegateClass)
[/home/akr/chkbuild/tmp/build/ruby-trunk/20090818T130201/ruby/test/test_delegate.rb:18]:
[ruby-dev:34808]

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