[#34] [Bug] Class#superclass — shugo@... (maeda shugo)
前田です。
[#49] Re: Nil is a subclass of Object? — shugo@... (maeda shugo)
前田です。
[#50] Re: [ruby-list:3596] Module#attr specification (Re: boolean values) — keiju@... (石塚圭樹 )
けいじゅ@日本ラショナルです.
前田です。
まつもと ゆきひろです
わたなべです.
[#53] About C struct who has references to ruby objects — shugo@... (maeda shugo)
前田です。
[#58] Re: Nil is a subclass of Object? — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
[#78] [Bug] Socket#send, Socket#recvfrom — shugo@... (maeda shugo)
前田です。
[#97] Re: meta programming features — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
[#115] Re: meta programming features — WATANABE Hirofumi <watanabe@...>
わたなべです.
[#117] Re: tail recursion (Re: LaTeX ruby documents) — keiju@... (石塚圭樹 )
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
[#121] Re: meta programming features — keiju@... (石塚圭樹 )
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
[#127] tracer — keiju@... (Keiju ISHITSUKA)
けいじゅ@いそうろう.日本ラショナルです.
まつもと ゆきひろです
けいじゅ@いそうろう.日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
わたなべです.
まつもと ゆきひろです
わたなべです.
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
[#167] argument default value — shugo@... (前田 修吾 / maeda shugo)
前田です。
[#185] Re: [ruby-list:3720] Re: Class#eval [Re: ftplib.rb revision 1.4] — keiju@... (石塚圭樹 )
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
まつもと ゆきひろです
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
けいじゅ@やっと自オフィス.日本ラショナルです.
まつもと ゆきひろです
まつもと ゆきひろです
[#189] include [Re: new sync.rb release] — keiju@... (石塚圭樹 )
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
[#221] '@' in yylex() — keiju@... (Keiju ISHITSUKA)
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
[#228] How to handle Struct — Eiji-usagi-MATSUmoto <ematsu@...>
うさぎです。
[#232] ruby for mswin32 1.1a1差分 — KIMURA Koichi <kkimura@...>
木村 です。
[#257] [BUG] MLF — keiju@... (Keiju ISHITSUKA)
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
まつもと ゆきひろです
けいじゅ@日本ラショナルです.
けいじゅ@日本ラショナルです.
[#276] Re: SyslogSendmail class — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
[#291] illegal here document — shugo@... (前田 修吾 / maeda shugo)
前田です。
まつもと ゆきひろです
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
わたなべです.
[#309] [BUG] method index — keiju@... (Keiju ISHITSUKA)
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
[#313] ruby 1.1a4 released — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
[#330] [BUG] Module#methods — keiju@... (Keiju ISHITSUKA)
けいじゅ@日本ラショナルソフトウェアです.
[ruby-dev:275] Re: [BUG] MLF
けいじゅ@日本ラショナルです.
またまたバグレポート+質問です.
In [ruby-dev :00270 ] the message: "[ruby-dev:270] Re: [BUG] MLF ", on
Aug/26 22:28(JST) keiju@bc.mbn.or.jp (石塚圭樹) writes:
1. instance_eval
class Foo
end
f = Foo.new
f.instance_eval %q{
def foo
print "foo"
end
}
f.foo
-----------------
mop.rb:143: NameError: private method `foo' called for #<Foo:0xbf3d4>(Foo)
となります.
ちなみに:
f.instance_eval %q{
def foo
print "foo"
end
public :foo
}
はできないんですねぇ...
2. ??
e2mmap.rbに絡んでいて, 話しがややこしいのですが, 良く分からないことが
発生しているので教えて下さい.
以下のソースの中の[A]を見て下さい.
self.instance_eval ...
となっているのですが, これを
self.module_eval ...
としても同じ動作をしているようです. ここでの self は
class Foo
extend Exception2MessageMapper
def_exception(:EFoo, "efoo")
end
とした時の Exception2MessageMapper.extend_object(cl) で渡るクラスにな
るので, この場合なら Foo というクラスになっていると思います.
そうすると,
Foo.instance_eval
と
Foo.module_eval
では動作が違うはずなんですが, 例えば, def foo... とすると両方とも
Foo#fooが定義されます... module_evalでは Foo.fooが定義されるはずですよ
ね....
これは一体どういうことなのでしょう?
# ちなみに, 先ほどのバグレポートがあるにも関わらず instance_eval が動
# 作するのもなぞですが...
-- e2mmap.rb
module Exception2MessageMapper
RCS_ID='-$Header: /home/keiju/var/src/var.lib/ruby/RCS/e2mmap.rb,v 1.4 1997/08/18 07:12:12 keiju Exp keiju $-'
# E2MM = Exception2MessageMapper
def Exception2MessageMapper.extend_object(cl)
super
cl.bind(self)
end
def Exception2MessageMapper.extend_to(b)
c = eval("self", b)
c.extend(self)
end
def bind(cl)
begin
map = const_get(:E2MM_ErrorMSG, TRUE).dup
rescue NameError
map = Hash.new
end
const_set(:E2MM_ErrorMSG, map)
print self.inspect, "\n"
# [A] self.module_eval
self.instance_eval %q^
def fail!(*rest)
super
end
# fail(err, *rest)
# err: 例外
# rest: メッセージに渡すパラメータ
#
def fail(err, *rest)
if form = E2MM_ErrorMSG[err]
$! = err.new(sprintf(form, *rest))
$@ = caller(0)
$@.shift
super()
else
Exception2MessageMapper.fail Exception2MessageMapper::ErrNotRegisteredException, err.to_s
end
end
public :fail
# def_exception(c, m)
# c: exception
# m: message_form
# 例外cのメッセージをmとする.
#
def def_e2message(c, m)
E2MM_ErrorMSG[c] = m
end
# def_exception(c, m)
# n: exception_name
# m: message_form
# s: 例外スーパークラス(デフォルト: Exception)
# 例外名``c''をもつ例外を定義し, そのメッセージをmとする.
#
#def def_exception(n, m)
def def_exception(n, m, s = Exception)
n = n.id2name if n.kind_of?(Fixnum)
e = Class.new(s)
const_set(n, e)
# E2MM_ErrorMSG[e] = m
const_get(:E2MM_ErrorMSG)[e] = m
print inspect, "\n"
print E2MM_ErrorMSG.inspect, "\n"
print const_get(:E2MM_ErrorMSG).inspect, "\n"
end
^
end
extend Exception2MessageMapper
def_exception(:ErrNotClassOrModule, "Not Class or Module")
def_exception(:ErrNotRegisteredException, "not registerd exception(%s)")
end
__
..........................................石塚 圭樹@日本ラショナル...
----------------------------------->> e-mail: keiju@bc.mbn.or.jp <<---