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
Variable names
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Gavin Sinclair, post: 4427310"] Since what you want doesn't (to me) intuitively exist, I suggest rewriting it as: def print_line(lineNo, line) should_be(Integer, :lineNo) should_be(String, :line) ... def evaluate_local_variable(var) if local_variables.include? var eval var else raise ArgumentError, "You didn't give me a local variable: #{var}" end end You can probably improve on that, and write it in C, but you get the idea. Cheers, Gavin [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
Variable names
Top