Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Ruby 1.8.1 and forwardable warnings

Reply
Thread Tools

Ruby 1.8.1 and forwardable warnings

 
 
Daniel Berger
Guest
Posts: n/a
 
      03-05-2004
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
 
Reply With Quote
 
 
 
 
nobu.nokada@softhome.net
Guest
Posts: n/a
 
      03-05-2004
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ruby 1.9, Rubygems, and .gemspec warnings Rob Sanheim Ruby 13 02-06-2010 11:56 PM
ruby 1.8.4 gives warnings where ruby 1.8.2 doesn't - how to disable? Asfand Yar Qazi Ruby 1 03-19-2006 11:09 AM
Q: Delegate and Forwardable benny Ruby 0 03-09-2005 10:43 PM
delegate vs. forwardable James Edward Gray II Ruby 0 11-28-2004 12:36 AM
use warnings; and use Warnings; give different results Ted Sung Perl Misc 1 08-30-2004 10:22 PM



Advertisments