From: jbshaldane@... (haldane) Date: 2003-04-21T00:42:13+09:00 Subject: Re: Warning: redefine instance jbshaldane@hotmail.com (haldane) wrote in message news:<7762c743.0304172306.1c4374b8@posting.google.com>... > Does anyone know why I am getting this warning? > > $ ruby -v > ruby 1.8.0 (2003-04-11) [i686-linux] > $ cat atest.rb > require 'singleton' > > class X > include Singleton > end > > X.instance > $ ruby -w atest.rb > /usr/local/lib/ruby/1.8/singleton.rb:145: warning: redefine instance > $ Just to clarify my question a little, the warning comes from this line in singleton.rb (just after the instance has been created): def self.instance() @__instance__ end Is there any reason it could not be replaced with define_method(:instance, proc { @__instance__ }) which does not result in the warning? Thanks +- S.D.Sykes - www.stephensykes.com - ruby -e '_=2;"||_25~!A59(1A~47!K~#-6<.A~".scan(/./){ putc$&>$`?$/:_+=$&[0]-?4}'