Examples without using a Block #39
Unanswered
stellarpower
asked this question in
General
Replies: 2 comments
-
You can simply use something like this: # This will be your interpreter variable, similar to the one yielded by the block.
# Store it anywhere you like - you could also put this in a class, for example.
rb = Anyolite::RbInterpreter.new
# Only if you need Regexes or pointer wrappers in mruby - otherwise, you can just skip this line.
Anyolite::HelperClasses.load_all(rb)
# Your code:
# ...
# Close it at the end.
rb.close I will add this into the wiki, thanks for the suggestion. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Interesting, that was what I was doing. Thanks for clarifying. I will see if I can pin down why it was hanging. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Would it be possible to get an example of using Anyolite without running inside a block for the interpreter?
I see in the documentation
So sounds that it's possible, could we see an example of this somewhere?
My code appears to be locking up. The design of this is not too trivial, so am wondering if I am using Anyolite correctly - so far, my own code includes a class with a singleton instance, and this then has an instance member for the RBInterpreter. In the constructor I read in some of my code, and then in the methods I would call
Anyolite::eval
to query the functions defined in Ruby.Thanks
Beta Was this translation helpful? Give feedback.
All reactions