[#34011] Should --verbose be equal to -v ? — Yugui <yugui@...>

Yuguiです。

15 messages 2008/03/10
[#34012] Re: Should --verbose be equal to -v ? — Yukihiro Matsumoto <matz@...> 2008/03/10

まつもと ゆきひろです

[#34105] rational.rb, complex.rb and mathn.rb — Tadayoshi Funaba <tadf@...>

rational と complex が組み込みになったことで、lib/mathn.rb の意義は薄

29 messages 2008/03/22
[#34106] Re: rational.rb, complex.rb and mathn.rb — Tadayoshi Funaba <tadf@...> 2008/03/22

現時点で rational.rb と complex.rb を残しているのは、それが無難だから

[#34107] Re: rational.rb, complex.rb and mathn.rb — Tadayoshi Funaba <tadf@...> 2008/03/22

で、かなり選択肢を絞った叩き台です。

[#34120] Re: rational.rb, complex.rb and mathn.rb — keiju@... (石塚圭樹) 2008/03/24

けいじゅ@いしつかです.

[#34125] Re: rational.rb, complex.rb and mathn.rb — Shin-ichiro HARA <sinara@...> 2008/03/25

原です。

[#34130] Re: rational.rb, complex.rb and mathn.rb — Tadayoshi Funaba <tadf@...> 2008/03/25

> 私も Complex の組み込みは Rational とは比較にならないくらい、仕様が決め

[#34158] Complex組み込み — Masahiro TANAKA <masa16.tanaka@...>

Complexが組み込みになるそうですが、これはcomplex.rbを踏襲して、

49 messages 2008/03/27
[#34161] Re: Complex組み込み — Shin-ichiro HARA <sinara@...> 2008/03/28

原です。

[#34168] Re: Complex組み込み — Tadayoshi Funaba <tadf@...> 2008/03/28

> 今までの Complex は、complex.rb にほぼ残して、たとえば Rational 成分

[#34186] Re: Complex組み込み — Shin-ichiro HARA <sinara@...> 2008/03/31

原です。

[#34187] Re: Complex組み込み — Tadayoshi Funaba <tadf@...> 2008/03/31

> そうです。Complex が難しい、という話を書いておくと、

[#34193] Re: Complex組み込み — Yukihiro Matsumoto <matz@...> 2008/03/31

まつもと ゆきひろです

[#34203] Re: Complex組み込み — Tadayoshi Funaba <tadf@...> 2008/04/01

> |僕としては、/ 演算子の振舞いについて前向きに検討してほしいです。

[#34215] Re: Complex組み込み — Yukihiro Matsumoto <matz@...> 2008/04/02

まつもと ゆきひろです

[#34166] Re: Complex組み込み — Tadayoshi Funaba <tadf@...> 2008/03/28

> となるようですが、別の実装として、

[ruby-dev:33966] Re: [ruby-cvs:22881] Ruby:r15644 (trunk): * test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_chomp): test

From: Tanaka Akira <akr@...>
Date: 2008-03-03 04:38:04 UTC
List: ruby-dev #33966
In article <200802291457.m1TEv6nh008515@ci.ruby-lang.org>,
  matz@ruby-lang.org writes:

> matz	2008-02-29 23:57:04 +0900 (Fri, 29 Feb 2008)
>
>   New Revision: 15644
>
>   Modified files:
>     trunk/ChangeLog
>     trunk/string.c
>     trunk/test/ruby/test_m17n_comb.rb
>
>   Log:
>     * test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_chomp): test
>       updated.
>
>   http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_m17n_comb.rb?r1=15644&r2=15643&diff_format=u
>   http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/string.c?r1=15644&r2=15643&diff_format=u
>   http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15644&r2=15643&diff_format=u

この変更で、test_m17n_comb.rb の test_str_sub と
test_str_sub! に assert(false, "test broken") というコードが
入れられて、test broken とされましたが、これはどのように壊れ
ているのでしょうか?

この assert を取り除くと
"\x80".force_encoding("ASCII-8BIT").sub(Regexp.new("\x80".force_encoding("ASCII-8BIT")),"\xC2\x80".force_encoding("UTF-8"))
と
t="\x80".force_encoding("ASCII-8BIT").dup;t.sub!(Regexp.new("\x80".force_encoding("ASCII-8BIT")),"\xC2\x80".force_encoding("UTF-8")).
で例外が発生する失敗が表れますが、これらは引数も結果も単一の
エンコーディングで表現できる文字列しか表れないので、成功して
もおかしくないはずです。

実際、sub の第二引数のかわりにブロックを用いて同じことを行う
と、そっちは成功します。

"\x80".force_encoding("ASCII-8BIT").sub(Regexp.new("\x80".force_encoding("ASCII-8BIT"))) { "\xC2\x80".force_encoding("UTF-8") }
t="\x80".force_encoding("ASCII-8BIT").dup;t.sub!(Regexp.new("\x80".force_encoding("ASCII-8BIT"))) { "\xC2\x80".force_encoding("UTF-8") }

また、このテストはまつもとさんが r15640 の変更を行うまでは成
功していました。

http://www.rubyist.net/~akr/chkbuild/debian-sarge/ruby-trunk/log/20080229T201901.diff.txt.gz

失敗するのが正しいとするなら、理由はなんですか?
その理由はブロック形式には適用されませんか?
-- 
[田中 哲][たなか あきら][Tanaka Akira]

In This Thread

Prev Next