[#8820] BEGIN as stmt. ? — EGUCHI Osamu <eguchi@...>
えぐち@エスアンドイーです。
5 messages
2000/01/04
[#8824] [REQ] Integer#{hex,dec,oct,bin}, String#bin — gotoken@... (GOTO Kentaro)
ごとけんです
38 messages
2000/01/05
[#8839] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— matz@... (Yukihiro Matsumoto)
2000/01/06
まつもと ゆきひろです
[#8842] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— gotoken@... (GOTO Kentaro)
2000/01/06
ごとけんです
[#8843] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— matz@... (Yukihiro Matsumoto)
2000/01/06
まつもと ゆきひろです
[#8844] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— gotoken@... (GOTO Kentaro)
2000/01/06
ごとけんです
[#8857] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— keiju@... (石塚圭樹)
2000/01/06
けいじゅ@日本ラショナルソフトウェアです.
[#8846] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— matz@... (Yukihiro Matsumoto)
2000/01/06
まつもと ゆきひろです
[#8847] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— gotoken@... (GOTO Kentaro)
2000/01/06
ごとけんです
[#8890] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— Koji Arai <JCA02266@...>
2000/01/08
新井です。
[#8914] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— matz@... (Yukihiro Matsumoto)
2000/01/12
まつもと ゆきひろです
[#8968] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— Koji Arai <JCA02266@...>
2000/01/19
新井です。
[#8976] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— WATANABE Hirofumi <Hirofumi.Watanabe@...>
2000/01/20
わたなべです.
[#9041] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— matz@... (Yukihiro Matsumoto)
2000/01/29
まつもと ゆきひろです
[#9045] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— gotoken@... (GOTO Kentaro)
2000/01/30
ごとけんです
[#9061] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— gotoken@... (GOTO Kentaro)
2000/02/02
ごとけんです
[#9077] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— matz@... (Yukihiro Matsumoto)
2000/02/04
まつもと ゆきひろです
[#9114] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— gotoken@... (GOTO Kentaro)
2000/02/04
ごとけんです
[#9116] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— matz@... (Yukihiro Matsumoto)
2000/02/05
まつもと ゆきひろです
[#9119] Re: [REQ] Integer#{hex,dec,oct,bin}, String#bin
— gotoken@... (GOTO Kentaro)
2000/02/05
ごとけんです
[#8828] Re: [ruby-list:20054] Re: == === case — Shugo Maeda <shugo@...>
前田です。
11 messages
2000/01/05
[#8829] Re: [ruby-list:20054] Re: == === case
— matz@... (Yukihiro Matsumoto)
2000/01/05
まつもと ゆきひろです
[#8866] DoubleFloat — gotoken@... (GOTO Kentaro)
ごとけんです
13 messages
2000/01/07
[#8867] Re: DoubleFloat
— EGUCHI Osamu <eguchi@...>
2000/01/07
えぐち@エスアンドイー です。
[#8869] Re: DoubleFloat
— gotoken@... (GOTO Kentaro)
2000/01/07
In message "[ruby-dev:8867] Re: DoubleFloat"
[#8886] Complex#divmod — Masahiro TANAKA <masa@...>
田中@ISASです。ついでに気になっていることを。
11 messages
2000/01/08
[#8895] Re: Complex#divmod
— keiju@... (石塚圭樹)
2000/01/10
けいじゅ@日本ラショナルソフトウェアです.
[#8899] Re: Complex#divmod
— matz@... (Yukihiro Matsumoto)
2000/01/10
まつもと ゆきひろです
[#8893] Re: [ruby-list:20142] Re: Range expansion? — Akinori MUSHA aka knu <knu@...>
knuです。ruby-listから舞台を移しました。
13 messages
2000/01/09
[#8906] Re: [ruby-list:20142] Re: Range expansion?
— Shugo Maeda <shugo@...>
2000/01/11
前田です。
[#8924] Re: [ruby-list:20142] Re: Range expansion?
— matz@... (Yukihiro Matsumoto)
2000/01/13
まつもと ゆきひろです
[#8925] Re: [ruby-list:20142] Re: Range expansion?
— Shugo Maeda <shugo@...>
2000/01/13
前田です。
[#8926] Re: [ruby-list:20142] Re: Range expansion?
— matz@... (Yukihiro Matsumoto)
2000/01/13
まつもと ゆきひろです
[#8941] [BUG] recycle the ruby_dyna_vars — Koji Arai <JCA02266@...>
新井です。
9 messages
2000/01/16
[#8953] rb_str2inum() — "Shigeo Kobayashi" <shigeo@...>
小林です。
5 messages
2000/01/18
[#8980] 1.4.3 patch for near-future *BSD IPv6 support — Jun-ichiro itojun Hagino <itojun@...>
近い将来の{Net,Free,Open}BSDにはKAME IPv6 stackが統合されています。
17 messages
2000/01/20
[#8981] Re: 1.4.3 patch for near-future *BSD IPv6 support
— Jun-ichiro itojun Hagino <itojun@...>
2000/01/20
> それから、
[#8989] Re: 1.4.3 patch for near-future *BSD IPv6 support
— MIYAJIMA Mitsuharu <miya@...>
2000/01/21
[#8996] Re: 1.4.3 patch for near-future *BSD IPv6 support
— Jun-ichiro itojun Hagino <itojun@...>
2000/01/21
[#9049] Re: 1.4.3 patch for near-future *BSD IPv6 support
— Katsuyuki Komatsu <komatsu@...>
2000/02/01
小松です。
[#8986] sort — gotoken@... (GOTO Kentaro)
ごとけんです
13 messages
2000/01/20
[#9004] DEFAULT_KCODE in rbconfig.rb — OKUNISHI -GTO- Fujikazu <fuji0924@...>
OS/2 隠居の奥西@京田辺市です。
8 messages
2000/01/22
[#9005] Re: DEFAULT_KCODE in rbconfig.rb
— matz@... (Yukihiro Matsumoto)
2000/01/23
まつもと ゆきひろです
[#9008] [PATCH] Array#flatten! for recursive array — nobu.nakada@...
なかだです。
9 messages
2000/01/24
[#9011] Re: [PATCH] Array#flatten! for recursive array
— matz@... (Yukihiro Matsumoto)
2000/01/24
まつもと ゆきひろです
[#9024] Re: [ruby-math:00115] Re: precedence of ** — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
4 messages
2000/01/26
[#9048] [PATCH] OS/2 patch improved for 1.5.0 — kenn@...
長沢です。
6 messages
2000/01/31
[ruby-dev:9019] Re: [PATCH] Array#flatten! for recursive array
From:
nobu.nakada@...
Date:
2000-01-25 22:03:26 UTC
List:
ruby-dev #9019
なかだです。
At Tue, 25 Jan 2000 12:48:55 +0900,
Shin-ichiro Hara <sinara@blade.nagaokaut.ac.jp> wrote:
> ||a = []; a << a; a.flatten!
> ||
> ||が返って来なかったりするのも一緒に変更しちゃってますが、あるいは
> ||こういう再帰的な構造に対して flatten! を使おうというがそもそも間
> ||違ってるんでしょうか。いっそ raise すべき?
> |
> |こっちは私にはなかなか判断できません。flattenの大家(というか
> |生みの親)である原先生のご意見を伺いたいです。
>
> 私は無限ループになっても文句は言えないけど、
> できれば raise してあげるのが親切だと思います。
んでは。しかし、よく悩むんですが、こういうときって何を raise す
るのがいいんでしょうか。とりあえず RuntimeError にしてみましたが…。
Index: ChangeLog
===================================================================
RCS file: /home/cvs/ruby/ChangeLog,v
retrieving revision 1.36
diff -u -2 -p -r1.36 ChangeLog
--- ChangeLog 2000/01/18 06:09:02 1.36
+++ ChangeLog 2000/01/25 21:37:39
@@ -1,2 +1,10 @@
+Wed Jan 26 06:18:35 2000 Nakada.Nobuyoshi <nobu.nokada@softhome.net>
+
+ * array.c (rb_protect_inspect, rb_inspecting_p): avoiding infinite
+ recursive call for self recursive arrays.
+
+ * array.c (rb_ary_flatten_bang): now raises for self recursive
+ arrays.
+
Tue Jan 18 12:24:28 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
Index: array.c
===================================================================
RCS file: /home/cvs/ruby/array.c,v
retrieving revision 1.11
diff -u -2 -p -r1.11 array.c
--- array.c 2000/01/18 06:09:02 1.11
+++ array.c 2000/01/25 21:37:44
@@ -791,6 +791,6 @@ rb_protect_inspect(func, obj, arg)
{
struct inspect_arg iarg;
-
VALUE inspect_tbl;
+ VALUE id;
if (!inspect_key) {
@@ -802,8 +802,9 @@ rb_protect_inspect(func, obj, arg)
rb_thread_local_aset(rb_thread_current(), inspect_key, inspect_tbl);
}
- if (rb_ary_includes(inspect_tbl, obj)) {
+ id = rb_obj_id(obj);
+ if (rb_ary_includes(inspect_tbl, id)) {
return (*func)(obj, arg);
}
- rb_ary_push(inspect_tbl, obj);
+ rb_ary_push(inspect_tbl, id);
iarg.func = func;
iarg.arg1 = obj;
@@ -822,5 +823,5 @@ rb_inspecting_p(obj)
inspect_tbl = rb_thread_local_aref(rb_thread_current(), inspect_key);
if (NIL_P(inspect_tbl)) return Qfalse;
- return rb_ary_includes(inspect_tbl, obj);
+ return rb_ary_includes(inspect_tbl, rb_obj_id(obj));
}
@@ -1501,4 +1502,5 @@ rb_ary_flatten_bang(ary)
long i;
int mod = 0;
+ VALUE flattening = Qnil;
rb_ary_modify(ary);
@@ -1506,4 +1508,14 @@ rb_ary_flatten_bang(ary)
VALUE ary2 = RARRAY(ary)->ptr[i];
if (TYPE(ary2) == T_ARRAY) {
+ VALUE id = rb_obj_id(ary2);
+ if (ary == ary2) {
+ recursive:
+ rb_raise(rb_eRuntimeError, "self recursive array");
+ } else if (NIL_P(flattening)) {
+ flattening = rb_ary_new();
+ } else if (rb_ary_includes(flattening, id)) {
+ goto recursive;
+ }
+ rb_ary_push(flattening, id);
rb_ary_replace(ary, i--, 1, ary2);
mod = 1;
--
そうだ 強気に ちょっと インチキに☆彡
中田 "Bugるくらいがちょうどいいかも;-)" 伸悦