ruby-changes:46955
From: k0kubun <ko1@a...>
Date: Mon, 12 Jun 2017 20:09:16 +0900 (JST)
Subject: [ruby-changes:46955] k0kubun:r59070 (trunk): array.c: [DOC] Make it clear that #<< modifies receiver
k0kubun 2017-06-12 20:09:10 +0900 (Mon, 12 Jun 2017) New Revision: 59070 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59070 Log: array.c: [DOC] Make it clear that #<< modifies receiver This patch is sent from @selmertsx (morioka shuhei). [fix GH-1646] Modified files: trunk/array.c Index: array.c =================================================================== --- array.c (revision 59069) +++ array.c (revision 59070) @@ -910,7 +910,10 @@ ary_take_first_or_last(int argc, const V https://github.com/ruby/ruby/blob/trunk/array.c#L910 * expression returns the array itself, so several appends * may be chained together. * - * [ 1, 2 ] << "c" << "d" << [ 3, 4 ] + * a = [ 1, 2 ] + * a << "c" << "d" << [ 3, 4 ] + * #=> [ 1, 2, "c", "d", [ 3, 4 ] ] + * a * #=> [ 1, 2, "c", "d", [ 3, 4 ] ] * */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/