[前][次][番号順一覧][スレッド一覧]

ruby-changes:4729

From: ko1@a...
Date: Mon, 28 Apr 2008 11:12:40 +0900 (JST)
Subject: [ruby-changes:4729] matz - Ruby:r16223 (trunk): * proc.c (method_name): should return symbols instead of strings.

matz	2008-04-28 11:12:21 +0900 (Mon, 28 Apr 2008)

  New Revision: 16223

  Modified files:
    trunk/ChangeLog
    trunk/proc.c
    trunk/test/ruby/test_m17n.rb
    trunk/test/ruby/test_method.rb
    trunk/version.h

  Log:
    * proc.c (method_name): should return symbols instead of strings.
      [ruby-dev:34531]

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/version.h?r1=16223&r2=16222&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16223&r2=16222&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/proc.c?r1=16223&r2=16222&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_method.rb?r1=16223&r2=16222&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_m17n.rb?r1=16223&r2=16222&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 16222)
+++ ChangeLog	(revision 16223)
@@ -1,3 +1,8 @@
+Mon Apr 28 11:11:38 2008  Yukihiro Matsumoto  <matz@r...>
+
+	* proc.c (method_name): should return symbols instead of strings.
+	  [ruby-dev:34531]
+
 Mon Apr 28 09:02:43 2008  Tanaka Akira  <akr@f...>
 
 	* include/ruby/intern.h (rb_exec_arg_init): declared.
Index: proc.c
===================================================================
--- proc.c	(revision 16222)
+++ proc.c	(revision 16223)
@@ -905,7 +905,7 @@
 
 /*
  *  call-seq:
- *     meth.name    => string
+ *     meth.name    => symbol
  *  
  *  Returns the name of the method.
  */
@@ -916,7 +916,7 @@
     struct METHOD *data;
 
     Data_Get_Struct(obj, struct METHOD, data);
-    return rb_str_dup(rb_id2str(data->id));
+    return ID2SYM(data->id);
 }
 
 /*
Index: version.h
===================================================================
--- version.h	(revision 16222)
+++ version.h	(revision 16223)
@@ -1,7 +1,7 @@
 #define RUBY_VERSION "1.9.0"
-#define RUBY_RELEASE_DATE "2008-04-27"
+#define RUBY_RELEASE_DATE "2008-04-28"
 #define RUBY_VERSION_CODE 190
-#define RUBY_RELEASE_CODE 20080427
+#define RUBY_RELEASE_CODE 20080428
 #define RUBY_PATCHLEVEL 0
 
 #define RUBY_VERSION_MAJOR 1
@@ -9,7 +9,7 @@
 #define RUBY_VERSION_TEENY 0
 #define RUBY_RELEASE_YEAR 2008
 #define RUBY_RELEASE_MONTH 4
-#define RUBY_RELEASE_DAY 27
+#define RUBY_RELEASE_DAY 28
 
 #ifdef RUBY_EXTERN
 RUBY_EXTERN const char ruby_version[];
Index: test/ruby/test_m17n.rb
===================================================================
--- test/ruby/test_m17n.rb	(revision 16222)
+++ test/ruby/test_m17n.rb	(revision 16223)
@@ -1041,8 +1041,8 @@
      mu = method(u("\xc2\xa1"))
      assert_not_equal(me.name, mu.name)
      assert_not_equal(me.inspect, mu.inspect)
-     assert_equal(e("\xc2\xa1"), me.name)
-     assert_equal(u("\xc2\xa1"), mu.name)
+     assert_equal(e("\xc2\xa1"), me.name.to_s)
+     assert_equal(u("\xc2\xa1"), mu.name.to_s)
   end
 
   def test_symbol
Index: test/ruby/test_method.rb
===================================================================
--- test/ruby/test_method.rb	(revision 16222)
+++ test/ruby/test_method.rb	(revision 16223)
@@ -107,7 +107,7 @@
     def o.foo; end
     m = o.method(:foo)
     assert_equal(o, m.receiver)
-    assert_equal("foo", m.name)
+    assert_equal(:foo, m.name)
     assert_equal(class << o; self; end, m.owner)
   end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]