[#1219] ruby animal — OZAWA Sakuro <crouton@...>

小澤さく@塩尻Internetです.

18 messages 1996/12/09

[#1256] ruby 0.99.4-961212 available — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです.

21 messages 1996/12/12
[#1257] Re: ruby 0.99.4-961212 available — Yasuo OHBA <jammy@...> 1996/12/12

大庭@SHLJapanです.

[#1258] Re: ruby 0.99.4-961212 available — matz@... (Yukihiro Matsumoto) 1996/12/12

まつもと ゆきひろです.

[#1259] Re: ruby 0.99.4-961212 available — WATANABE Hirofumi <watanabe@...> 1996/12/12

わたなべです.

[#1261] Re: ruby 0.99.4-961212 available — matz@... (Yukihiro Matsumoto) 1996/12/12

まつもと ゆきひろです.

[#1290] ruby 0.99.4-961217 will be available — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです.

32 messages 1996/12/17
[#1300] Re: ruby 0.99.4-961217 will be available — sinara@... 1996/12/17

原です。

[#1305] Re: ruby 0.99.4-961217 will be available — matz@... (Yukihiro Matsumoto) 1996/12/17

まつもと ゆきひろです.

[#1308] Re: ruby 0.99.4-961217 will be available — gougi@... (Shigeru Gougi) 1996/12/17

ごうぎ@TCIです。

[#1341] Re: ruby 0.99.4-961217 will be available — matz@... (Yukihiro Matsumoto) 1996/12/18

まつもと ゆきひろです.

[#1342] Re: ruby 0.99.4-961217 will be available — sinara@... 1996/12/18

原です。

[#1345] [BUG?] access string out of range — sinara@... 1996/12/18

原です。

[#1330] Re: Rational and Complex — Shin-ichiro Hara <sinara@...>

原です。

30 messages 1996/12/17
[#1335] Re: Rational and Complex — sinara@... 1996/12/18

原です。

[#1359] Re: Rational and Complex 1996/12/18

けいじゅ@SHLジャパンです.

[#1423] 配列への grep — (Dezawa Shin-ichiro) <dezawa@...>

出沢です

14 messages 1996/12/23

[#1469] wish ... — Noritugu Nakamura <nnakamur@...>

25 messages 1996/12/24
[#1470] Re: wish ... — matz@... (Yukihiro Matsumoto) 1996/12/24

まつもと ゆきひろです.

[ruby-list:1277] Re: thread and $1

From: matz@... (Yukihiro Matsumoto)
Date: 1996-12-12 08:12:54 UTC
List: ruby-list #1277
まつもと ゆきひろです.

In message "[ruby-list:1273] Re: thread and $1"
    on 96/12/12, 石塚圭樹 <keiju@shljapan.co.jp> writes:
|
|けいじゅ@SHLジャパンです. 
|
|In [ruby-list :01272 ] the message: "[ruby-list:1272] Re: thread and
|$1 ", on Dec/12 16:09(JST) matz@caelum.co.jp (Yukihiro Matsumoto)
|writes:
|
|>以下のものはグローバル変数のようにみえますが,実はローカル変
|>数です(マニュアルにも書いてあります).
|>
|>  $_ $~ $& $` $' $+ $1 $2 ...

|ん? そうすると以下のプログラムの動作は, おかしくないのですか??

おかしいですね.$_, $~はローカル変数であるだけではなくてスレッ
ドローカルにもしないといけなかったんですね.修正します.

|こういう動作は困り物だと思うのですが??

全くです.ローカル変数だから大丈夫だと思い込んでいましたが,
そういえばローカル変数ってthread間で共有されるんですよね.

|もう1つ:

|Thread.exit
|
|するとコアダンプします.

main threadでThread.exitするとcore dumpしていました.

パッチです.

--- eval.c~	Thu Dec 12 00:22:50 1996
+++ eval.c	Thu Dec 12 16:47:00 1996
@@ -3668,2 +3668,4 @@
     VALUE last_status;
+    VALUE last_line;
+    VALUE last_match;
 
@@ -3769,2 +3771,7 @@
 
+VALUE lastline_get();
+void lastline_set();
+VALUE backref_get();
+void backref_set();
+
 static int
@@ -3795,2 +3802,5 @@
     th->last_status = last_status;
+    th->last_line = lastline_get();
+    th->last_match = backref_get();
+
     th->file = sourcefile;
@@ -3843,2 +3853,6 @@
     last_status = th->last_status;
+
+    lastline_set(th->last_line);
+    backref_set(th->last_match);
+
     sourcefile = th->file;
@@ -4263,3 +4277,3 @@
     if (th->status == THREAD_KILLED) return Qnil; 
-    if (th == th->next) rb_exit(0);
+    if (th == th->next || th == main_thread) rb_exit(0);
 

In This Thread