From: Kent Dahl Date: 2004-06-05T18:58:48+09:00 Subject: Re: class A::B verses module A ; class B Jeff Mitchell wrote: > module A > FOO = 99 > end > > module A > class B > puts "FOO is #{FOO}" # => "FOO is 99" > end > end > > class A::B > puts "FOO is #{FOO}" # error > end > > Comments? I assumed the two forms were equivalent until I ran into > this. Is there a reason they should be different? I prefer the > second form, if only to save some indentation space. I'm on the "hope it's a feature" side on this one. It means you have to explicitly open namespaces you want to use, and the A::B shortcut notation only opens the last namespace. Some of this has already been discussed in the thread "Nested class/module namespace", see [rubytalk:78843] for Matz' answer. http://rubytalk.com/78843 -- (\[ Kent Dahl ]/)_ _~_ _____[ http://www.pvv.org/~kentda/ ]_____/~ ))\_student_/(( \__d L b__/ Master of Science in Technology ) ( \__\_�|�_/__/ ) _) Industrial economics and technology management ( \____/_�_\____/ (____engineering.discipline_=_Computer::Technology___)