Details
-
Type:
New Feature
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.7.0.pre2
-
Fix Version/s: JRuby 1.7.0.RC1
-
Component/s: Core Classes/Modules, Embedding, Java Integration, Parser
-
Labels:None
-
Number of attachments :
Description
This is a case from Ruboto, but research shows it surfaces regularly. How can I send a block of Ruby code to a Java receiver without using a direct reference?
We can send the code as a string, and that is ok, but the code is then not parsed and analysed for syntax and semantic errors in the editor or the runtime.
We do not need the local binding in our case. We only use it to define methods on the receiving end.
The initial naive effort was to serialize RubyProc. Is that viable?
Any ideas?
For the original problem, we have gone another way, so serialization is not necessary. However, during research we found these prior efforts, and we did develop a solution for getting the source of a proc based on Florian's code.
http://ruby.11.n6.nabble.com/Ruby-Serialization-td3449703.html
http://www.rubyquiz.com/quiz38.html
Our solution did not include local binding but was fully sufficient for solving the problem.