Ruby 1.8.1 and forwardable warnings

Hi all,

Ruby 1.8.1
Solaris 9

It appears that the forwardable module raises a couple of warnings
that concern me that did not appear in 1.6.8:

(FORWARDABLE):1: warning: redefining __send__' may cause serious problem (__FORWARDABLE__):1: warning: redefiningid’ may cause serious
problem

Do I need to be worried? Does forwardable need a patch? Or is there
another module I should be using instead? I know I don’t want to have
to see these warnings every time I use this module. Please advise.

Regards,

Dan

test.rb

require "forwardable"
class Foo
extend Forwardable
def_delegators(:@bar,*(Array.instance_methods))
def initialize
@bar = []
end
end

if $0 == FILE
f = Foo.new
f.push(“hello”)
end

Hi,

At Fri, 5 Mar 2004 10:14:41 +0900,
Daniel Berger wrote in [ruby-talk:94282]:

It appears that the forwardable module raises a couple of warnings
that concern me that did not appear in 1.6.8:

(FORWARDABLE):1: warning: redefining __send__' may cause serious problem (__FORWARDABLE__):1: warning: redefining id’ may cause serious
problem

Do I need to be worried? Does forwardable need a patch? Or is there
another module I should be using instead? I know I don’t want to have
to see these warnings every time I use this module. Please advise.

I guess those methods should be skipped, perhaps in
def_delegators, and also, kind_of?(Integer) hacks are no longer
needed anymore.

···


Nobu Nakada