[#28230] bcc32 memory manager — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。

15 messages 2006/01/18

[#28243] FUNCTION_CALL_MAY_RETURN_TWICE — Hajimu UMEMOTO <ume@...>

梅本です。

18 messages 2006/01/20

[#28270] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。

17 messages 2006/01/23
[#28271] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2006/01/23

山本です。

[#28272] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes — WATANABE Hirofumi <eban@...> 2006/01/23

わたなべです。

[#28273] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2006/01/23

山本です。

[#28274] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2006/01/24

山本です。

[#28275] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes — "U.Nakamura" <usa@...> 2006/01/24

こんにちは、なかむら(う)です。

[#28286] SEGV with zlib — Tanaka Akira <akr@...17n.org>

最近、Data オブジェクトの free 関数が気になっているのですが、

24 messages 2006/01/30
[#28303] Re: SEGV with zlib — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2006/02/06

山本です。

[#28304] Re: SEGV with zlib — Yukihiro Matsumoto <matz@...> 2006/02/06

まつもと ゆきひろです

[#28305] Re: SEGV with zlib — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2006/02/06

山本です。

[#28306] Re: SEGV with zlib — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2006/02/06

山本です。

[#28307] Re: SEGV with zlib — Tietew <tietew-ml-ruby-dev@...> 2006/02/06

[#28308] Re: SEGV with zlib — Yukihiro Matsumoto <matz@...> 2006/02/06

まつもとゆきひろです。

[ruby-dev:28214] alias で別名付けできないメソッドがある?

From: KIMURA Koichi <kimura.koichi@...>
Date: 2006-01-10 02:59:12 UTC
List: ruby-dev #28214
木村です。

Regexp クラスのcompileメソッドを再定義しようとして

class Regexp
  alias orig_compile compile
end

とすると、

NameError: undefined method `compile' for class `Regexp'

となります(ruby 1.9.0 2006-01-05 mswin32)。
compile のほかにも escape, union, last_match, quote
が同様のエラーとなります。これらの共通点を調べてみると、

    rb_define_singleton_method(rb_cRegexp, "compile", rb_class_new_instance, -1);
    rb_define_singleton_method(rb_cRegexp, "quote", rb_reg_s_quote, -1);
    rb_define_singleton_method(rb_cRegexp, "escape", rb_reg_s_quote, -1);
    rb_define_singleton_method(rb_cRegexp, "union", rb_reg_s_union, -1);
    rb_define_singleton_method(rb_cRegexp, "last_match", rb_reg_s_last_match, -1);

のように rb_define_singleton_method で定義されたメソッドなのですが、
他のクラスで同様に定義されているメソッドではエラーにならないものも
あります(Fileクラスの atとか)。

エラーになる/ならないの境界はどこにあるのでしょうか?
また、エラーになるのが正しいとしても、undefined method というのは
適切ではないと思いますがいかがでしょうか。

-- 
木村浩一


In This Thread

Prev Next