[#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:02127] Re: Scope violated by import via 'require'?

From: Clemens Hintze <c.hintze@...>
Date: 2000-03-24 10:52:32 UTC
List: ruby-talk #2127
Yukihiro Matsumoto writes:
> Hi,

Hi,

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

...

> | 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

I have already thought of this. Only I was not sure, if it is the best
way or not. But now as you have proposed it, I am convinced it is ok!
:-)))

> |> 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.

Nonono! I have no better idea. It is perfect! I was only stumbled again
over the fact, that toplevel means context of class Object in
Ruby. This is not a disadvantage. I am only too stupid to remember, I
guess.

Strange... every time somebody ask me, I can tell him that fact
properly. But *I* sometimes get catched by this ;-)))

Ruby *is* different from other languages, indeed. :-)

> 							matz.

\cle

-- 
Clemens Hintze  mailto: c.hintze@gmx.net

In This Thread

Prev Next