From: Eric Mahurin Date: 2005-06-29T22:58:53+09:00 Subject: Re: yield does not take a block --- Robert Klemme wrote: > Eric Mahurin wrote: > > --- Robert Klemme wrote: > > I'd hope at > > some point ruby would make optimizations when it knows the > > exact class of an object - do method lookup at compile > time. > > IMHO this is close to impossible as knowing the class of an > object tells > you nothing definite about which methods it supports and what > signature > they have. (see all the discussions about static typing) Probably correct. I think there may be a little too much flexibility in the ruby language that will prevent future optimizations. I think the destructive modification of a class and of an object's class (making its class a singleton) are the main culprits. If these were non-destructive (returning a new class or new object with a singleton class), it would have allowed more optimization. To me, discussions about destructive vs. non-destructive methods (reverse! vs. reverse) are nothing compared to these. ____________________________________________________ Yahoo! Sports Rekindle the Rivalries. Sign up for Fantasy Football http://football.fantasysports.yahoo.com