From: Curt Sampson Date: 2005-04-13T15:27:17+09:00 Subject: Re: [curiousity] why aren't declarations just syntactic sugar? On Fri, 8 Apr 2005, Jon Raphaelson wrote: > Both of those will produce the output > Oh yes! You and I must be using different versions of ruby: $ cat z.rb module Foo def do_me_harder puts "Oh yes!" end do_me_harder end $ ruby z.rb z.rb:5: undefined local variable or method `do_me_harder' for Foo:Module (NameError) Whereas: $ cat z1.rb def do_me_harder puts "Oh yes!" end do_me_harder $ ruby z1.rb Oh yes! Now care to try again with an explanation? Two notes on the previous post, BTW. First the doubled "puts" was not intentional; just me typing without proof-reading. Second, this may have worked for you because you put both code samples into the same file and ran them in the order I gave orginally, which was reversed from above. cjs -- Curt Sampson +81 90 7737 2974 http://www.NetBSD.org Make up enjoying your city life...produced by BIC CAMERA