From: Bharat Ruparel Date: 2008-03-08T05:06:46+09:00 Subject: instance_eval and class_eval - names got mixed up? Going through the Ruby Programming Language text Chapter 8 Reflection and MetaProgramming. Section 8.2.2 on page 270. The following paragraph has me puzzled: "Note the subtle but crucial difference between instance_eval and class_eval when the code being evaluated contains a method definition. instance_eval defines singleton methods of the object (and this results in class methods when it is called on a class object). class_eval defines regular instance methods." Is this not supposed to be the other way around? instance_eval should define instance methods and class_eval should define class methods. Is there a catch here? Ruby is supposed to be following principle of least surprise. I must say I am surprised here, or there is something quite profound that I don't get. Bharat -- Posted via http://www.ruby-forum.com/.