[Ironruby-core] r93 update

Robert Brotherus robert.brotherus at napa.fi
Wed Apr 9 11:54:54 EDT 2008


I have had following working ok with the recent IR iterations:

        public object GetGlobalVar(string varName)
        {
            return ExecutionContext.GetGlobalVariable(varName);
        }

        public void SetGlobalVar(string varName, object value)
        {
            ExecutionContext.DefineGlobalVariable(varName, value);
        }

It indeed changed few iterations ago and broke my earlier code as well.

Robert Brotherus
Software architect
Napa Ltd
Tammasaarenkatu 3, Helsinki FI-00180
P.O.Box 470, Helsinki FI-00181

Tel. +358 9 22 813 1 
Direct. +358 9 22 813 611 
GSM +358 45 11 456 02 
Fax. +358 9 22 813 800 

Email: Robert.Brotherus at napa.fi 
www.napa.fi 


 

-----Original Message-----
From: ironruby-core-bounces at rubyforge.org
[mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Greg Akins
Sent: 9. huhtikuuta 2008 15:51
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] r93 update

I had written a small "hello world" app that read a ruby file, using
IronRuby.

It used this "puts \"Ruby and ${variable} together at last\"" where
"variable" is a global assigned in the C# program.

The program I'd written stopped compiling after the update so I looked
on the Wiki for changes.

The Wiki shows this example
http://ironruby.rubyforge.org/wiki/wiki.pl?ExecutingIronRubyFromCSharp

>From that example, this line

    ctx.GlobalVariables[SymbolTable.StringToId("variable")] = ".NET";

doesn't work because the index on GlobalVariables has changed to a
KeyValuePair

A, I'm confused about how to create a GlobalVariable object to put in
that collection.  B, I'm unsure if I'm headed down the right path, given
the changes to the API.  Is there a "New" way to assigned global
variables?

Any help is greatly appreciated.

--
Greg Akins
Software Development Manager
SSI Services

http://kc.vanadium.com
http://www.pghcodingdojo.org
http://www.insomnia-consulting.org/monologue
_______________________________________________
Ironruby-core mailing list
Ironruby-core at rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core



More information about the Ironruby-core mailing list