[#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:00558] Re: Question concerning modules (1)

From: Kazuhiro HIWADA <hiwada@...>
Date: 1999-08-04 12:15:19 UTC
List: ruby-talk #558
Hi,

Ruby's object.c contains following chart:

    /*
     * Ruby's Class Hierarchy Chart
     *
     *                           +------------------+
     *                           |                  |
     *             Object---->(Object)              |
     *              ^  ^        ^  ^                |
     *              |  |        |  |                |
     *              |  |  +-----+  +---------+      |
     *              |  |  |                  |      |
     *              |  +-----------+         |      |
     *              |     |        |         |      |
     *       +------+     |     Module--->(Module)  |
     *       |            |        ^         ^      |
     *  OtherClass-->(OtherClass)  |         |      |
     *                             |         |      |
     *                           Class---->(Class)  |
     *                             ^                |
     *                             |                |
     *                             +----------------+
     *
     *   + All metaclasses are instances of the class `Class'.
     */

Holizontal arrow denotes `class object --> (metaclass object)'
relation.

Follow this chart, I'll express module object as Foo, and it's
metaclass object as (Foo).  And in this article `-->' also denotes
instance object --> class object relationship, as follows:

  aFoo  -->   Foo   -->    (Foo)
instance   class-obj   metaclass-obj

In fact, these two `-->'s are also denotes instance --> class
relation.  Now I try to explain the phenomena.


From: Clemens Hintze <c.hintze@gmx.net>
Subject: [ruby-talk:00556] Re: Question concerning modules (1)
Date: Wed, 4 Aug 1999 08:13:02 +0200

> >> rbc0> Foo.instance_variables.include? "@ivar"
> >> true
> >> 
> >> # Aha! `Foo' contains the instance variable.
> >
> >Yes. But it's not instance variable of Foo's instance.
> 
> Eh! That I don't fully understand! If it is not instance variable of
> `Foo's instance, whose instance variable it is? :-////

In this case, objects are releted as follows:

  aFoo  -->  Foo -->  (Foo)
instance   module   metaclass

I ment that @ivar is not aFoo's variable, but Foo's variable.

NOTE: Foo.methods returns Foo's methods, and Foo.instance_methods
returns aFoo's methods.

> >
> >Cause foo's (singleton) class is extended by Foo, foo has the method `show'.
> >
> 
> But why has this methods mutated to module functions? `Foo' is a
> singleton class; not an instance, right? That is also true for `foo'.
> If I extend a `Class' with features of a `Module', why I can use
> these features like class methods/module functions?

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)

[again]
> But why has this methods mutated to module functions? `Foo' is a
> singleton class; not an instance, right? That is also true for `foo'.

Yes, foo is a afoo's class (in this case, it's not called singleton
maybe).  And, foo is a instance of Foo either.  Strictry speaking,
foo's class (foo) has Foo as a ancestor of (foo).

NOTE?: I beliave, `singleton class' is a class of one object, that
isn't a class of any other object.  I believe, metaclass is always
singleton class.

[again]
> If I extend a `Class' with features of a `Module', why I can use
> these features like class methods/module functions?

You unexpectedly extended `Class's class.

You can use Module#include, Module#append_features(module_or_class),
for such use.

# module_or_*class* !, I didn't know that !! class's feature could
# be appended !!! :-)

> >Hope this helps,
> 
> Much, but not enough ;-)

This is the limit of my ability.  If you need further help, matz or
gotoken or shugo or ... will help us ;-p
--
sorry for my broken english
best regards
Kazuhiro HIWADA (hiwada@kuee.kyoto-u.ac.jp)

In This Thread