Tomas Restrepo
2007-Nov-07 23:44 UTC
[Ironruby-core] Hosting the DLR and passing data to scripts
I''ve been playing with the DLR hosting interfaces and running ruby code this way; it''s a really, really nifty feature that I''m already loving! I can see a lot of cool scenarios this will be useful, such as providing a good way to provide custom scripting support on applications and so on. I have had some problems, however, in particularly trying to connect the host with the scripts being executed inside the DLR. In my infinite ignorance, I assume you would be able to use Script.SetVariable() (or one of the longer, but equal alternatives to it) to introduce global variables into the scope before executing or evaluating a script, but for the life of me I can''t seem to get it to work. Am I just completely of the mark? or is it just not working at this time? -- Tomas Restrepo http://www.winterdom.com/weblog/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20071107/9a52b7ba/attachment.html
Tomas Matousek
2007-Nov-08 03:54 UTC
[Ironruby-core] Hosting the DLR and passing data to scripts
We?re going to improve hosting API in DLR next month ? there will be several major changes and many minor ones. IronRuby will also plug better to DLR due to these changes. For the time being, use only globals (via RubyEngine.CurrentEngine.ExecutionContext.GlobalVariables dictionary) for passing data from and to Ruby scripts. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Restrepo Sent: Wednesday, November 07, 2007 3:44 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Hosting the DLR and passing data to scripts I''ve been playing with the DLR hosting interfaces and running ruby code this way; it''s a really, really nifty feature that I''m already loving! I can see a lot of cool scenarios this will be useful, such as providing a good way to provide custom scripting support on applications and so on. I have had some problems, however, in particularly trying to connect the host with the scripts being executed inside the DLR. In my infinite ignorance, I assume you would be able to use Script.SetVariable() (or one of the longer, but equal alternatives to it) to introduce global variables into the scope before executing or evaluating a script, but for the life of me I can''t seem to get it to work. Am I just completely of the mark? or is it just not working at this time? -- Tomas Restrepo http://www.winterdom.com/weblog/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20071107/5494fc83/attachment-0001.html
Tomas Restrepo
2007-Nov-08 12:43 UTC
[Ironruby-core] Hosting the DLR and passing data to scripts
Hi Tomas, << We?re going to improve hosting API in DLR next month ? there will be several major changes and many minor ones. IronRuby will also plug better to DLR due to these changes. For the time being, use only globals (via RubyEngine.CurrentEngine.ExecutionContext.GlobalVariables dictionary) for passing data from and to Ruby scripts.>>Thanks for the answer; I''ll keep my eyes on the DLR updates. I did try using the GlobalVariables dictionary and that did work fine. Any particular reason why the global variables are stored in the GlobalVariables dictionary instead of the GlobalScope dictionary? (just trying to understand better how it works) Tomas Restrepo http://www.winterdom.com/weblog/