From: dblack@... Date: 2002-12-27T16:58:48+09:00 Subject: Re: change in lookup of constants on 1.6.8? Hi -- On Fri, 27 Dec 2002, Yukihiro Matsumoto wrote: > Hi, > > In message "change in lookup of constants on 1.6.8?" > on 02/12/27, Paul Brannan writes: > > |What has changed in Ruby to cause this behavior? Is there a change I > |can make to foo() or to Foo to allow the block passed to foo() to work? > > I wanted to make constant scope more static. It's for readability and > for future optimization. There's no way to switch constant scope. I can only give "feeling" arguments here... but this error feels very strange to me: a = Object.new a.instance_eval { B = 1; puts B } # error on the puts It's probably not a very common construct, but it still feels like it's a significant change in the principle of instance_eval (i.e., dynamically switching to the 'self' scope of the receiver). Can you elaborate on the pros and cons of (not) switching constant scope? David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav