Warning: redefining Object#initialize may cause infinite loo

irb(main):001:1class Object
irb(main):002:1> alias :init :initialize
irb(main):003:1> def initialize( *args, &blk )
irb(main):004:2> init( *args, &blk )
irb(main):005:2> end
irb(main):006:1> end
(irb):3: warning: redefining Object#initialize may cause infinite loop

Is this warning really neccessary?

Thanks,
T.

Trans wrote:

Thanks,
T.

No, and I’d like to reiterate my idea for structured warnings so that
we can wrap and disable them as we like. :slight_smile:

  • Dan

Hi,

In message “Re: warning: redefining Object#initialize may cause infinite
loop”
on Sun, 10 Sep 2006 01:48:00 +0900, “Trans” [email protected]
writes:

|irb(main):001:1class Object
|irb(main):002:1> alias :init :initialize
|irb(main):003:1> def initialize( *args, &blk )
|irb(main):004:2> init( *args, &blk )
|irb(main):005:2> end
|irb(main):006:1> end
|(irb):3: warning: redefining Object#initialize may cause infinite loop
|
|Is this warning really neccessary?

Object#initialize is too broad. If you allocate anything that calls
Object#initialize it would turned out to be infinite loop which is
definitely not expected at all. I was surprised when I met it.

						matz.

Hi –

On Sun, 10 Sep 2006, Yukihiro M. wrote:

|irb(main):006:1> end
|(irb):3: warning: redefining Object#initialize may cause infinite loop
|
|Is this warning really neccessary?

Object#initialize is too broad. If you allocate anything that calls
Object#initialize it would turned out to be infinite loop which is
definitely not expected at all. I was surprised when I met it.

That doesn’t matter: POLS only means Matz’s surprise. Oh, wait…
:-)))

David

On 9/10/06, [email protected] [email protected] wrote:

Hi –

That doesn’t matter: POLS only means Matz’s surprise. Oh, wait…
:-)))

But if you want a general POLS you need POLLS to achieve it :wink:
Robert

David