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

ruby-changes:33390

From: ktsj <ko1@a...>
Date: Sun, 30 Mar 2014 17:10:11 +0900 (JST)
Subject: [ruby-changes:33390] ktsj:r45469 (trunk): * parse.y (rb_str_dynamic_intern): [DOC] move rdoc from rb_str_intern.

ktsj	2014-03-30 17:10:04 +0900 (Sun, 30 Mar 2014)

  New Revision: 45469

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45469

  Log:
    * parse.y (rb_str_dynamic_intern): [DOC] move rdoc from rb_str_intern.

  Modified files:
    trunk/parse.y
    trunk/string.c
Index: string.c
===================================================================
--- string.c	(revision 45468)
+++ string.c	(revision 45469)
@@ -7418,26 +7418,6 @@ rb_str_crypt(VALUE str, VALUE salt) https://github.com/ruby/ruby/blob/trunk/string.c#L7418
 }
 
 
-/*
- *  call-seq:
- *     str.intern   -> symbol
- *     str.to_sym   -> symbol
- *
- *  Returns the <code>Symbol</code> corresponding to <i>str</i>, creating the
- *  symbol if it did not previously exist. See <code>Symbol#id2name</code>.
- *
- *     "Koala".intern         #=> :Koala
- *     s = 'cat'.to_sym       #=> :cat
- *     s == :cat              #=> true
- *     s = '@cat'.to_sym      #=> :@cat
- *     s == :@cat             #=> true
- *
- *  This can also be used to create symbols that cannot be represented using the
- *  <code>:xxx</code> notation.
- *
- *     'cat and dog'.to_sym   #=> :"cat and dog"
- */
-
 VALUE
 rb_str_intern(VALUE s)
 {
Index: parse.y
===================================================================
--- parse.y	(revision 45468)
+++ parse.y	(revision 45469)
@@ -10676,6 +10676,26 @@ rb_gc_free_dsymbol(VALUE ptr) https://github.com/ruby/ruby/blob/trunk/parse.y#L10676
     RSYMBOL(ptr)->fstr = (VALUE)NULL;
 }
 
+/*
+ *  call-seq:
+ *     str.intern   -> symbol
+ *     str.to_sym   -> symbol
+ *
+ *  Returns the <code>Symbol</code> corresponding to <i>str</i>, creating the
+ *  symbol if it did not previously exist. See <code>Symbol#id2name</code>.
+ *
+ *     "Koala".intern         #=> :Koala
+ *     s = 'cat'.to_sym       #=> :cat
+ *     s == :cat              #=> true
+ *     s = '@cat'.to_sym      #=> :@cat
+ *     s == :@cat             #=> true
+ *
+ *  This can also be used to create symbols that cannot be represented using the
+ *  <code>:xxx</code> notation.
+ *
+ *     'cat and dog'.to_sym   #=> :"cat and dog"
+ */
+
 VALUE
 rb_str_dynamic_intern(VALUE str)
 {

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

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