From: merch-redmine@... Date: 2019-06-25T17:59:00+00:00 Subject: [ruby-core:93363] [Ruby trunk Bug#13337] Eval and Later Defined Local Variables Issue #13337 has been updated by jeremyevans0 (Jeremy Evans). nobu (Nobuyoshi Nakada) wrote: > "local variables assigned inside the call to +eval+" sounds like a just assignment to a local variable defined outside, doesn't it? It could definitely be interpreted that way. I'll reword it to make it more clear. Thanks! ---------------------------------------- Bug #13337: Eval and Later Defined Local Variables https://bugs.ruby-lang.org/issues/13337#change-78878 * Author: faraz (Faraz Yashar) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: 2.4.0 * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- I've noticed the following behavior with eval: ~~~ ruby def example eval("foo") # => nil, but would expect a NameError eval("bar") # => NameError foo = 1 end ~~~ I'm assuming this behavior is expected, since "eval" executes in the context of the existing YARV instructions and local table, but I'm not certain since I haven't seen this behavior documented anywhere. ---Files-------------------------------- doc-eval-local-var.patch (1.63 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: