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

ruby-changes:28627

From: zzak <ko1@a...>
Date: Mon, 13 May 2013 10:31:38 +0900 (JST)
Subject: [ruby-changes:28627] zzak:r40679 (trunk): * hash.c: Hash[] and {} are not equivalent by @eam [Fixes GH-301]

zzak	2013-05-13 10:31:27 +0900 (Mon, 13 May 2013)

  New Revision: 40679

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

  Log:
    * hash.c: Hash[] and {} are not equivalent by @eam [Fixes GH-301]

  Modified files:
    trunk/ChangeLog
    trunk/hash.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40678)
+++ ChangeLog	(revision 40679)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon May 13 10:30:04 2013  Zachary Scott  <zachary@z...>
+
+	* hash.c: Hash[] and {} are not equivalent by @eam [Fixes GH-301]
+
 Mon May 13 10:04:22 2013  Zachary Scott  <zachary@z...>
 
 	* random.c: Document Random::DEFAULT by @eLobato [Fixes GH-304]
Index: hash.c
===================================================================
--- hash.c	(revision 40678)
+++ hash.c	(revision 40679)
@@ -375,11 +375,14 @@ rb_hash_initialize(int argc, VALUE *argv https://github.com/ruby/ruby/blob/trunk/hash.c#L375
  *     Hash[ [ [key, value], ... ] ]   -> new_hash
  *     Hash[ object ]                  -> new_hash
  *
- *  Creates a new hash populated with the given objects. Equivalent to
- *  the literal <code>{ <i>key</i> => <i>value</i>, ... }</code>. In the first
- *  form, keys and values occur in pairs, so there must be an even number of arguments.
- *  The second and third form take a single argument which is either
- *  an array of key-value pairs or an object convertible to a hash.
+ *  Creates a new hash populated with the given objects.
+ *
+ *  Similar to the literal <code>{ _key_ => _value_, ... }</code>. In the first
+ *  form, keys and values occur in pairs, so there must be an even number of
+ *  arguments.
+ *
+ *  The second and third form take a single argument which is either an array
+ *  of key-value pairs or an object convertible to a hash.
  *
  *     Hash["a", 100, "b", 200]             #=> {"a"=>100, "b"=>200}
  *     Hash[ [ ["a", 100], ["b", 200] ] ]   #=> {"a"=>100, "b"=>200}

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

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