From: Phrogz Date: 2005-07-20T04:45:55+09:00 Subject: Re: Instance Eval of a Proc "Ara.T.Howard" writes: [a bunch of snipped examples] Ara, thanks for helping investigate this. Your C::self_boxed method is being called with an explicit receiver (C), which is, of course, what I'm trying to avoid/change using instance_eval. Two examples from languages with first-class functions: Lua: C = { name='C' } function C:show_name( ) print( self.name ) end b = { name='bob' } C.show_name( b ) --> "bob" -- Here, 'b' is being passed as the first implicit -- 'self' parameter to show_name JavaScript: Array.prototype.show_length = function( ){ alert( this.length ) } var a = [1,2,3]; var foo = "I'm a string with a length property"; a.show_length.call( foo ); //"35" //a.show_length looks up the Function instance //which has a "call" method that allows you to change //the scope of 'this' I know that Ruby doesn't currently have first-class functions, but I'm trying to determine if there's a way to do the equivalent of the above. Is there any way to invoke a method defined on one class within the scope of an instance of any other class?