mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[DOC] mention assignment expression values
This commit is contained in:
parent
45cf4f2187
commit
5701b4084e
1 changed files with 6 additions and 0 deletions
|
@ -8,6 +8,9 @@ example assigns the number five to the local variable +v+:
|
|||
Assignment creates a local variable if the variable was not previously
|
||||
referenced.
|
||||
|
||||
An assignment expression result is always the assigned value, including
|
||||
{assignment methods}[rdoc-ref:syntax/assignment.rdoc@Assignment+Methods].
|
||||
|
||||
== Local Variable Names
|
||||
|
||||
A local variable name must start with a lowercase US-ASCII letter or a
|
||||
|
@ -342,6 +345,9 @@ This prints:
|
|||
local_variables:
|
||||
@value: 42
|
||||
|
||||
Note that the value returned by an assignment method is ignored whatever,
|
||||
since an assignment expression result is always the assignment value.
|
||||
|
||||
== Abbreviated Assignment
|
||||
|
||||
You can mix several of the operators and assignment. To add 1 to an object
|
||||
|
|
Loading…
Reference in a new issue