Hi, At Fri, 20 Jun 2003 19:25:57 +0900, ts wrote: > You have the same with > > class A > def to_str > String.new(nil.to_s) > end > end > a = "a" > b = A.new > a.send(b) I missed the same code just below. # And I was complained about the message by unak.
Index: object.c =================================================================== RCS file: /cvs/ruby/src/ruby/object.c,v retrieving revision 1.119 diff -u -2 -p -r1.119 object.c --- object.c 26 May 2003 08:22:28 -0000 1.119 +++ object.c 20 Jun 2003 10:42:33 -0000 @@ -789,5 +789,5 @@ rb_to_id(name) switch (TYPE(name)) { case T_STRING: - return rb_intern(RSTRING(name)->ptr); + return rb_str_intern(name); case T_FIXNUM: rb_warn("do not use Fixnums as Symbols"); @@ -803,5 +803,5 @@ rb_to_id(name) tmp = rb_check_string_type(name); if (!NIL_P(tmp)) { - return rb_intern(RSTRING(tmp)->ptr); + return rb_str_intern(tmp); } rb_raise(rb_eTypeError, "%s is not a symbol", RSTRING(rb_inspect(name))->ptr); Index: string.c =================================================================== RCS file: /cvs/ruby/src/ruby/string.c,v retrieving revision 1.156 diff -u -2 -p -r1.156 string.c --- string.c 26 May 2003 08:22:28 -0000 1.156 +++ string.c 20 Jun 2003 10:29:32 -0000 @@ -3073,5 +3073,5 @@ rb_str_intern(str) if (!RSTRING(str)->ptr || RSTRING(str)->len == 0) { - rb_raise(rb_eArgError, "interning empty string"); + rb_raise(rb_eArgError, "symbol string may not be empty"); } if (strlen(RSTRING(str)->ptr) != RSTRING(str)->len)
-- Nobu Nakada