[#1320] [MethodIndex] Bug and question — keiju@... (Keiju ISHITSUKA)

けいじゅ@日本ラショナルソフトウェアです.

32 messages 1998/01/23
[#1321] Re: [MethodIndex] Bug and question — matz@... (Yukihiro Matsumoto) 1998/01/23

まつもと ゆきひろです

[#1323] Re: [MethodIndex] Bug and question — keiju@... (Keiju ISHITSUKA) 1998/01/23

けいじゅ@日本ラショナルソフトウェアです.

[#1332] Re: [MethodIndex] Bug and question — keiju@... (Keiju ISHITSUKA) 1998/01/27

けいじゅ@日本ラショナルソフトウェアです.

[#1333] Re: [MethodIndex] Bug and question — matz@... (Yukihiro Matsumoto) 1998/01/27

まつもと ゆきひろです

[#1334] Re: [MethodIndex] Bug and question — keiju@... (石塚圭樹 ) 1998/01/27

けいじゅ@日本ラショナルソフトウェアです.

[#1351] Re: [MethodIndex] Bug and question — keiju@... (石塚圭樹 ) 1998/01/29

けいじゅ@日本ラショナルソフトウェアです.

[#1353] Re: [MethodIndex] Bug and question — matz@... (Yukihiro Matsumoto) 1998/01/29

まつもと ゆきひろです

[#1354] Re: [MethodIndex] Bug and question — keiju@... (石塚圭樹 ) 1998/01/29

けいじゅ@日本ラショナルソフトウェアです.

[#1355] Re: [MethodIndex] Bug and question — matz@... (Yukihiro Matsumoto) 1998/01/30

まつもと ゆきひろです

[ruby-dev:1354] Re: [MethodIndex] Bug and question

From: keiju@... (石塚圭樹 )
Date: 1998-01-29 15:33:55 UTC
List: ruby-dev #1354
けいじゅ@日本ラショナルソフトウェアです.

In [ruby-dev :01353 ] the message: "[ruby-dev:1353] Re: [MethodIndex]
Bug and question ", on Jan/29 17:13(JST) Yukihiro Matsumoto writes:

>まつもと ゆきひろです

>パッチの追加があります.

パッチ当てました. けども...

>|4.2 クラス(モジュール)メソッドについて

>
>|#1, #2が違うのは良いんですが, なぜ #2, #3は異なっているのでしょう?
>|
>|それに, 最初の3,4個のClassは実際には何なんでしょうね? 気分的には:
>|
>|  Barの特異クラス < Fooの特異クラス < Objectの特異クラス <
>|    Class < Module < Object < Kernel
>|
>|となるべきかなと思うんですが?

rbc0> class Foo
rbc1> end
rbc0> class Bar < Foo
rbc1> end
rbc0> module Baz
rbc1> end
rbc0> class Foo
rbc1>   include Baz
rbc1> end
rbc0> Bar.ancestors
[Bar, Foo, Baz, Object, Kernel]
rbc0> Bar.type.ancestors
[Class, Module, Object, Kernel]
rbc0> f = eval("class << Bar; ancestors; end")
[Class, Module, Object, Kernel]


Bar.ancestors
Bar.type.ancestors

はこれで良いと思うのですが, ``class << Bar; ancestors; end ''の結果が
不満なんです. やはり:

  Barの特異クラス < Fooの特異クラス < Bazの特異クラス <Objectの特異クラス <
  Class < Module < Object < Kernel

となって欲しいんですが...

# MethodIndexはこうなっていることを前提として実装してしまいました(;_;

>|4.3 つぎに, incetance_of?に関する質問ですが.

>instance_of?は「そのクラスのインスタンスか?」という述語であ
>り,「そのクラスまたはそのサブクラスのインスタンスか?」とい
>う述語ではありません.そういう目的にはkind_of?を使って下さい.

というかですね...

# 前の続き
rbc0> BAR = eval("class << Bar; self; end")
Class
rbc0> Bar.instance_of?(BAR)
false
rbc0> Bar.instance_of?(Class)
false
rbc0> Bar.instance_of?(Bar.type)
false

こういう結果はおかしくないか? という意味です.

__
................................石塚 圭樹@日本ラショナルソフトェア...
----------------------------------->> e-mail: keiju@rational.com <<---

In This Thread