-
I am implementing a REPL and want to keep local variables between calls to eval. I've looked at mirb and tried to do what it does, but I get a crash, maybe because I'm initiating the call from ruby instead of C, so I guess I call vm exec recursively ? I also looked at eval.c but it's more complex (maybe because it needs to work when called from ruby). Any help appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Show me the code, please. |
Beta Was this translation helpful? Give feedback.
-
Probably you can use b = binding
b.eval "a=12"
b.eval "p a" # => 12 Don't forget to include |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
Probably you can use
mruby-binding
gem (#5362, #5491).Don't forget to include
mruby-binding
gem when build.