From: Richard Date: 2006-12-05T02:30:08+09:00 Subject: Re: Testing use of binding: got spurious error message Hi Morton, > show(obj1.methods) # <= insert this > show(eval("methods", bind1)) # <= or this That's perfect. Thank you very much. Incidentally, I trimmed the quotes and sorted the list: a very satisfying result! Best wishes, Richard Morton Goldberg wrote: > On Dec 3, 2006, at 8:15 PM, Richard wrote: > > > class MyClass > > def initialize(n) > > @number = n > > end > > > > def getBinding > > binding() > > end > > end > > > > def show(a) > > a.each do |m| > > puts "\t" + m.inspect > > end > > end > > > > obj1 = MyClass.new 19 > > bind1 = obj1.getBinding > > > > obj2 = MyClass.new 84 > > bind2 = obj2.getBinding > > > > puts "number for obj1 = " + eval('@number', bind1).to_s > > puts "number for obj2 = " + eval('@number', bind2).to_s > > > > puts "# of methods: " + eval(methods.length.to_s, bind1).to_s > > puts "Methods: " > > # dummy = eval(show(methods), bind1) > show(obj1.methods) # <= insert this > show(eval("methods", bind1)) # <= or this > > puts "That's all folks!" > > Regards, Morton