Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
Limitations of eval
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Adelle Hartley, post: 4469811"] Hi all, I have been using eval to execute code fragments that I fetch from a database. Imagine my surprise when I discovered that the following does not work when executed by eval: unless thing.nil? puts "I have something" else puts "nothing here" end This works as expected when executed "properly" (from within a regular normal .rb file). I don't seem able to make any conditional code work correctly with eval, unless the conditinoal branch is a one liner: puts "I have something" unless thing.nil? Are the limitations of eval documented somewhere (or is it possible that I'm just not doing it right)? Adelle. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
Limitations of eval
Top