Ruby 1.8.1 and forwardable warnings

D

Daniel Berger

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: 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.

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
 
N

nobu.nokada

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top