Why can\'t I access \'B\' in the following from \'A\' but can from the main environment?
module A; end A.instance_eval{B=1} B #=> 1 A::B #=> uninitial
module A; end A.class_eval{B=1} B # Undefined A::B # 1
As for why it works, I'm not really sure. I occasionally use metaprogramming like this when creating very meta frameworks such the Small Eigen Collider, but not in day-to-day work.