From: Greg Weeks Date: 2007-11-17T09:52:26+09:00 Subject: Re: "instance_eval" (eg, sent to a class object) Setting aside my confusion about top-level "def"s (which may be orthogonal to my questions about "instance_eval"): Rick Denatale wrote: > rb_obj_instance_eval sets the klass argument to the singleton_class of > the receiver (creating it if it doesn't already exist), unless the > receiver is an immediate object (a Fixnum, or nil, true, or false) in > which case it sets klass to nil. I would have guessed that the klass argument would be the context in which constants and "def"s are evaluated. But we've already seen that this is not true (re the constants). So far as I can guess, this klass argument seems to affect "def"s AND NOTHING ELSE. Can that be? (If so, all my questions are answered. But I may have a comment or two.) -- Posted via http://www.ruby-forum.com/.