From: Austin Ziegler Date: 2002-11-09T23:39:36+09:00 Subject: Re: [FAQ] Why use 'include' On Sat, 9 Nov 2002 20:12:57 +0900, ts wrote: >>>>>> "E" == Eric Schwartz writes: >E> All this takes effect in the most restrictive lexical scope >E> available. If you do this inside a class definition, only that >E> class will be able to use the short forms. If you do it inside >E> another module definition, the entire module can use those short >E> forms. If you do it at the top of a file, everything in that >E> file can use the short forms. > Well, I've not understood what you are trying to say. Can you > explain what is "the most restrictive lexical scope available" ? > > pigeon% cat c.rb > module M > class A; end > end > > include M > > pigeon% cat b.rb > #!/usr/bin/ruby > require 'c' > p A.new > > pigeon% b.rb > # Well, A.new is still an M::A, but it's just been made part of the object's current lexical scope. At least that's how I interpret the statement. -austin -- Austin Ziegler, austin@halostatue.ca on 2002.11.09 at 09.35.24