[#33948] Schedule for the 1.8.7 release — "Akinori MUSHA" <knu@...>
Hi, developers,
[#33955] --encoding affects script encoding — sheepman <sheepman@...>
こんばんは sheepman です。
なかだです。
[#33962] Ruby1.9.0でのインタプリタ組み込みについての質問 — Masayuki Yamaguchi <Yamaguchi.Masayuki@...>
山口と申します。
[#33966] Re: [ruby-cvs:22881] Ruby:r15644 (trunk): * test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_chomp): test — Tanaka Akira <akr@...>
In article <200802291457.m1TEv6nh008515@ci.ruby-lang.org>,
まつもと ゆきひろです
[#33974] Test::Unit::Collector::Dirがtest_*.rb以外集めてくれない — "Ken Date" <itacchi@...>
こんにちは、伊達です。
[#33983] Re: [ruby-cvs:22913] Re: Ruby:r15674 (trunk): * gc.c (add_heap): sort heaps array in ascending order to use — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
In article <E1JWAV5-0001MG-9W@x61.netlab.jp>,
[#34011] Should --verbose be equal to -v ? — Yugui <yugui@...>
Yuguiです。
まつもと ゆきひろです
西山和広です。
Yuguiです。
[#34020] MurmurHash problem — Nobuyoshi Nakada <nobu@...>
なかだです。
[#34030] uint32_t — KIMURA Koichi <kimura.koichi@...>
木村です。
[#34037] Ruby performance gains on SPARC — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
[#34067] Array#take,take_while,drop,drop_whlie — "Yusuke ENDOH" <mame@...>
遠藤と申します。
[#34068] lgamma_r requires _REENTRANT on Solaris — "Yusuke ENDOH" <mame@...>
遠藤と申します。
[#34077] 異なるエンコーディングだと同じバイト列でも==にならない件 — rubikitch@...
るびきちです。
[#34086] extend spawn to change attributes of child process. — Tanaka Akira <akr@...>
spaen, system, exec, IO.popen で、起動する子プロセスの属性を
[#34093] 拡張ライブラリ初期化中でのmodule_eval — Kouhei Sutou <kou@...>
須藤です。
[#34095] (再送) Cygwin で Resolv.getaddress が失敗する — Kouhei Yanagita <yanagi@...>
こんにちは。柳田です。
こんばんは、植田と申します。
柳田です。
[#34105] rational.rb, complex.rb and mathn.rb — Tadayoshi Funaba <tadf@...>
rational と complex が組み込みになったことで、lib/mathn.rb の意義は薄
現時点で rational.rb と complex.rb を残しているのは、それが無難だから
で、かなり選択肢を絞った叩き台です。
けいじゅ@いしつかです.
原です。
> 私も Complex の組み込みは Rational とは比較にならないくらい、仕様が決め
まつもと ゆきひろです
> Mathモジュールは伝統的にlibmのラッパーであったので、それを逸
原です。
> (1) (-8)**Rational(1,2) は複素数1.0+1.7320508*i
[#34109] LP64: date.rb:321:in `convert': integer 86400000000000 too big to convert to `int' (RangeError) — Tanaka Akira <akr@...>
LP64 なマシンで test-all が動かなくなっています。
[#34144] [質問2点] C からの定数参照 & thread switching コストの低減 — Hidetoshi NAGAI <nagai@...>
永井@知能.九工大です.
[#34158] Complex組み込み — Masahiro TANAKA <masa16.tanaka@...>
Complexが組み込みになるそうですが、これはcomplex.rbを踏襲して、
原です。
> 今までの Complex は、complex.rb にほぼ残して、たとえば Rational 成分
原です。
> そうです。Complex が難しい、という話を書いておくと、
まつもと ゆきひろです
> |僕としては、/ 演算子の振舞いについて前向きに検討してほしいです。
まつもと ゆきひろです
> ふむ。では、/ のふるまいを
まつもと ゆきひろです
> |僕は、quo がいいと思います。
まつもと ゆきひろです
> となるようですが、別の実装として、
田中です。
> 最初に言っておきますが、気を悪くされたのならすみません。
村田です.
[#34159] ruby-trunk Marshal.dump bug — nagachika <rucila@...>
nagachika と申します。
[#34163] Array#shift/unshift の高速化 — wanabe <s.wanabe@...>
ワナベと申します。
[#34189] Re: [ruby-cvs:23106] Re: Ruby:r15866 (trunk): * numeric.c (num_quo): should convert its operand to Rational. — Tadayoshi Funaba <tadf@...>
間違って送ったので、再送。
> > > Log:
[ruby-dev:34085] Re: rational, complex and mathn
なかだです。
At Sat, 15 Mar 2008 12:52:19 +0900,
Tadayoshi Funaba wrote in [ruby-dev:34060]:
> おそらく、明日作業します。石塚さんが rational.rb、complex.rb mathn.rb
> を公開されて以来、4121 日ぶりの大改訂になるのではないかと思います。
>
> おかしなところ、受け入れる側から見て気持の悪いところなどは、どんどん直
> してもらいたいと思います。最悪、何時でも revert できるのでやってしまい
> ます。
数値リテラルでは連続するアンダースコアは許されなくなっていますか
ら、ComplexやRationalでも揃えたほうがいいんじゃないでしょうか。
# インデントが他と違うのがちょっと気になるというのもあるけど。
Index: complex.c
===================================================================
--- complex.c (revision 15792)
+++ complex.c (working copy)
@@ -203,4 +203,5 @@ nucomp_s_canonicalize_internal(VALUE kla
}
+#if 0
static VALUE
nucomp_s_canonicalize(int argc, VALUE *argv, VALUE klass)
@@ -236,4 +237,5 @@ nucomp_s_canonicalize(int argc, VALUE *a
return nucomp_s_canonicalize_internal(klass, real, image);
}
+#endif
static VALUE
@@ -460,4 +462,5 @@ m_atan2_bang(VALUE y, VALUE x)
}
+#if 0
static VALUE
m_hypot(VALUE x, VALUE y)
@@ -467,4 +470,5 @@ m_hypot(VALUE x, VALUE y)
}
#endif
+#endif
static VALUE
@@ -627,4 +631,5 @@ nucomp_rdiv(VALUE self, VALUE other)
}
+#if 0
static VALUE
nucomp_fdiv(VALUE self, VALUE other)
@@ -636,4 +641,5 @@ nucomp_fdiv(VALUE self, VALUE other)
f_to_f(dat->image)), other);
}
+#endif
static VALUE
@@ -789,4 +795,5 @@ nucomp_conjugate(VALUE self)
}
+#if 0
static VALUE
nucomp_real_p(VALUE self)
@@ -813,4 +820,5 @@ nucomp_inexact_p(VALUE self)
return f_boolcast(!nucomp_exact_p(self));
}
+#endif
inline static long
@@ -979,15 +987,15 @@ nucomp_to_s(VALUE self)
else {
s = f_to_s(dat->real);
- rb_str_concat(s, rb_str_new2(!impos ? "-" : "+"));
+ rb_str_cat2(s, (!impos ? "-" : "+"));
}
if (k_rational_p(dat->image) &&
!f_one_p(f_denominator(dat->image))) {
- rb_str_concat(s, rb_str_new2("("));
+ rb_str_cat2(s, "(");
rb_str_concat(s, f_to_s(rezero ? dat->image : f_abs(dat->image)));
- rb_str_concat(s, rb_str_new2(")i"));
+ rb_str_cat2(s, ")i");
} else {
rb_str_concat(s, f_to_s(rezero ? dat->image : f_abs(dat->image)));
- rb_str_concat(s, rb_str_new2("i"));
+ rb_str_cat2(s, "i");
}
@@ -1004,7 +1012,7 @@ nucomp_inspect(VALUE self)
s = rb_str_new2("Complex(");
rb_str_concat(s, f_inspect(dat->real));
- rb_str_concat(s, rb_str_new2(", "));
+ rb_str_cat2(s, ", ");
rb_str_concat(s, f_inspect(dat->image));
- rb_str_concat(s, rb_str_new2(")"));
+ rb_str_cat2(s, ")");
return s;
@@ -1110,5 +1118,5 @@ numeric_to_c(VALUE self)
static VALUE comp_pat1, comp_pat2, a_slash, a_dot_and_an_e,
- image_garbages_pat, null_string, underscores_pat, an_underscore;
+ image_garbages_pat, null_string;
#define DIGITS "(?:\\d(?:_\\d|\\d)*)"
@@ -1123,13 +1131,13 @@ static void
make_patterns(void)
{
- static char *comp_pat1_source = PATTERN1;
- static char *comp_pat2_source = PATTERN2;
- static char *image_garbages_pat_source = "[+\\(\\)iIjJ]";
- static char *underscores_pat_source = "_+";
+ static const char comp_pat1_source[] = PATTERN1;
+ static const char comp_pat2_source[] = PATTERN2;
+ static const char image_garbages_pat_source[] = "[+\\(\\)iIjJ]";
+#define REG_NEW(s) rb_reg_new(s, sizeof(s) - 1, 0)
- comp_pat1 = rb_reg_new(comp_pat1_source, strlen(comp_pat1_source), 0);
+ comp_pat1 = REG_NEW(comp_pat1_source);
rb_global_variable(&comp_pat1);
- comp_pat2 = rb_reg_new(comp_pat2_source, strlen(comp_pat2_source), 0);
+ comp_pat2 = REG_NEW(comp_pat2_source);
rb_global_variable(&comp_pat2);
@@ -1140,6 +1148,5 @@ make_patterns(void)
rb_global_variable(&a_dot_and_an_e);
- image_garbages_pat = rb_reg_new(image_garbages_pat_source,
- strlen(image_garbages_pat_source), 0);
+ image_garbages_pat = REG_NEW(image_garbages_pat_source);
rb_global_variable(&image_garbages_pat);
@@ -1147,10 +1154,5 @@ make_patterns(void)
rb_global_variable(&null_string);
- underscores_pat = rb_reg_new(underscores_pat_source,
- strlen(underscores_pat_source), 0);
- rb_global_variable(&underscores_pat);
-
- an_underscore = rb_str_new2("_");
- rb_global_variable(&an_underscore);
+#undef REG_NEW
}
@@ -1247,6 +1249,5 @@ static VALUE
string_to_c(VALUE self)
{
- VALUE s = f_gsub(self, underscores_pat, an_underscore);
- VALUE a = string_to_c_internal(s);
+ VALUE a = string_to_c_internal(self);
if (!NIL_P(RARRAY_PTR(a)[0]))
return RARRAY_PTR(a)[0];
Index: rational.c
===================================================================
--- rational.c (revision 15792)
+++ rational.c (working copy)
@@ -231,4 +231,5 @@ nurat_s_canonicalize_internal(VALUE klas
}
+#if 0
static VALUE
nurat_s_canonicalize(int argc, VALUE *argv, VALUE klass)
@@ -260,4 +261,5 @@ nurat_s_canonicalize(int argc, VALUE *ar
return nurat_s_canonicalize_internal(klass, num, den);
}
+#endif
static VALUE
@@ -585,4 +587,5 @@ nurat_divmod(VALUE self, VALUE other)
}
+#if 0
static VALUE
nurat_quot(VALUE self, VALUE other)
@@ -590,4 +593,6 @@ nurat_quot(VALUE self, VALUE other)
return f_truncate(f_div(self, other));
}
+#endif
+
static VALUE
nurat_rem(VALUE self, VALUE other)
@@ -597,4 +602,5 @@ nurat_rem(VALUE self, VALUE other)
}
+#if 0
static VALUE
nurat_quotrem(VALUE self, VALUE other)
@@ -603,4 +609,5 @@ nurat_quotrem(VALUE self, VALUE other)
return rb_assoc_new(val, f_sub(self, f_mul(other, val)));
}
+#endif
static VALUE
@@ -613,4 +620,5 @@ nurat_abs(VALUE self)
}
+#if 0
static VALUE
nurat_true(VALUE self)
@@ -618,4 +626,5 @@ nurat_true(VALUE self)
return Qtrue;
}
+#endif
static VALUE
@@ -775,5 +784,5 @@ float_to_r(VALUE self)
}
-static VALUE rat_pat, an_e_pat, a_dot_pat, underscores_pat, an_underscore;
+static VALUE rat_pat, an_e_pat, a_dot_pat;
#define DIGITS "(?:\\d(?:_\\d|\\d)*)"
@@ -785,24 +794,19 @@ static void
make_patterns(void)
{
- static char *rat_pat_source = PATTERN;
- static char *an_e_pat_source = "[eE]";
- static char *a_dot_pat_source = "\\.";
- static char *underscores_pat_source = "_+";
+ static const char rat_pat_source[] = PATTERN;
+ static const char an_e_pat_source[] = "[eE]";
+ static const char a_dot_pat_source[] = "\\.";
+#define REG_NEW(s) rb_reg_new(s, sizeof(s) - 1, 0)
- rat_pat = rb_reg_new(rat_pat_source, strlen(rat_pat_source), 0);
+ rat_pat = REG_NEW(rat_pat_source);
rb_global_variable(&rat_pat);
- an_e_pat = rb_reg_new(an_e_pat_source, strlen(an_e_pat_source), 0);
+ an_e_pat = REG_NEW(an_e_pat_source);
rb_global_variable(&an_e_pat);
- a_dot_pat = rb_reg_new(a_dot_pat_source, strlen(a_dot_pat_source), 0);
+ a_dot_pat = REG_NEW(a_dot_pat_source);
rb_global_variable(&a_dot_pat);
- underscores_pat = rb_reg_new(underscores_pat_source,
- strlen(underscores_pat_source), 0);
- rb_global_variable(&underscores_pat);
-
- an_underscore = rb_str_new2("_");
- rb_global_variable(&an_underscore);
+#undef REG_NEW
}
@@ -909,6 +913,5 @@ static VALUE
string_to_r(VALUE self)
{
- VALUE s = f_gsub(self, underscores_pat, an_underscore);
- VALUE a = string_to_r_internal(s);
+ VALUE a = string_to_r_internal(self);
if (!NIL_P(RARRAY_PTR(a)[0]))
return RARRAY_PTR(a)[0];
--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦