From: matt@... (matt neuburg) Date: 2008-07-13T09:45:43+09:00 Subject: Re: Modules Oliver Saunders wrote: > I understand the way these things are working but I don't really > understand what's going on and why. > > module Foo > def bar > 1 > end > def Foo.zim > 2 > end > end > > > >> Foo.zim # works, OK, fair enough > 2 > >> Foo::zim # works, but why have two syntaxes that do the same? > 2 > >> Foo.bar # NoMethodError. > > class SomeClass > include Foo > end > > >> SomeClass.new.bar # OK, it's been mixed in > 1 > >> SomeClass.zim # NoMethodError, huh? Why doesn't this work? > >> SomeClass.new.zim # NoMethodError. > I'm very confused by all this. Please help unravel the mess in my brain. I'd say you're not confused at all. You've described perfectly how the language behaves. m. -- matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/ Leopard - http://www.takecontrolbooks.com/leopard-customizing.html AppleScript - http://www.amazon.com/gp/product/0596102119 Read TidBITS! It's free and smart. http://www.tidbits.com