ruby-changes:35494
From: nobu <ko1@a...>
Date: Sat, 13 Sep 2014 22:19:36 +0900 (JST)
Subject: [ruby-changes:35494] nobu:r47576 (trunk): hash.c: [DOC] fix for Hash#store docs
nobu 2014-09-13 22:19:27 +0900 (Sat, 13 Sep 2014) New Revision: 47576 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47576 Log: hash.c: [DOC] fix for Hash#store docs * hash.c (rb_hash_aset): fix misleading example which may suggest that Hash.store will return self instead of value - Hash#store is returning value and update itself, as well as Hash#[]=. [Fix GH-715] Modified files: trunk/ChangeLog trunk/hash.c Index: ChangeLog =================================================================== --- ChangeLog (revision 47575) +++ ChangeLog (revision 47576) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Sep 13 22:19:26 2014 Bernard Potocki <bernard.potocki@i...> + + * hash.c (rb_hash_aset): fix misleading example which may suggest + that Hash.store will return self instead of value - Hash#store + is returning value and update itself, as well as Hash#[]=. + [Fix GH-715] + Sat Sep 13 15:16:31 2014 Eric Wong <e@8...> * class.c: use ALLOC(rb_subclass_entry_t) Index: hash.c =================================================================== --- hash.c (revision 47575) +++ hash.c (revision 47576) @@ -1366,7 +1366,8 @@ NOINSERT_UPDATE_CALLBACK(hash_aset_str); https://github.com/ruby/ruby/blob/trunk/hash.c#L1366 * h["a"] = 9 * h["c"] = 4 * h #=> {"a"=>9, "b"=>200, "c"=>4} - * h.store("d", 42) #=> {"a"=>9, "b"=>200, "c"=>4, "d"=>42} + * h.store("d", 42) #=> 42 + * h #=> {"a"=>9, "b"=>200, "c"=>4, "d"=>42} * * +key+ should not have its value changed while it is in use as a key (an * <tt>unfrozen String</tt> passed as a key will be duplicated and frozen). -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/