From: Tawee Laoitichote Date: 2002-02-02T23:32:16+09:00 Subject: quit receiving may I quit receiving any messages from ruby-talk @ruby-lang.org tawee199@ksc.th.com ----- Original Message ----- From: "Paul Brannan" To: "ruby-talk ML" Sent: Friday, February 01, 2002 4:23 AM Subject: Re: strange behavior > On Wed, Jan 30, 2002 at 08:56:07AM +0900, Yukihiro Matsumoto wrote: > > Visible constants are: > > > > * constants defined in the class/module. > > * constants defined in the outer class/module. > > * constants defined in the ancestors. > > Here's a problem related to the original poster's problem. When I do > this: > > module Config > A = 1 > end > > module Config2 > include Config > A = 42 > end > > class Foo > include Config2 > def initialize > p A > end > end > > Foo.new > > I get 42. But when I do this: > > class Bar > def initialize(t) > extend(t) > p A > end > end > > Bar.new(Config2) > > I get an exception. Is Config2 not one of Bar's ancestors? > > Paul > >