ruby-changes:29865
From: zzak <ko1@a...>
Date: Thu, 11 Jul 2013 14:51:35 +0900 (JST)
Subject: [ruby-changes:29865] zzak:r41917 (trunk): * array.c: Replace confusing example for #reverse_each in overview
zzak 2013-07-11 14:51:19 +0900 (Thu, 11 Jul 2013) New Revision: 41917 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41917 Log: * array.c: Replace confusing example for #reverse_each in overview Patch by Earl St Sauver [Fixes documenting-ruby/ruby-12] https://github.com/documenting-ruby/ruby/pull/12 Modified files: trunk/ChangeLog trunk/array.c Index: array.c =================================================================== --- array.c (revision 41916) +++ array.c (revision 41917) @@ -5406,10 +5406,10 @@ rb_ary_drop_while(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L5406 * Another sometimes useful iterator is #reverse_each which will iterate over * the elements in the array in reverse order. * - * words = %w[rats live on no evil star] + * words = %w[first second third fourth fifth sixth] * str = "" - * words.reverse_each { |word| str += "#{word.reverse} " } - * str #=> "rats live on no evil star " + * words.reverse_each { |word| str += "#{word} " } + * p str #=> "sixth fifth fourth third second first " * * The #map method can be used to create a new array based on the original * array, but with the values modified by the supplied block: Index: ChangeLog =================================================================== --- ChangeLog (revision 41916) +++ ChangeLog (revision 41917) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Jul 11 14:48:35 2013 Zachary Scott <e@z...> + + * array.c: Replace confusing example for #reverse_each in overview + Patch by Earl St Sauver [Fixes documenting-ruby/ruby-12] + https://github.com/documenting-ruby/ruby/pull/12 + Thu Jul 11 14:22:37 2013 Zachary Scott <e@z...> * test/drb/ut_eq.rb: Use localhost for drb tests [Bug #7311] -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/