Hi Anders,

Thanks. I will let you know my test result on JRuby. BTW, I'm also very
interested in your effort of trying to compile ruby into Java Byte Code.
Is it under development now? And how about compile Ruby into Java SOURCE
code?

I look forward to see greate success of JRuby, and Ruby itself. I do
hope that Ruby is widely accepted in commercial environment. It can
drastically improve efficiency and produce bug-less and easy
maintainable code...

Shannon

On Fri, 13 Dec 2002 05:11:02 +0900
Anders Bengtsson <ndrsbngtssn / yahoo.se> wrote:

> Shannon Fang wrote:
> 
> > Although the document mentioned that JRuby enables you to embed a ruby 
> > interpreter into your java application, I have not seen any document or 
> > samples on this. Could any one give me a hint? Preferrably several line of 
> > code to get a look and fee.
> 
> Hi Shannon,
> 
> We're a little short on documentation in some areas on JRuby. But it's
> pretty easy to embed the JRuby interpreter. Something like this (beware,
> untested):
> 
> Ruby runtime = org.jruby.Ruby.getDefaultInstance();
> runtime.evalScript("puts 1 + 2");
> 
> That's about it. You can also pass in a stream of Ruby source instead,
> to evaluate bigger scripts. The docs on JRuby's Java support should be
> able to help you with the rest.
> 
> You may be able to find someone with some more interesting sample code
> on the jruby-user mailing list.
> By the way, we would be grateful if someone gave us a good sample
> application that embeds JRuby to distribute with our sample code.
> 
> /Anders - your friendly neighborhood JRuby developer
> 
> -- 
> 
> A n d e r s  B e n g t s s o n  |  ndrsbngtssn / yahoo.se
> Stockholm, Sweden               |
> 
> _____________________________________________________
> Gratis e-mail resten av livet p~{e ~}www.yahoo.se/mail
> Busenkelt!