[Ironruby-core] ExecutionContext without references IronRuby

Ben Hall ben2004uk at googlemail.com
Mon Jun 23 20:23:26 EDT 2008


This might be a bit of a strange request,  but is it possible to get
access to the ExecutionContext without actually referencing the
IronRuby assembly?

As a quick demo, I wrote the following code:

            ScriptRuntime runtime = IronRuby.CreateRuntime();
            engine = IronRuby.GetEngine(runtime);
            RubyExecutionContext ctx = IronRuby.GetExecutionContext(engine);

            list = new List<string>();
            ctx.DefineGlobalVariable("customers", list);

Ideally, what I wanted to write was something more like but $customers
is always nil.

            scope = engine.CreateScope();
            scope.SetVariable("$customers", list);

I was hoping this would have had the same affect as the code above.

Is this by design, a limitation or a bug?



More information about the Ironruby-core mailing list