From: repeatr Date: 2003-05-17T02:43:57+09:00 Subject: procs and context According to the Pickaxe: ______________ new Proc.new [{| | block } ] -> aProc Creates a new Proc object, bound to the current context. It may be called without a block only within a method with an attached block, in which case that block is converted to the Proc object. -------------- But if i try to convert the block into a proc and rebind it "to the current context" it fails. In the following snippet, i wish that the proc that is defined in main context, be rebound into a Room's context. ______________ def method_missing(action) puts "#{action}...in the city" end class Room def method_missing(action) puts "#{action}...in the the privacy of your own room" end def live(&block) instance_eval { Proc.new.call } end def initialize put_feet_on_table snore end end walk go_to_work room = Room.new room.live do walk_around_naked! end -------------- output: walk...in the city go_to_work...in the city put_feet_on_table...in the the privacy of your own room snore...in the the privacy of your own room walk_around_naked!...in the city oh dear, how embarassing! ;-) Please explain, kind sirs. I think i'm understanding the word "context" wrong. Also, could a proc rebinding possibly be done? regards Peter