S
Su Zhang
Hello,
According to the book Programming Ruby by Dave Thomas, "an
unde=EF=AC=81ned method still exists - it is simply marked as being unde=EF=
=AC=81ned."
Why is it not completely removed?
I find this somewhat related to the fact that an object still cannot be
dumped after "undefing" its singleton methods.
obj =3D Object.new
def obj.foo
end
p obj.respond_to? :foo # =3D> true
class << obj
undef foo
end
p obj.respond_to? :foo # =3D> true
Marshal.dump(obj) # =3D> error
-- =
Posted via http://www.ruby-forum.com/.=
According to the book Programming Ruby by Dave Thomas, "an
unde=EF=AC=81ned method still exists - it is simply marked as being unde=EF=
=AC=81ned."
Why is it not completely removed?
I find this somewhat related to the fact that an object still cannot be
dumped after "undefing" its singleton methods.
obj =3D Object.new
def obj.foo
end
p obj.respond_to? :foo # =3D> true
class << obj
undef foo
end
p obj.respond_to? :foo # =3D> true
Marshal.dump(obj) # =3D> error
-- =
Posted via http://www.ruby-forum.com/.=