diff options
author | Nobuyoshi Nakada <[email protected]> | 2022-04-25 23:49:58 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2022-04-25 23:50:49 +0900 |
commit | 5701b4084e7bdcd64b6a940c95d41888734f5ca6 (patch) | |
tree | 1719f8c96747f4748a1cc7f71f7e6f8063443fb8 /doc/syntax/assignment.rdoc | |
parent | 45cf4f218728a15eb36d14a6c9912086525f5e3f (diff) |
[DOC] mention assignment expression values
Diffstat (limited to 'doc/syntax/assignment.rdoc')
-rw-r--r-- | doc/syntax/assignment.rdoc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/syntax/assignment.rdoc b/doc/syntax/assignment.rdoc index a1806e4c48..1321bbf3ac 100644 --- a/doc/syntax/assignment.rdoc +++ b/doc/syntax/assignment.rdoc @@ -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 |