Ruby 1.8.1 and forwardable warnings

Discussion in 'Ruby' started by Daniel Berger, Mar 5, 2004.

  1. 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
     
    Daniel Berger, Mar 5, 2004
    #1
    1. Advertising

  2. Daniel Berger

    Guest

    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
     
    , Mar 5, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Edward Gray II

    delegate vs. forwardable

    James Edward Gray II, Nov 28, 2004, in forum: Ruby
    Replies:
    0
    Views:
    151
    James Edward Gray II
    Nov 28, 2004
  2. benny

    Q: Delegate and Forwardable

    benny, Mar 9, 2005, in forum: Ruby
    Replies:
    0
    Views:
    121
    benny
    Mar 9, 2005
  3. Asfand Yar Qazi
    Replies:
    1
    Views:
    150
    Florian GroƟ
    Mar 19, 2006
  4. Rob Sanheim
    Replies:
    13
    Views:
    234
    Ron Green
    Feb 6, 2010
  5. Ted Sung
    Replies:
    1
    Views:
    316
    Sherm Pendley
    Aug 30, 2004
Loading...

Share This Page