Hi all! I'm running ruby script from C# in my project. It's a very useful feature to initialize ScriptScope with an IDictionary, (it's much faster to fill a dictionary, than making scope.SetVariable calls). The problem is, that if I define functions in my script, then a NotImplementedException is thrown. A simple example is here: http://paste.dprogramming.com/dpil37pp It fails at engine.Execute(script, scope). However, when I create my scope with no dictionary, or just pass no scope to Execute, everything works fine. Is it an issue to be fixed in the future? I need to set, and change many context variables for my scripts at running time, so I have to work out this problem somehow. I'm using IronRuby 1.1. Thanks: Anton
on 2010-11-16 20:15
on 2010-11-21 21:29
I've just added support for string dictionaries. It's committed to the github repo. Tomas From: ironruby-core-bounces@rubyforge.org [mailto:ironruby-core-bounces@rubyforge.org] On Behalf Of Anton Firsov Sent: Tuesday, November 16, 2010 10:05 AM To: ironruby-core@rubyforge.org Subject: [Ironruby-core] ScriptScope from IDictionary + function definitions = NotImplementedException Hi all! I'm running ruby script from C# in my project. It's a very useful feature to initialize ScriptScope with an IDictionary, (it's much faster to fill a dictionary, than making scope.SetVariable calls). The problem is, that if I define functions in my script, then a NotImplementedException is thrown. A simple example is here: http://paste.dprogramming.com/dpil37pp It fails at engine.Execute(script, scope). However, when I create my scope with no dictionary, or just pass no scope to Execute, everything works fine. Is it an issue to be fixed in the future? I need to set, and change many context variables for my scripts at running time, so I have to work out this problem somehow. I'm using IronRuby 1.1. Thanks: Anton
on 2010-11-25 14:19
Very nice, Thanks! There is another error related to scopes, here is a code to reproduce it: http://paste.dprogramming.com/dpw8o44y It throws NullReferenceException for me. When I executed the commented lines (using no scope), no exception was thrown. Anton 2010/11/21 Tomas Matousek <Tomas.Matousek@microsoft.com>
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.