defexampleeval("foo")# => nil, but would expect a NameErroreval("bar")# => NameErrorfoo=1end
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.
(1) parse example method and define foo.
(2) In eval method, compile given string ("foo") and defined foo was used (without any problem).
So it is documentation issue.
Can anyone write about it?
Attached is a documentation patch. However, a committer with more knowledge of the internals should probably check to see if it is technically accurate.