[#43284] [Ruby 1.9 - Bug #4456] [Open] Time#strftime で %F 指定子に大きな幅を指定した際の不具合 — tadayoshi funaba <redmine@...>
14 messages
2011/03/02
[#44141] [Ruby 1.9 - Bug #4456] Time#strftime で %F 指定子に大きな幅を指定した際の不具合
— Masaya Tarui <tarui@...>
2011/07/17
[#44142] Re: [Ruby 1.9 - Bug #4456] Time#strftime で %F 指定子に大きな幅を指定した際の不具合
— Masaya TARUI <tarui@...>
2011/07/17
非常に重要な所が抜けてました。
[#43285] [Ruby 1.9 - Bug #4457] [Open] Time#strftime で %z 指定子などに大きな幅を指定した際の不具合 — tadayoshi funaba <redmine@...>
6 messages
2011/03/02
[#43296] [Ruby 1.9 - Bug #3990] [Assigned]tests of rexml/rss reports many errors and failures without iconv — Yui NARUSE <redmine@...>
5 messages
2011/03/03
[#43297] Re: [Ruby 1.9 - Bug #3990] [Assigned]tests of rexml/rss reports many errors and failures without iconv
— SASADA Koichi <ko1@...>
2011/03/03
(2011/03/03 18:56), Yui NARUSE wrote:
[#43298] Re: [Ruby 1.9 - Bug #3990] [Assigned]tests of rexml/rss reports many errors and failures without iconv
— "U.Nakamura" <usa@...>
2011/03/03
こんにちは、なかむら(う)です。
[#43317] [Ruby 1.9 - Bug #4474][Open] 複数のスレッドからトランザクションに入ろうとした場合のPStoreの挙動 — Masaki Matsushita <redmine@...>
9 messages
2011/03/06
[#43346] [BUG] lib/irb/locale.rb — keiju@... (Keiju ISHITSUKA)
けいじゅ@いしつかです.
8 messages
2011/03/24
[#43347] Re: [BUG] lib/irb/locale.rb
— Yugui <yugui@...>
2011/03/24
2011/3/24 Keiju ISHITSUKA <[email protected]>:
[#43355] [Ruby 1.9 - Feature #4529][Assigned] date_core と long 型 — Yui NARUSE <redmine@...>
10 messages
2011/03/25
[#43359] [Ruby 1.9 - Feature #4529][Rejected] date_core と long 型
— tadayoshi funaba <redmine@...>
2011/03/26
[#43360] Re: [ruby-dev:43359] [Ruby 1.9 - Feature #4529][Rejected] date_core と long 型
— "NARUSE, Yui" <naruse@...>
2011/03/26
(2011/03/26 19:21), tadayoshi funaba wrote:
[#43365] [Ruby 1.9 - Bug #4536][Open] 定数参照について1.8と1.9の違い — Yukihiro Matsumoto <matz@...>
11 messages
2011/03/29
[#43366] Re: [ruby-dev:43365] [Ruby 1.9 - Bug #4536][Open] 定数参照について1.8と1.9の違い
— SASADA Koichi <ko1@...>
2011/03/29
ささだです.
[ruby-dev:43307] [Ruby 1.9 - Feature #4468] String() should call to_str before to_s
From:
Tomoyuki Chikanaga <nagachika00@...>
Date:
2011-03-05 13:05:02 UTC
List:
ruby-dev #43307
Issue #4468 has been updated by Tomoyuki Chikanaga.
パッチを貼り忘れていました。このようになるかと思います。
diff --git a/object.c b/object.c
index b25c0af..fad726c 100644
--- a/object.c
+++ b/object.c
@@ -2360,7 +2360,10 @@ rb_num2dbl(VALUE val)
VALUE
rb_String(VALUE val)
{
- return rb_convert_type(val, T_STRING, "String", "to_s");
+ VALUE tmp = rb_check_string_type(val);
+ if (NIL_P(tmp))
+ tmp = rb_convert_type(val, T_STRING, "String", "to_s");
+ return tmp;
}
----------------------------------------
Feature #4468: String() should call to_str before to_s
http://redmine.ruby-lang.org/issues/4468
Author: Tomoyuki Chikanaga
Status: Open
Priority: Normal
Assignee:
Category: core
Target version: 1.9.3
Integer() と Array() というカーネルメソッドはまず to_int/to_ary という
「暗黙の変換」のためのメソッドを呼び、それが失敗すると to_i/to_a を
呼んで変換するという仕様になっています。
しかし String() は最初から to_s を呼ぶようになっています。
統一感という意味ではまず to_str -> to_s の順に呼ぶことにしたほうが
良いのではないでしょうか。
to_str と to_s が異なる文字列を返すようなケースは思い浮ばないので、
実際にこれで結果が変化することはないのではないかと推測します。
--
http://redmine.ruby-lang.org