From: matz@... (Yukihiro Matsumoto) Date: 2003-08-07T04:52:35+09:00 Subject: Re: instance_eval and Class Variables Hello, In message "instance_eval and Class Variables" on 03/08/06, Tim Bates writes: |The previous email had "instance_eval" in the title, because I meant to |include the contents of this mail in it but then didn't. It actually |used module_eval, although it makes no difference. This one is a |separate problem: |irb(main):004:0> Klass.instance_eval{ puts @@foo } |NameError: uninitialized class variable @@foo in Object | from (irb):4 | from (irb):4:in `instance_eval' | from (irb):4:in `instance_eval' | from (irb):4 This is normal. Class variables are resolved using static scope. |irb(main):005:0> Klass.module_eval{ puts @@foo } |NameError: uninitialized class variable @@foo in Object | from (irb):5 | from (irb):5:in `module_eval' | from (irb):5:in `module_eval' | from (irb):5 You've found a bug in module_eval. Sorry for inconvenience. matz.