[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:02125] Re: Scope violated by import via 'require'?

From: matz@... (Yukihiro Matsumoto)
Date: 2000-03-24 07:19:24 UTC
List: ruby-talk #2125
Hi,

In message "[ruby-talk:02101] Re: Scope violated by import via 'require'?"
    on 00/03/23, Clemens Hintze <c.hintze@gmx.net> writes:

|> require()/load() evaluates the contents of the file at the toplevel.
|
|So does that mean it works as you intended?

Yes.

| May I ask another
|question? How can I achieve the goal described above? Is there any
|way?

Well, typical one is like following.

  str = f.read
  Foo.module_eval str

|> module Bar is defined at the toplevel.  And in 1.5.x, `::' notation
|> accesses the constants defined in superclasses too, which makes
|> Foo::Bar valid.
|
|That means, it is not in the module Foo, but will be found above in
|Object, yes? Tricky, tricky! ;-)

Yes.  Tell me if you have alternative ideas.

							matz.

In This Thread