[#25808] break & retry in block — Shin-ichiro HARA <sinara@...>

原です。

15 messages 2005/03/04

[#25812] Re: [ruby-cvs] ruby/test/ruby, ruby/test/logger, ruby/sample, ruby/misc, ruby/lib/xmlrpc, ruby/lib/wsdl/soap, ruby/lib/rexml, ruby/lib/rdoc/parsers, ruby/lib/rdoc/generators, ruby/lib/irb, ruby/lib, ruby/ext/zlib, ruby/ext/win32ole, ruby/ext/tk, ruby/ext/strscan, ruby/ext/socket, ruby/ext/readline, ruby/ext/pty, ruby/ext/openssl, ruby/ext/iconv, ruby/ext/etc, ruby/ext/dl, ruby/ext/curses, ruby/ext/bigdecimal, ruby/ext/Win32API, ruby: * array.c: replace rb_protect_inspect() and rb_inspecting_p() by — Tanaka Akira <akr@...17n.org>

In article <20050304064753.53859C671F@lithium.ruby-lang.org>,

3 messages 2005/03/06

[#25853] conflict method and local variable — Hidetoshi NAGAI <nagai@...>

永井@知能.九工大です.

56 messages 2005/03/10
[#25854] Re: conflict method and local variable — Yukihiro Matsumoto <matz@...> 2005/03/10

まつもと ゆきひろです

[#25855] Re: conflict method and local variable — Hidetoshi NAGAI <nagai@...> 2005/03/10

永井@知能.九工大です.

[#25856] Re: conflict method and local variable — Yukihiro Matsumoto <matz@...> 2005/03/10

まつもと ゆきひろです

[#25857] Re: conflict method and local variable — Hidetoshi NAGAI <nagai@...> 2005/03/11

永井@知能.九工大です.

[#25858] Re: conflict method and local variable — Yukihiro Matsumoto <matz@...> 2005/03/11

まつもと ゆきひろです

[#25861] Re: conflict method and local variable — Hidetoshi NAGAI <nagai@...> 2005/03/11

永井@知能.九工大です.

[#25863] Re: conflict method and local variable — Yukihiro Matsumoto <matz@...> 2005/03/11

まつもと ゆきひろです

[#25864] Re: conflict method and local variable — Hidetoshi NAGAI <nagai@...> 2005/03/11

永井@知能.九工大です.

[#25865] Re: conflict method and local variable — Yukihiro Matsumoto <matz@...> 2005/03/11

まつもと ゆきひろです

[#25866] Re: conflict method and local variable — Hidetoshi NAGAI <nagai@...> 2005/03/11

永井@知能.九工大です.

[#25869] Re: conflict method and local variable — Shugo Maeda <shugo@...> 2005/03/13

前田です。

[#25875] Re: conflict method and local variable — Yukihiro Matsumoto <matz@...> 2005/03/13

まつもと ゆきひろです

[#25878] Re: conflict method and local variable — Hidetoshi NAGAI <nagai@...> 2005/03/13

永井@知能.九工大です.

[#25882] Re: conflict method and local variable — Yukihiro Matsumoto <matz@...> 2005/03/13

まつもと ゆきひろです

[#25884] Re: conflict method and local variable — Hidetoshi NAGAI <nagai@...> 2005/03/14

永井@知能.九工大です.

[#25885] Re: conflict method and local variable — Yukihiro Matsumoto <matz@...> 2005/03/14

まつもと ゆきひろです

[#25888] Re: conflict method and local variable — Shugo Maeda <shugo@...> 2005/03/14

前田です。

[#25946] ext/tk/sample/**/*.gif are broken — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。

16 messages 2005/03/27

[#25959] some trouble on ext/tk/sample — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。

20 messages 2005/03/29
[#25969] Re: some trouble on ext/tk/sample — Hidetoshi NAGAI <nagai@...> 2005/03/30

永井@知能.九工大です.

[#25970] Re: some trouble on ext/tk/sample — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/03/30

山本です。

[#25973] Re: some trouble on ext/tk/sample — Hidetoshi NAGAI <nagai@...> 2005/03/31

永井@知能.九工大です.

[ruby-dev:25873] Re: conflict method and local variable

From: nobu@...
Date: 2005-03-13 13:49:45 UTC
List: ruby-dev #25873
なかだです。

At Fri, 11 Mar 2005 01:49:17 +0900,
Hidetoshi NAGAI wrote in [ruby-dev:25855]:
> # 上記のコードは cursor 変数の値が eval の中で書き換えられる恐れがある
> # という問題もあるわけですが,そこは置いておくとして.(^_^;

元の話とはずれますが、一般にそういう場合はコンテキストを分離す
るべきだと思います。


* ext/tk/sample/demos-{en,jp}/widget (invoke): evaluate demonstration
  codes under separated context.  [ruby-dev:25855]


Index: ext/tk/sample/demos-en/widget
===================================================================
RCS file: /src/ruby/ext/tk/sample/demos-en/widget,v
retrieving revision 1.15
diff -u -2 -p -d -r1.15 widget
--- ext/tk/sample/demos-en/widget	10 Mar 2005 10:13:30 -0000	1.15
+++ ext/tk/sample/demos-en/widget	13 Mar 2005 06:11:25 -0000
@@ -510,4 +510,8 @@ else # ver >= 8.4
 end
 
+def new_binding
+  binding
+end
+
 # invoke --
 # This procedure is called when the user clicks on a demo description.
@@ -526,5 +530,5 @@ def invoke (txt, idx)
 #  eval `cat #{tag[5..-1]}.rb`
 #  eval `cat #{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb`
-  eval IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join
+  eval IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, new_binding
   Tk.update
 #  txt.cursor('xterm')
Index: ext/tk/sample/demos-jp/widget
===================================================================
RCS file: /src/ruby/ext/tk/sample/demos-jp/widget,v
retrieving revision 1.15
diff -u -2 -p -d -r1.15 widget
--- ext/tk/sample/demos-jp/widget	10 Mar 2005 10:13:30 -0000	1.15
+++ ext/tk/sample/demos-jp/widget	13 Mar 2005 06:11:25 -0000
@@ -552,4 +552,8 @@ else # ver >= 8.4
 end
 
+def new_binding
+  binding
+end
+
 # テキスト上での click に対する動作
 def invoke (txt, idx)
@@ -561,5 +565,5 @@ def invoke (txt, idx)
 #  eval `cat #{tag[5..-1]}.rb`
 #  eval `cat #{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb`
-  eval IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join
+  eval IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, new_binding
   Tk.update
 #  txt.cursor('xterm')


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦

In This Thread