[#600] A `File' is not a `IO'????? — clemens.hintze@...

17 messages 1999/08/10
[#602] Re: A `File' is not a `IO'????? — matz@... (Yukihiro Matsumoto) 1999/08/10

Hi,

[#679] Documentation about RD? — Clemens Hintze <c.hintze@...>

Hi,

78 messages 1999/08/17
[#680] Summary of discussion about RD (Re: Documentation about RD?) — Toshiro Kuwabara <toshirok@...3.so-net.ne.jp> 1999/08/18

=begin

[#683] Re: Summary of discussion about RD (Re: Documenta tion about RD?) — clemens.hintze@... 1999/08/18

On 18 Aug, Toshiro Kuwabara wrote:

[#686] Re: Summary of discussion about RD (Re: Documenta tion about RD?) — gotoken@... (GOTO Kentaro) 1999/08/18

Hi,

[#687] Re: Summary of discussion about RD (Re: Docum enta tion about RD?) — clemens.hintze@... 1999/08/18

On 18 Aug, GOTO Kentaro wrote:

[#693] Re: Summary of discussion about RD (Re: Docum enta tion about RD?) — Toshiro Kuwabara <toshirok@...3.so-net.ne.jp> 1999/08/18

Hi,

[#695] Re: Summary of discussion about RD (Re: Docum enta tion about RD?) — Clemens Hintze <c.hintze@...> 1999/08/18

On 19 Aug, Toshiro Kuwabara wrote:

[#697] Re: Summary of discussion about RD (Re: Docum enta tion about RD?) — Toshiro Kuwabara <toshirok@...3.so-net.ne.jp> 1999/08/19

Hi,

[#703] Re: Summary of discussion about RD (Re: Docum enta tion about RD?) — Clemens Hintze <c.hintze@...> 1999/08/19

On 19 Aug, Toshiro Kuwabara wrote:

[#706] Re: Summary of discussion about RD (Re: Docum enta tion about RD?) — Toshiro Kuwabara <toshirok@...3.so-net.ne.jp> 1999/08/19

Hi,

[#681] Re: Summary of discussion about RD (Re: Documentation about RD?) — gotoken@... (GOTO Kentaro) 1999/08/18

Hi,

[#682] Re: Summary of discussion about RD (Re: Documentation about RD?) — Toshiro Kuwabara <toshirok@...3.so-net.ne.jp> 1999/08/18

Hi,

[#684] Re: Summary of discussion about RD (Re: Documentation about RD?) — TAKAHASHI Masayoshi <maki@...> 1999/08/18

Hi Tosh and all,

[#685] Re: Summary of discussion about RD (Re: Documentation about RD?) — gotoken@... (GOTO Kentaro) 1999/08/18

Hi,

[#689] Re: Summary of discussion about RD (Re: Documentation about RD?) — Toshiro Kuwabara <toshirok@...3.so-net.ne.jp> 1999/08/18

Hi,

[#694] Re: Summary of discussion about RD (Re: Documentation about RD?) — matz@... (Yukihiro Matsumoto) 1999/08/18

Hi,

[#700] Re: Summary of discussion about RD (Re: Documentation about RD?) — Toshiro Kuwabara <toshirok@...3.so-net.ne.jp> 1999/08/19

Hi,

[#702] Re: Summary of discussion about RD (Re: Documentation about RD?) — matz@... (Yukihiro Matsumoto) 1999/08/19

Hi,

[#704] Re: Summary of discussion about RD (Re: Docum entation about RD?) — Clemens Hintze <c.hintze@...> 1999/08/19

On 19 Aug, Yukihiro Matsumoto wrote:

[#719] Re: Summary of discussion about RD (Re: Docum entation about RD?) — Toshiro Kuwabara <toshirok@...3.so-net.ne.jp> 1999/08/20

Hi,

[#720] Re: Summary of discussion about RD (Re: Docum entation about RD?) — clemens.hintze@... 1999/08/20

On 20 Aug, Toshiro Kuwabara wrote:

[#721] Re: Summary of discussion about RD (Re: Docum entation about RD?) — Toshiro Kuwabara <toshirok@...3.so-net.ne.jp> 1999/08/20

Hi,

[#722] Re: Summary of discussion about RD (Re: Docum entation about RD?) — clemens.hintze@... 1999/08/20

On 21 Aug, Toshiro Kuwabara wrote:

[#723] Re: Summary of discussion about RD (Re: Docum entation about RD?) — Toshiro Kuwabara <toshirok@...3.so-net.ne.jp> 1999/08/20

Hi,

[#737] RD with multi charset — Minero Aoki <aamine@...>

Hi, I'm Minero Aoki. This is my first mail in this mailling list.

26 messages 1999/08/22

[ruby-talk:00574] Re: Question concerning modules (1)

From: Kazuhiro HIWADA <hiwada@...>
Date: 1999-08-06 14:31:32 UTC
List: ruby-talk #574
Hi,

From: clemens.hintze@alcatel.de
Subject: [ruby-talk:00565] Re: Question concerning modules (1)
Date: Fri, 6 Aug 1999 10:30:30 +0200 (MET DST)

> >> >> # Aha! `Foo' contains the instance variable.
> >> >
> >> >Yes. But it's not instance variable of Foo's instance.
>
> And again you are speaking from a instance of Foo. What do you
> mean?

Let me do some preparation.  I thought that the word `instance
variable' seems to have two meanings,

1) variable of class's instance.  (from the `class' point of view)
2) variable of object.            (from the `object' point of view)

class Bar
  def bar(x) ; @ivar = x end
end
aBar = Bar.new

ex1) @ivar is instance variable of class Bar. (1st use)
ex2) aBar (a instance of class Bar) has instance variable @ivar.

It seems polymorphic.  So, I'll say just 'variable'.

ex1') @ivar is variable of class Bar's instance.
ex2') aBar has variable @ivar. (as one of it's attributes)

>       How do I create instances of Foo? And why do I call the variable
> an instance variable? If it is an instance variable, it should be only
> accessible via Foo's instance, but not from Foo itself, isn't it?

Strictry, I had to write:
              Foo  -->  (Foo)
               |	
  aFoo  -->   CFoo
instance     class

To create instrances of Foo (i.e. aFoo), you have to use class object
CFoo, which includes Foo.  In module Foo's definition, you could describe
variable of it's instance (i.e. aFoo's variable).

NOTE: Bar.instance_variables returns Bar's variables, not variables of
Bar's instance.

Ya, now I got the point.  Following code would be more helpful, isn't
it.

module Foo
  @var_of_Foo = 12
  def foo
    @var_of_aFoo = 34
  end
end 

> >   aFoo  -->  Foo -->  (Foo)
> > instance   module   metaclass
> 
> And again: What is aFoo? What is the metaclass (Foo)? From where did it
> come?

Foo has methods (i.e. Foo.new). And these methods are implemented as
(Foo)'s instance_methods.

> > By `foo.extend Foo', foo is extended to have Foo's instance methods as
> > foo's methods, because now foo is an instance of Foo like aFoo.  This
> > case is as follows:
> > 
> >           aFoo -->  Foo  --> (Foo)
> > afoo  --> foo  --> (foo)
> 
> Ahh! By extending a module object, that module becomes a instance of
> the module that extends it, right? That means:
> 
> 	foo.extend foo
> 
> would let foo be an instance of itself, right? And here foo would 
> also become a metaclass for itself?

Well, foo become a ancestor of a metaclass for itself.  (I use the
word `ancestors' as the means of Module#ancestors :-)

> It is a really complex thing. I very appreciate your help. Thank you!

You're welcome.
--
sorry for my buggy english
best regards
Kazuhiro HIWADA (hiwada@kuee.kyoto-u.ac.jp)

In This Thread

Prev Next