ruby-changes:26850
From: drbrain <ko1@a...>
Date: Wed, 23 Jan 2013 10:48:41 +0900 (JST)
Subject: [ruby-changes:26850] drbrain:r38902 (trunk): * doc/syntax/assignment.rdoc (Implicit Array Assignment): Clarify
drbrain 2013-01-23 10:41:37 +0900 (Wed, 23 Jan 2013) New Revision: 38902 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38902 Log: * doc/syntax/assignment.rdoc (Implicit Array Assignment): Clarify that "left-hand side" means "of the assignment". Suggested by Jorge Dias. * doc/syntax/assignment.rdoc (Multiple Assignment): ditto. Modified files: trunk/ChangeLog trunk/doc/syntax/assignment.rdoc Index: doc/syntax/assignment.rdoc =================================================================== --- doc/syntax/assignment.rdoc (revision 38901) +++ doc/syntax/assignment.rdoc (revision 38902) @@ -374,7 +374,7 @@ assigning. This is similar to multiple https://github.com/ruby/ruby/blob/trunk/doc/syntax/assignment.rdoc#L374 p a # prints [1, 2, 3] -You can splat anywhere in the left-hand side: +You can splat anywhere in the left-hand side of the assignment: a = 1, *[2, 3] @@ -408,14 +408,15 @@ You can use multiple assignment to swap https://github.com/ruby/ruby/blob/trunk/doc/syntax/assignment.rdoc#L408 p new_value: new_value, old_value: old_value # prints {:new_value=>1, :old_value=>2} -If you have more values on the left hand side than variables on the right hand -side the extra values are ignored: +If you have more values on the left hand side of the assignment than variables +on the right hand side the extra values are ignored: a, b = 1, 2, 3 p a: a, b: b # prints {:a=>1, :b=>2} -You can use <code>*</code> to gather extra values on the right-hand side. +You can use <code>*</code> to gather extra values on the right-hand side of +the assignment. a, *b = 1, 2, 3 Index: ChangeLog =================================================================== --- ChangeLog (revision 38901) +++ ChangeLog (revision 38902) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Jan 23 10:40:49 2013 Eric Hodel <drbrain@s...> + + * doc/syntax/assignment.rdoc (Implicit Array Assignment): Clarify + that "left-hand side" means "of the assignment". Suggested by Jorge + Dias. + * doc/syntax/assignment.rdoc (Multiple Assignment): ditto. + Wed Jan 23 10:34:47 2013 Eric Hodel <drbrain@s...> * doc/syntax/assignment.rdoc (Local Variables and Methods): Fixed -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/