diff options
author | Jeremy Evans <[email protected]> | 2019-06-25 11:18:08 -0700 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2019-06-25 11:18:08 -0700 |
commit | 0f28094201d86d4bf8d5ecb6061abbbf5cea5076 (patch) | |
tree | 8fdb42b7b7a1510e1ec3872a43292699501345e4 /doc/syntax/assignment.rdoc | |
parent | 0aa8c3d88bb2f59bede47164a5da20600cce399e (diff) |
Improve wording of Local Variables and eval section
As pointed out by nobu, "defined" should be used instead of "assigned".
Diffstat (limited to 'doc/syntax/assignment.rdoc')
-rw-r--r-- | doc/syntax/assignment.rdoc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/syntax/assignment.rdoc b/doc/syntax/assignment.rdoc index 2e2661c7a3..7361b7d3bd 100644 --- a/doc/syntax/assignment.rdoc +++ b/doc/syntax/assignment.rdoc @@ -111,14 +111,14 @@ method. == Local Variables and eval -Using +eval+ to evaluate Ruby code will allow access to local variables in -the same scope, even if the local variables are not assigned until after the -call to +eval+. However, local variables assigned inside the call to +eval+ +Using +eval+ to evaluate Ruby code will allow access to local variables defined +in the same scope, even if the local variables are not defined until after the +call to +eval+. However, local variables defined inside the call to +eval+ will not be reflected in the surrounding scope. Inside the call to +eval+, -local variables in the scope and local variables assigned inside the call to -+eval+ will be accessible. However, you will not be able to access local -variables assigned in previous or subsequent calls to +eval+ in the same -scope. Consider each +eval+ call a separate nested scope. Example: +local variables defined in the surrounding scope and local variables defined +inside the call to +eval+ will be accessible. However, you will not be able +to access local variables defined in previous or subsequent calls to +eval+ in +the same scope. Consider each +eval+ call a separate nested scope. Example: def m eval "bar = 1" |