yarv-dev:836
From: SASADA Koichi <ko1 atdot.net>
Date: Sat, 11 Feb 2006 11:08:28 +0900
Subject: [yarv-dev:836] Re: open> $& and other variables in proc are not thread local
ささだです。 sheepman wrote: > まだ ruby-1.9 と違うようです。 > 次のように proc を作って別のスレッドで呼ぶと、$~, $&, $1 などの > 組み込み変数が ruby-1.9 と違ってスレッドローカルではありません。 > > $ cat t.rb > /(.)/ =~ "a" > b = Thread.new{ > proc do > p $~, $&, $1 > end > }.value > b.call > > $ ./miniruby -v t.rb > ruby 1.9.0 (2006-02-09) [i686-linux] > YARVCore 0.3.3 (rev: 378) [opts: ] > #<MatchData:0x402977bc> > "a" > "a" > > $ ruby-1.9 -v t.rb > ruby 1.9.0 (2006-02-09) [i686-linux] > nil > nil > nil うーん、この辺はどっちでもいいような気がしますが、なんかこうじゃないと 困るってことはありますかね。 -- // SASADA Koichi at atdot dot net -- ML: yarv-dev quickml.atdot.net 使い方: http://www.atdot.net/~ko1/quickml
830 2006-02-09 09:20 [sheepman sheepman.sa] open> $& and other variables are not thread local 832 2006-02-10 08:47 ┗[ko1 atdot.net ] fixed> Re: open> $& and other variables are not thread local 835 2006-02-11 10:48 ┗[sheepman sheepman.sa] open> $& and other variables in proc are not thread local -> 836 2006-02-11 11:08 ┗[ko1 atdot.net ] 844 2006-02-12 15:13 ┗[sheepman sheepman.sa]