[ruby-talk:00250] embedding ruby, is there any example?

From: Mathowiz@...
Date: 1999-03-11 02:39:47 UTC
List: ruby-talk #250
I can't find any example of how to embed ruby in c application. I really
appreciate
if any one can give me some advice.

Specifically, I have a c application in which I want to be able to evaluate an
arbitrary
run-time expression string (in c).  Example expr-string like: 
   "z = xxx + sin(yyy); z", where xxx and yyy are variables in c's
environment.  That
means I need put xxx, yyy etc into ruby environment. 

In short, I am looking for a way to write a function, say "c-ruby-eval"

VALUE c-ruby-eval( char *cvar_string, char *c_expr_string);
where cvar_string can be "xxx:yyy"   /* telling me which c variable going to
be in the
    expression (list seperated by ":"), and 
          c_expr_string can be "xxx:yyy", "z=xxx+sin(yyy);z", as said before.

Any suggestion will be greatly appreciated!
===================================
I do not check the mailing list very often, so if you can cc my email address,
It will be even better.

thank you!
====================================

I'd also like to express my appreciation for Matsumoto's creation of ruby,
for  fukusima's ruby-python extension (I got the new version yesterday!) and
helps!

 






In This Thread

Prev Next