On Sun, Jun 20, 2004 at 04:33:19AM +0900, matt wrote:
> Maybe you meant the become smalltalk stuff people were chatting about?
[...]
> Anyway, I'm still having some problems with this code, and I can't
> seem to fix it up to work.  There are two issues:
>
[...]
>   2) how to bind a method object to an unrelated class (ie not a
> subclass).  I'm thinking of hacking the source so that one can go from
> method foo -> module containing method foo.  then you could add any
> object's method to another object.  I just ask whether if anyone knows
> off the bat whether there is a technical issue in the way.
>

You can take a look at evil.rb, which contains an example of how to
create a proxy class and manipulate the m_tbl.

You can also implement these 'lazy objects' using Object#become; in many
cases, for RObject objects, it is safe. The implementation in evil.rb
does many safety checks (circular class chains, EX_IVARS, method cache
invalidation, etc) missing in the other ones you might find around.

-- 
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Apples  have  meant  trouble  since  eden.
	-- MaDsen Wikholm, mwikholm / at8.abo.fi