RBX Question

I see only difference is the there is no local variable concept when run
in interpreter mode.
Is this correct?
Thanks.
Unni

What is the difference in running ruby code in interpreter mode on
rbxand running rbx with ruby code in a file passed as a parameter?

Unnikrishnan N. writes:

I see only difference is the there is no local variable concept when run in interpreter mode. Is this correct?

Yes, currently local variables don’t work in rbx when running it
interactively. The work to fix this is being done, though John/Tomas can
chime in here about how close they are.

What is the difference in running ruby code in interpreter mode on rbx and running rbx with ruby code in a file passed as a parameter?

It revolves around getting ruby Binding working properly. Here’s a good
explanation of binding:
http://onestepback.org/index.cgi/Tech/Ruby/RubyBindings.rdoc/style/print

Binding lets you evaluate a block against an arbitrary scope. With a
file, you use the same scope to execute the top-level code. However a
console requires you to execute each line against the console’s scope.

Methods, instance variables, and globals work without binding because
they are implicitly declared on Object in some form or another, but
local variables are defined in the binding.

Does that help clear things up?

~Jimmy

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs