warning: discarding old <methodName>? 
Author Message
 warning: discarding old <methodName>?

Hi folks,

why does this warning come up?
What might be wrong with my code?

It comes up on the line where the respective methods are defined.

Thanx a lot,
Juergen



Mon, 30 May 2005 01:07:20 GMT  
 warning: discarding old <methodName>?
Hi --

Quote:

> Hi folks,

> why does this warning come up?
> What might be wrong with my code?

The warning ("discarding old <method>") comes up when you discard an
old method :-)

It basically means that you've overridden a method without saving
a path to the old version of the method.

For example:

  class String
    def split; end
  end

However, if you do this:

  class String
    alias :oldsplit :split
    def split; end
  end

the old method is still available (as oldsplit), so it has not
been discarded and there's no warning.

David

--
David Alan Black


Web:  http://pirate.shu.edu/~blackdav



Mon, 30 May 2005 01:14:11 GMT  
 warning: discarding old <methodName>?
Hmm sounds quite like I thought but I donot see the point.

May it come indirectly through require statements like:
 * module M requires a.rb and b.rb
 * both, a and b require c.rb

I'll have to examine tomorrow, for today it's enough ;-)

I use stable 1.6.7 on win32

Best wishes
Juergen Lind

Quote:
-----Original Message-----

Sent: Wednesday, December 11, 2002 6:14 PM

Subject: Re: warning: discarding old <methodName>?

Hi --


> Hi folks,

> why does this warning come up?
> What might be wrong with my code?

The warning ("discarding old <method>") comes up when you discard an
old method :-)

It basically means that you've overridden a method without saving
a path to the old version of the method.

For example:

  class String
    def split; end
  end

However, if you do this:

  class String
    alias :oldsplit :split
    def split; end
  end

the old method is still available (as oldsplit), so it has not
been discarded and there's no warning.

David

--
David Alan Black


Web:  http://pirate.shu.edu/~blackdav



Mon, 30 May 2005 01:24:22 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ><><><><>Heeeeeeeeeeeeeeelp on INT 14!><><><><><>

2. <<<<<YOU MUST CHECK THIS OUT >>>>>>>>>> 2103

3. <><><> FLOODFILL <><><>

4. >>>HELP, DECOMPILER<<<

5. <<<XXX Password>>>

6. <<<XXX Password>>>

7. ??? <<<<<<<<<<<<<<<<<<<< RGB 4 MMX >>>>>>>>>>>>>>>>>>>>>>>?

8. <<<XXX Password>>>

9. ??? <<<<<<<<<<<<<<<<<<<< RGB 4 MMX >>>>>>>>>>>>>>>>>>>>>>>?

10. >>>>>>>>>>>>>>>>>>>HEY!<<<<<<<<<<<<<<<<<<<<<<<

11. ------>>>>> REVERSING A STRING <<<<<-----

 

 
Powered by phpBB® Forum Software