From: Rich Kilmer Date: 2001-12-15T00:15:07+09:00 Subject: [ruby-talk:28510] Re: allocate and 1.7.x > -----Original Message----- > From: Yukihiro Matsumoto [mailto:matz@ruby-lang.org] > Sent: Friday, December 14, 2001 4:10 AM > To: ruby-talk ML > Subject: [ruby-talk:28493] Re: allocate and 1.7.x > > > Hi, > > In message "[ruby-talk:28492] allocate and 1.7.x" > on 01/12/14, "Rich Kilmer" writes: > > |I had a class that had defined a factory method like this: > | > |class Foo > | def Foo.allocate(x,y,z) > | end > |end > | > |It worked great under 1.6.5...but Matz added a new allocation > |system for 1.7.x and now uses #allocate. It took me a while > |to track down why my classes behavior changed. > > Sorry. > > matz. No problem...what I was doing was weird anyway. I had a factory on a "base" class that was dynamically generating a random class (name) as a subclass of my "base" class and then returning that subclass. 1.7.x did not like the fact that #allocate was returning a different class than the class #allocate was a member of. I understand now, and it makes total sense. If _you_ have to be limited to not using any of the methods people write on their classes in Ruby, you'll have to be omniscient, which, although brilliant, I don't think you've quite achieved ;) Was an easy fix...I was just calling to people attention (just in case) -Rich