(All work done with VS2010 RC and matching IronRuby build (v0.9.40, 07-Feb-10)). I have a C# assembly that implements a dynamic object. When I try to use this object from Ruby I get the error:>>> r.StdUnitCostSystem.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError) from (ir):1 This usage works fine from a test C# 4.0 app using the ''dynamic'' keyword. I suspect that the issue is related to the version of the DLR in use -- there are a number of ''InvalidOperationExceptions'' being thrown from the Microsoft.Dynamic.dll and I believe this is no longer a shipping assembly with .NET 4? Is there a (simple) work around for this? Thanks, Rob Walker Senior Software Architect [cid:image001.gif at 01CABA24.88DB41A0]<http://www.kinaxis.com/> http://www.kinaxis.com Kinaxis 700 Silver Seven Road Ottawa, ON, Canada K2V 1C3 Office: +1 613.592.5780 ext. 5282 Fax: +1 613.592.0584 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100302/be69fcdc/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1706 bytes Desc: image001.gif URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100302/be69fcdc/attachment.gif>
Have you tried building Ruby directly? Get the sources from Github, then, from the command line, run c:\path\to\merlin\main\languages\ruby\scripts\dev.bat rb devenv ruby4.sln Inside of VS build ruby4.sln then: 1) For basic testing, rbd will open a prompt for you to resume testing. 2) For using it then without the sources, rake package will generate the release layout at c:\ironruby, which you can then copy to your desired location. After 1.0, I''m going to look into making nightly drops available, but that''s a little ways off. If this still doesn''t work, it might be a bug :( JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Robert Walker Sent: Tuesday, March 02, 2010 1:22 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Consuming DynamicObjects in IronRuby (All work done with VS2010 RC and matching IronRuby build (v0.9.40, 07-Feb-10)). I have a C# assembly that implements a dynamic object. When I try to use this object from Ruby I get the error:>>> r.StdUnitCostSystem.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError) from (ir):1 This usage works fine from a test C# 4.0 app using the ''dynamic'' keyword. I suspect that the issue is related to the version of the DLR in use -- there are a number of ''InvalidOperationExceptions'' being thrown from the Microsoft.Dynamic.dll and I believe this is no longer a shipping assembly with .NET 4? Is there a (simple) work around for this? Thanks, Rob Walker Senior Software Architect [cid:image001.gif at 01CAB992.6A7F4590]<http://www.kinaxis.com/> http://www.kinaxis.com Kinaxis 700 Silver Seven Road Ottawa, ON, Canada K2V 1C3 Office: +1 613.592.5780 ext. 5282 Fax: +1 613.592.0584 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100302/dd538d00/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1706 bytes Desc: image001.gif URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100302/dd538d00/attachment-0001.gif>
Ivan Porto Carrero
2010-Mar-02 22:14 UTC
[Ironruby-core] Consuming DynamicObjects in IronRuby
try this one? http://ironruby.codeplex.com/releases/view/40175 --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Web: http://whiterabbitconsulting.eu - http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) Microsoft IronRuby/C# MVP On Tue, Mar 2, 2010 at 10:22 PM, Robert Walker <RWalker at kinaxis.com> wrote:> (All work done with VS2010 RC and matching IronRuby build (v0.9.40, > 07-Feb-10)). > > > > I have a C# assembly that implements a dynamic object. When I try to use > this object from Ruby I get the error: > > > > >>> r.StdUnitCost > > System.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError) > > from (ir):1 > > > > This usage works fine from a test C# 4.0 app using the ''dynamic'' keyword. > > > > I suspect that the issue is related to the version of the DLR in use -- > there are a number of ''InvalidOperationExceptions'' being thrown from the > Microsoft.Dynamic.dll and I believe this is no longer a shipping assembly > with .NET 4? > > > > Is there a (simple) work around for this? > > > > Thanks, > > > > *Rob Walker* > Senior Software Architect > > [image: cid:image001.gif at 01CAB992.6A7F4590] <http://www.kinaxis.com/> > > http://www.kinaxis.com > > Kinaxis > 700 Silver Seven Road > Ottawa, ON, Canada K2V 1C3 > > Office: > > +1 613.592.5780 ext. 5282 > > Fax: > > +1 613.592.0584 > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100302/6fe27d08/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1706 bytes Desc: not available URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100302/6fe27d08/attachment.gif>
Unfortunately that is the one I''m using ... The only thing I have down to the out-of-the-box download is run: corflags /32bit- /force on ir.exe so that I can run it 64-bit (an underlying assembly I use is x64 only) I tried the same test using the latest IronPython bits and it works fine there. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Tuesday, March 02, 2010 5:15 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby try this one? http://ironruby.codeplex.com/releases/view/40175 --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Web: http://whiterabbitconsulting.eu - http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) Microsoft IronRuby/C# MVP On Tue, Mar 2, 2010 at 10:22 PM, Robert Walker <RWalker at kinaxis.com<mailto:RWalker at kinaxis.com>> wrote: (All work done with VS2010 RC and matching IronRuby build (v0.9.40, 07-Feb-10)). I have a C# assembly that implements a dynamic object. When I try to use this object from Ruby I get the error:>>> r.StdUnitCostSystem.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError) from (ir):1 This usage works fine from a test C# 4.0 app using the ''dynamic'' keyword. I suspect that the issue is related to the version of the DLR in use -- there are a number of ''InvalidOperationExceptions'' being thrown from the Microsoft.Dynamic.dll and I believe this is no longer a shipping assembly with .NET 4? Is there a (simple) work around for this? Thanks, Rob Walker Senior Software Architect [cid:image001.gif at 01CABA2D.79A399E0]<http://www.kinaxis.com/> http://www.kinaxis.com Kinaxis 700 Silver Seven Road Ottawa, ON, Canada K2V 1C3 Office: +1 613.592.5780 ext. 5282 Fax: +1 613.592.0584 _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100302/fa13c98c/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1706 bytes Desc: image001.gif URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100302/fa13c98c/attachment-0001.gif>
It is a bug in DynamicObject for which I implemented a workaround in IronRuby some time ago. So the build from latest sources should help. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, March 02, 2010 2:05 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby Have you tried building Ruby directly? Get the sources from Github, then, from the command line, run c:\path\to\merlin\main\languages\ruby\scripts\dev.bat rb devenv ruby4.sln Inside of VS build ruby4.sln then: 1) For basic testing, rbd will open a prompt for you to resume testing. 2) For using it then without the sources, rake package will generate the release layout at c:\ironruby, which you can then copy to your desired location. After 1.0, I''m going to look into making nightly drops available, but that''s a little ways off. If this still doesn''t work, it might be a bug :( JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Robert Walker Sent: Tuesday, March 02, 2010 1:22 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Consuming DynamicObjects in IronRuby (All work done with VS2010 RC and matching IronRuby build (v0.9.40, 07-Feb-10)). I have a C# assembly that implements a dynamic object. When I try to use this object from Ruby I get the error:>>> r.StdUnitCostSystem.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError) from (ir):1 This usage works fine from a test C# 4.0 app using the ''dynamic'' keyword. I suspect that the issue is related to the version of the DLR in use -- there are a number of ''InvalidOperationExceptions'' being thrown from the Microsoft.Dynamic.dll and I believe this is no longer a shipping assembly with .NET 4? Is there a (simple) work around for this? Thanks, Rob Walker Senior Software Architect [cid:image001.gif at 01CAB992.6A7F4590]<http://www.kinaxis.com/> http://www.kinaxis.com Kinaxis 700 Silver Seven Road Ottawa, ON, Canada K2V 1C3 Office: +1 613.592.5780 ext. 5282 Fax: +1 613.592.0584 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100302/8e7fe20a/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1706 bytes Desc: image001.gif URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100302/8e7fe20a/attachment.gif>
I''ve tried it with a fresh set of source, and building the "V4
Debug" target in VS2010. Same behaviour, but more detail in the output
window:
A first chance exception of type
''System.InvalidOperationException'' occurred in
Microsoft.Dynamic.dll
MT_INIT: Exception
UPDATED: Exception SetMethod:
initialize affected=1 rules=0
UPDATED: Exception SetMethod: inspect
affected=1 rules=0
UPDATED: Exception SetMethod: to_s
affected=1 rules=0
A first chance exception of type
''System.InvalidOperationException'' occurred in
Microsoft.Dynamic.dll
A first chance exception of type
''System.InvalidOperationException'' occurred in
Microsoft.Dynamic.dll
I''ll see if I can come up with a more minimal repo case.
For what it''s worth the call stack on the first exception is:
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.EnsureAvailableForClosure(System.Linq.Expressions.ParameterExpression
expr = {System.Linq.Expressions.ParameterExpression}) Line 268 C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileGetVariable(System.Linq.Expressions.ParameterExpression
variable = {System.Linq.Expressions.ParameterExpression}) Line 279 + 0x15 bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileParameterExpression(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.ParameterExpression}) Line 340 + 0xf bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.Compile(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.ParameterExpression}) Line 1378 + 0x15 bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileTypeEqualExpression(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.TypeBinaryExpression}) Line 1272 + 0x30 bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.Compile(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.TypeBinaryExpression}) Line 1403 + 0x15 bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileLogicalBinaryExpression(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.LogicalBinaryExpression}, bool andAlso = true)
Line 683 + 0x3f bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileAndAlsoBinaryExpression(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.LogicalBinaryExpression}) Line 659 + 0x12 bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.Compile(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.LogicalBinaryExpression}) Line 1343 + 0x15 bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileConditionalExpression(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.ConditionalExpression}, bool asVoid = true) Line
697 + 0x33 bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.Compile(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.ConditionalExpression}) Line 1348 + 0x72 bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.ConditionalExpression}) Line 1327 + 0x15 bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.Block3}, bool asVoid = false) Line 356 + 0x58
bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.Compile(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.Block3}) Line 1387 + 0x90 bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileTop(System.Linq.Expressions.LambdaExpression
node =
{System.Linq.Expressions.Expression<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>})
Line 195 + 0x32 bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Generation.CompilerHelpers.LightCompile(System.Linq.Expressions.LambdaExpression
lambda =
{System.Linq.Expressions.Expression<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>},
int compilationThreshold = 0xffffffff) Line 643 + 0x38 bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Utils.DynamicUtils.LightBind<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>(System.Dynamic.DynamicMetaObjectBinder
binder = {IronRuby.Runtime.Calls.RubyCallAction},
System.Runtime.CompilerServices.CallSite<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>
site =
{System.Runtime.CompilerServices.CallSite<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>},
object[] args = {object[0x00000002]}, int compilationThreshold = 0xffffffff)
Line 67 + 0x76 bytes C#
IronRuby.dll!IronRuby.Runtime.Calls.RubyMetaBinder.BindDelegate<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>(System.Runtime.CompilerServices.CallSite<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>
site =
{System.Runtime.CompilerServices.CallSite<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>},
object[] args = {object[0x00000002]}) Line 104 + 0xea bytes C#
System.Core.dll!System.Runtime.CompilerServices.CallSiteBinder.BindCore<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>(System.Runtime.CompilerServices.CallSite<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>
site, object[] args) + 0x55 bytes
System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute2<object,object,object>(System.Runtime.CompilerServices.CallSite
site =
{System.Runtime.CompilerServices.CallSite<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>},
object arg0 = {IronRuby.Runtime.RubyTopLevelScope}, object arg1 =
{Medic.RapidResponse.Proxies.EREngineRecord}) + 0x3c0 bytes
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.DynamicInstruction<object,object,object>.Run(Microsoft.Scripting.Interpreter.InterpretedFrame
frame = {Microsoft.Scripting.Interpreter.InterpretedFrame}) Line 163 + 0x17a
bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.RunInstructions(Microsoft.Scripting.Interpreter.InterpretedFrame
frame = {Microsoft.Scripting.Interpreter.InterpretedFrame}) Line 142 + 0x62
bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame
frame = {Microsoft.Scripting.Interpreter.InterpretedFrame}) Line 108 + 0xd bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run2<IronRuby.Runtime.RubyScope,object,object>(IronRuby.Runtime.RubyScope
arg0 = {IronRuby.Runtime.RubyTopLevelScope}, null arg1 = main) Line 97 + 0x24
bytes C#
IronRuby.dll!IronRuby.Runtime.RubyScriptCode.Run(Microsoft.Scripting.Runtime.Scope
scope = {Microsoft.Scripting.Runtime.Scope}, bool bindGlobals = true) Line 111 +
0x5a bytes C#
IronRuby.dll!IronRuby.Runtime.RubyScriptCode.Run(Microsoft.Scripting.Runtime.Scope
scope = {Microsoft.Scripting.Runtime.Scope}) Line 83 + 0x12 bytes C#
Microsoft.Scripting.dll!Microsoft.Scripting.Hosting.CompiledCode.Execute(Microsoft.Scripting.Hosting.ScriptScope
scope = {Microsoft.Scripting.Hosting.ScriptScope}) Line 83 + 0x3e bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.CommandLine.SimpleCommandDispatcher.Execute(Microsoft.Scripting.Hosting.CompiledCode
compiledCode = {Microsoft.Scripting.Hosting.CompiledCode},
Microsoft.Scripting.Hosting.ScriptScope scope =
{Microsoft.Scripting.Hosting.ScriptScope}) Line 452 + 0x17 bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.CommandLine.ExecuteCommand(Microsoft.Scripting.Hosting.ScriptSource
source = "(ir)") Line 343 + 0x47 bytes C#
IronRuby.dll!IronRuby.Hosting.RubyCommandLine.ExecuteCommand(string
command = "r.StdUnitCost\n") Line 99 + 0x40 bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.CommandLine.RunOneInteraction()
Line 332 + 0x1f bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.CommandLine.TryInteractiveAction()
Line 291 + 0x9 bytes C#
IronRuby.dll!IronRuby.Hosting.RubyCommandLine.TryInteractiveAction() Line
58 + 0xc bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.CommandLine.RunInteractiveLoop()
Line 236 + 0x18 bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.CommandLine.RunInteractive()
Line 209 + 0xa bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.CommandLine.Run()
Line 146 + 0x19 bytes C#
IronRuby.dll!IronRuby.Hosting.RubyCommandLine.Run() Line 81 + 0xd bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.CommandLine.Run(Microsoft.Scripting.Hosting.ScriptEngine
engine = "IronRuby", Microsoft.Scripting.Hosting.Shell.IConsole
console = {Microsoft.Scripting.Hosting.Shell.BasicConsole},
Microsoft.Scripting.Hosting.Shell.ConsoleOptions options =
{IronRuby.Hosting.RubyConsoleOptions}) Line 112 + 0x1a bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.ConsoleHost.RunCommandLine()
Line 398 + 0x51 bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.ConsoleHost.ExecuteInternal()
Line 332 + 0x1a bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.ConsoleHost.Execute()
Line 308 + 0x1a bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.ConsoleHost.Run(string[]
args = {string[0x00000000]}) Line 222 + 0xc bytes C#
ir.exe!RubyConsoleHost.Main(string[] args = {string[0x00000000]}) Line 60
+ 0x3e bytes C#
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Tomas Matousek
Sent: Tuesday, March 02, 2010 6:00 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
It is a bug in DynamicObject for which I implemented a workaround in IronRuby
some time ago. So the build from latest sources should help.
Tomas
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Jim Deville
Sent: Tuesday, March 02, 2010 2:05 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
Have you tried building Ruby directly? Get the sources from Github, then, from
the command line, run
c:\path\to\merlin\main\languages\ruby\scripts\dev.bat
rb
devenv ruby4.sln
Inside of VS build ruby4.sln then:
1) For basic testing, rbd will open a prompt for you to resume testing.
2) For using it then without the sources, rake package will generate the
release layout at c:\ironruby, which you can then copy to your desired location.
After 1.0, I''m going to look into making nightly drops available, but
that''s a little ways off.
If this still doesn''t work, it might be a bug :(
JD
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Robert Walker
Sent: Tuesday, March 02, 2010 1:22 PM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Consuming DynamicObjects in IronRuby
(All work done with VS2010 RC and matching IronRuby build (v0.9.40, 07-Feb-10)).
I have a C# assembly that implements a dynamic object. When I try to use this
object from Ruby I get the error:
>>> r.StdUnitCost
System.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError)
from (ir):1
This usage works fine from a test C# 4.0 app using the
''dynamic'' keyword.
I suspect that the issue is related to the version of the DLR in use -- there
are a number of ''InvalidOperationExceptions'' being thrown from
the Microsoft.Dynamic.dll and I believe this is no longer a shipping assembly
with .NET 4?
Is there a (simple) work around for this?
Thanks,
Rob Walker
Senior Software Architect
[cid:image001.gif at 01CABA4D.93044860]<http://www.kinaxis.com/>
http://www.kinaxis.com
Kinaxis
700 Silver Seven Road
Ottawa, ON, Canada K2V 1C3
Office:
+1 613.592.5780 ext. 5282
Fax:
+1 613.592.0584
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20100302/0e1b1296/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 1706 bytes
Desc: image001.gif
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20100302/0e1b1296/attachment-0001.gif>
Jim, have we pushed sources out recently? It might be that we haven''t
since I made the change.
Tomas
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Robert Walker
Sent: Tuesday, March 02, 2010 6:30 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
I''ve tried it with a fresh set of source, and building the "V4
Debug" target in VS2010. Same behaviour, but more detail in the output
window:
A first chance exception of type
''System.InvalidOperationException'' occurred in
Microsoft.Dynamic.dll
MT_INIT: Exception
UPDATED: Exception SetMethod:
initialize affected=1 rules=0
UPDATED: Exception SetMethod: inspect
affected=1 rules=0
UPDATED: Exception SetMethod: to_s
affected=1 rules=0
A first chance exception of type
''System.InvalidOperationException'' occurred in
Microsoft.Dynamic.dll
A first chance exception of type
''System.InvalidOperationException'' occurred in
Microsoft.Dynamic.dll
I''ll see if I can come up with a more minimal repo case.
For what it''s worth the call stack on the first exception is:
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.EnsureAvailableForClosure(System.Linq.Expressions.ParameterExpression
expr = {System.Linq.Expressions.ParameterExpression}) Line 268 C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileGetVariable(System.Linq.Expressions.ParameterExpression
variable = {System.Linq.Expressions.ParameterExpression}) Line 279 + 0x15 bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileParameterExpression(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.ParameterExpression}) Line 340 + 0xf bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.Compile(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.ParameterExpression}) Line 1378 + 0x15 bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileTypeEqualExpression(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.TypeBinaryExpression}) Line 1272 + 0x30 bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.Compile(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.TypeBinaryExpression}) Line 1403 + 0x15 bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileLogicalBinaryExpression(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.LogicalBinaryExpression}, bool andAlso = true)
Line 683 + 0x3f bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileAndAlsoBinaryExpression(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.LogicalBinaryExpression}) Line 659 + 0x12 bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.Compile(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.LogicalBinaryExpression}) Line 1343 + 0x15 bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileConditionalExpression(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.ConditionalExpression}, bool asVoid = true) Line
697 + 0x33 bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.Compile(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.ConditionalExpression}) Line 1348 + 0x72 bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.ConditionalExpression}) Line 1327 + 0x15 bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.Block3}, bool asVoid = false) Line 356 + 0x58
bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.Compile(System.Linq.Expressions.Expression
expr = {System.Linq.Expressions.Block3}) Line 1387 + 0x90 bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightCompiler.CompileTop(System.Linq.Expressions.LambdaExpression
node =
{System.Linq.Expressions.Expression<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>})
Line 195 + 0x32 bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Generation.CompilerHelpers.LightCompile(System.Linq.Expressions.LambdaExpression
lambda =
{System.Linq.Expressions.Expression<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>},
int compilationThreshold = 0xffffffff) Line 643 + 0x38 bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Utils.DynamicUtils.LightBind<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>(System.Dynamic.DynamicMetaObjectBinder
binder = {IronRuby.Runtime.Calls.RubyCallAction},
System.Runtime.CompilerServices.CallSite<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>
site =
{System.Runtime.CompilerServices.CallSite<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>},
object[] args = {object[0x00000002]}, int compilationThreshold = 0xffffffff)
Line 67 + 0x76 bytes C#
IronRuby.dll!IronRuby.Runtime.Calls.RubyMetaBinder.BindDelegate<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>(System.Runtime.CompilerServices.CallSite<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>
site =
{System.Runtime.CompilerServices.CallSite<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>},
object[] args = {object[0x00000002]}) Line 104 + 0xea bytes C#
System.Core.dll!System.Runtime.CompilerServices.CallSiteBinder.BindCore<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>(System.Runtime.CompilerServices.CallSite<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>
site, object[] args) + 0x55 bytes
System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute2<object,object,object>(System.Runtime.CompilerServices.CallSite
site =
{System.Runtime.CompilerServices.CallSite<System.Func<System.Runtime.CompilerServices.CallSite,object,object,object>>},
object arg0 = {IronRuby.Runtime.RubyTopLevelScope}, object arg1 =
{Medic.RapidResponse.Proxies.EREngineRecord}) + 0x3c0 bytes
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.DynamicInstruction<object,object,object>.Run(Microsoft.Scripting.Interpreter.InterpretedFrame
frame = {Microsoft.Scripting.Interpreter.InterpretedFrame}) Line 163 + 0x17a
bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.RunInstructions(Microsoft.Scripting.Interpreter.InterpretedFrame
frame = {Microsoft.Scripting.Interpreter.InterpretedFrame}) Line 142 + 0x62
bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame
frame = {Microsoft.Scripting.Interpreter.InterpretedFrame}) Line 108 + 0xd bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run2<IronRuby.Runtime.RubyScope,object,object>(IronRuby.Runtime.RubyScope
arg0 = {IronRuby.Runtime.RubyTopLevelScope}, null arg1 = main) Line 97 + 0x24
bytes C#
IronRuby.dll!IronRuby.Runtime.RubyScriptCode.Run(Microsoft.Scripting.Runtime.Scope
scope = {Microsoft.Scripting.Runtime.Scope}, bool bindGlobals = true) Line 111 +
0x5a bytes C#
IronRuby.dll!IronRuby.Runtime.RubyScriptCode.Run(Microsoft.Scripting.Runtime.Scope
scope = {Microsoft.Scripting.Runtime.Scope}) Line 83 + 0x12 bytes C#
Microsoft.Scripting.dll!Microsoft.Scripting.Hosting.CompiledCode.Execute(Microsoft.Scripting.Hosting.ScriptScope
scope = {Microsoft.Scripting.Hosting.ScriptScope}) Line 83 + 0x3e bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.CommandLine.SimpleCommandDispatcher.Execute(Microsoft.Scripting.Hosting.CompiledCode
compiledCode = {Microsoft.Scripting.Hosting.CompiledCode},
Microsoft.Scripting.Hosting.ScriptScope scope =
{Microsoft.Scripting.Hosting.ScriptScope}) Line 452 + 0x17 bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.CommandLine.ExecuteCommand(Microsoft.Scripting.Hosting.ScriptSource
source = "(ir)") Line 343 + 0x47 bytes C#
IronRuby.dll!IronRuby.Hosting.RubyCommandLine.ExecuteCommand(string
command = "r.StdUnitCost\n") Line 99 + 0x40 bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.CommandLine.RunOneInteraction()
Line 332 + 0x1f bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.CommandLine.TryInteractiveAction()
Line 291 + 0x9 bytes C#
IronRuby.dll!IronRuby.Hosting.RubyCommandLine.TryInteractiveAction() Line
58 + 0xc bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.CommandLine.RunInteractiveLoop()
Line 236 + 0x18 bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.CommandLine.RunInteractive()
Line 209 + 0xa bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.CommandLine.Run()
Line 146 + 0x19 bytes C#
IronRuby.dll!IronRuby.Hosting.RubyCommandLine.Run() Line 81 + 0xd bytes
C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.CommandLine.Run(Microsoft.Scripting.Hosting.ScriptEngine
engine = "IronRuby", Microsoft.Scripting.Hosting.Shell.IConsole
console = {Microsoft.Scripting.Hosting.Shell.BasicConsole},
Microsoft.Scripting.Hosting.Shell.ConsoleOptions options =
{IronRuby.Hosting.RubyConsoleOptions}) Line 112 + 0x1a bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.ConsoleHost.RunCommandLine()
Line 398 + 0x51 bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.ConsoleHost.ExecuteInternal()
Line 332 + 0x1a bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.ConsoleHost.Execute()
Line 308 + 0x1a bytes C#
Microsoft.Dynamic.dll!Microsoft.Scripting.Hosting.Shell.ConsoleHost.Run(string[]
args = {string[0x00000000]}) Line 222 + 0xc bytes C#
ir.exe!RubyConsoleHost.Main(string[] args = {string[0x00000000]}) Line 60
+ 0x3e bytes C#
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Tomas Matousek
Sent: Tuesday, March 02, 2010 6:00 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
It is a bug in DynamicObject for which I implemented a workaround in IronRuby
some time ago. So the build from latest sources should help.
Tomas
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Jim Deville
Sent: Tuesday, March 02, 2010 2:05 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
Have you tried building Ruby directly? Get the sources from Github, then, from
the command line, run
c:\path\to\merlin\main\languages\ruby\scripts\dev.bat
rb
devenv ruby4.sln
Inside of VS build ruby4.sln then:
1) For basic testing, rbd will open a prompt for you to resume testing.
2) For using it then without the sources, rake package will generate the
release layout at c:\ironruby, which you can then copy to your desired location.
After 1.0, I''m going to look into making nightly drops available, but
that''s a little ways off.
If this still doesn''t work, it might be a bug :(
JD
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Robert Walker
Sent: Tuesday, March 02, 2010 1:22 PM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Consuming DynamicObjects in IronRuby
(All work done with VS2010 RC and matching IronRuby build (v0.9.40, 07-Feb-10)).
I have a C# assembly that implements a dynamic object. When I try to use this
object from Ruby I get the error:
>>> r.StdUnitCost
System.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError)
from (ir):1
This usage works fine from a test C# 4.0 app using the
''dynamic'' keyword.
I suspect that the issue is related to the version of the DLR in use -- there
are a number of ''InvalidOperationExceptions'' being thrown from
the Microsoft.Dynamic.dll and I believe this is no longer a shipping assembly
with .NET 4?
Is there a (simple) work around for this?
Thanks,
Rob Walker
Senior Software Architect
[cid:image001.gif at 01CAB992.6A7F4590]<http://www.kinaxis.com/>
http://www.kinaxis.com
Kinaxis
700 Silver Seven Road
Ottawa, ON, Canada K2V 1C3
Office:
+1 613.592.5780 ext. 5282
Fax:
+1 613.592.0584
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20100303/7a59b4bb/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 1706 bytes
Desc: image001.gif
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20100303/7a59b4bb/attachment-0001.gif>
A simple case appears to reproduce the problem:
using System;
namespace DynamicTest
{
public class N : System.Dynamic.DynamicObject
{
public N()
{
}
public override bool TryGetMember(System.Dynamic.GetMemberBinder binder,
out Object result)
{
if (binder.Name == "Zot")
{
result = "hello world";
return true;
}
return base.TryGetMember(binder, out result);
}
}
}
And then ...
$LOAD_PATH <<
"D:\\Projects\\DynamicTest\\DynamicTest\\bin\\Debug"
require "DynamicTest.dll"
z =DynamicTest::N.new
z.Zot
>>> z.Zot
System.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError)
from (ir):1
---
Rob
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Tomas Matousek
Sent: Tuesday, March 02, 2010 6:00 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
It is a bug in DynamicObject for which I implemented a workaround in IronRuby
some time ago. So the build from latest sources should help.
Tomas
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Jim Deville
Sent: Tuesday, March 02, 2010 2:05 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
Have you tried building Ruby directly? Get the sources from Github, then, from
the command line, run
c:\path\to\merlin\main\languages\ruby\scripts\dev.bat
rb
devenv ruby4.sln
Inside of VS build ruby4.sln then:
1) For basic testing, rbd will open a prompt for you to resume testing.
2) For using it then without the sources, rake package will generate the
release layout at c:\ironruby, which you can then copy to your desired location.
After 1.0, I''m going to look into making nightly drops available, but
that''s a little ways off.
If this still doesn''t work, it might be a bug :(
JD
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Robert Walker
Sent: Tuesday, March 02, 2010 1:22 PM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Consuming DynamicObjects in IronRuby
(All work done with VS2010 RC and matching IronRuby build (v0.9.40, 07-Feb-10)).
I have a C# assembly that implements a dynamic object. When I try to use this
object from Ruby I get the error:
>>> r.StdUnitCost
System.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError)
from (ir):1
This usage works fine from a test C# 4.0 app using the
''dynamic'' keyword.
I suspect that the issue is related to the version of the DLR in use -- there
are a number of ''InvalidOperationExceptions'' being thrown from
the Microsoft.Dynamic.dll and I believe this is no longer a shipping assembly
with .NET 4?
Is there a (simple) work around for this?
Thanks,
Rob Walker
Senior Software Architect
[cid:image001.gif at 01CABA52.2CB2CB40]<http://www.kinaxis.com/>
http://www.kinaxis.com
Kinaxis
700 Silver Seven Road
Ottawa, ON, Canada K2V 1C3
Office:
+1 613.592.5780 ext. 5282
Fax:
+1 613.592.0584
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20100302/69913366/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 1706 bytes
Desc: image001.gif
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20100302/69913366/attachment-0001.gif>
This works for me, so I guess the fix just isn''t on GIT yet.
Tomas
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Robert Walker
Sent: Tuesday, March 02, 2010 6:52 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
A simple case appears to reproduce the problem:
using System;
namespace DynamicTest
{
public class N : System.Dynamic.DynamicObject
{
public N()
{
}
public override bool TryGetMember(System.Dynamic.GetMemberBinder binder,
out Object result)
{
if (binder.Name == "Zot")
{
result = "hello world";
return true;
}
return base.TryGetMember(binder, out result);
}
}
}
And then ...
$LOAD_PATH <<
"D:\\Projects\\DynamicTest\\DynamicTest\\bin\\Debug"
require "DynamicTest.dll"
z =DynamicTest::N.new
z.Zot
>>> z.Zot
System.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError)
from (ir):1
---
Rob
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Tomas Matousek
Sent: Tuesday, March 02, 2010 6:00 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
It is a bug in DynamicObject for which I implemented a workaround in IronRuby
some time ago. So the build from latest sources should help.
Tomas
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Jim Deville
Sent: Tuesday, March 02, 2010 2:05 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
Have you tried building Ruby directly? Get the sources from Github, then, from
the command line, run
c:\path\to\merlin\main\languages\ruby\scripts\dev.bat
rb
devenv ruby4.sln
Inside of VS build ruby4.sln then:
1) For basic testing, rbd will open a prompt for you to resume testing.
2) For using it then without the sources, rake package will generate the
release layout at c:\ironruby, which you can then copy to your desired location.
After 1.0, I''m going to look into making nightly drops available, but
that''s a little ways off.
If this still doesn''t work, it might be a bug :(
JD
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Robert Walker
Sent: Tuesday, March 02, 2010 1:22 PM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Consuming DynamicObjects in IronRuby
(All work done with VS2010 RC and matching IronRuby build (v0.9.40, 07-Feb-10)).
I have a C# assembly that implements a dynamic object. When I try to use this
object from Ruby I get the error:
>>> r.StdUnitCost
System.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError)
from (ir):1
This usage works fine from a test C# 4.0 app using the
''dynamic'' keyword.
I suspect that the issue is related to the version of the DLR in use -- there
are a number of ''InvalidOperationExceptions'' being thrown from
the Microsoft.Dynamic.dll and I believe this is no longer a shipping assembly
with .NET 4?
Is there a (simple) work around for this?
Thanks,
Rob Walker
Senior Software Architect
[cid:image001.gif at 01CAB992.6A7F4590]<http://www.kinaxis.com/>
http://www.kinaxis.com
Kinaxis
700 Silver Seven Road
Ottawa, ON, Canada K2V 1C3
Office:
+1 613.592.5780 ext. 5282
Fax:
+1 613.592.0584
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20100303/96cc10b4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 1706 bytes
Desc: image001.gif
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20100303/96cc10b4/attachment.gif>
Yeah, between being sick and test changes, I haven''t pushed in a while.
I''ll do a push tonight and make sure the simple repro passes and ends
up as a test.
________________________________
From: Tomas Matousek <Tomas.Matousek at microsoft.com>
Sent: Tuesday, March 02, 2010 7:47 PM
To: ironruby-core at rubyforge.org <ironruby-core at rubyforge.org>
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
This works for me, so I guess the fix just isn?t on GIT yet.
Tomas
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Robert Walker
Sent: Tuesday, March 02, 2010 6:52 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
A simple case appears to reproduce the problem:
using System;
namespace DynamicTest
{
public class N : System.Dynamic.DynamicObject
{
public N()
{
}
public override bool TryGetMember(System.Dynamic.GetMemberBinder binder,
out Object result)
{
if (binder.Name == "Zot")
{
result = "hello world";
return true;
}
return base.TryGetMember(binder, out result);
}
}
}
And then ...
$LOAD_PATH <<
"D:\\Projects\\DynamicTest\\DynamicTest\\bin\\Debug"
require "DynamicTest.dll"
z =DynamicTest::N.new
z.Zot
>>> z.Zot
System.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError)
from (ir):1
---
Rob
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Tomas Matousek
Sent: Tuesday, March 02, 2010 6:00 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
It is a bug in DynamicObject for which I implemented a workaround in IronRuby
some time ago. So the build from latest sources should help.
Tomas
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Jim Deville
Sent: Tuesday, March 02, 2010 2:05 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
Have you tried building Ruby directly? Get the sources from Github, then, from
the command line, run
c:\path\to\merlin\main\languages\ruby\scripts\dev.bat
rb
devenv ruby4.sln
Inside of VS build ruby4.sln then:
1) For basic testing, rbd will open a prompt for you to resume testing.
2) For using it then without the sources, rake package will generate the
release layout at c:\ironruby, which you can then copy to your desired location.
After 1.0, I?m going to look into making nightly drops available, but that?s a
little ways off.
If this still doesn?t work, it might be a bug :(
JD
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Robert Walker
Sent: Tuesday, March 02, 2010 1:22 PM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Consuming DynamicObjects in IronRuby
(All work done with VS2010 RC and matching IronRuby build (v0.9.40, 07-Feb-10)).
I have a C# assembly that implements a dynamic object. When I try to use this
object from Ruby I get the error:
>>> r.StdUnitCost
System.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError)
from (ir):1
This usage works fine from a test C# 4.0 app using the
''dynamic'' keyword.
I suspect that the issue is related to the version of the DLR in use -- there
are a number of ''InvalidOperationExceptions'' being thrown from
the Microsoft.Dynamic.dll and I believe this is no longer a shipping assembly
with .NET 4?
Is there a (simple) work around for this?
Thanks,
Rob Walker
Senior Software Architect
[cid:image001.gif at 01CAB992.6A7F4590]<http://www.kinaxis.com/>
http://www.kinaxis.com
Kinaxis
700 Silver Seven Road
Ottawa, ON, Canada K2V 1C3
Office:
+1 613.592.5780 ext. 5282
Fax:
+1 613.592.0584
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20100303/27a69fcc/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 1706 bytes
Desc: image001.gif
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20100303/27a69fcc/attachment-0001.gif>
K, I''ve pushed. I guarantee it builds, but I pushed it before all the
tests finished since I have reasonable confidence in them. Looks good so far.
I''ll re-push tomorrow if needed.
JD
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Jim Deville
Sent: Tuesday, March 02, 2010 7:53 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
Yeah, between being sick and test changes, I haven''t pushed in a while.
I''ll do a push tonight and make sure the simple repro passes and ends
up as a test.
________________________________
From: Tomas Matousek <Tomas.Matousek at microsoft.com>
Sent: Tuesday, March 02, 2010 7:47 PM
To: ironruby-core at rubyforge.org <ironruby-core at rubyforge.org>
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
This works for me, so I guess the fix just isn''t on GIT yet.
Tomas
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Robert Walker
Sent: Tuesday, March 02, 2010 6:52 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
A simple case appears to reproduce the problem:
using System;
namespace DynamicTest
{
public class N : System.Dynamic.DynamicObject
{
public N()
{
}
public override bool TryGetMember(System.Dynamic.GetMemberBinder binder,
out Object result)
{
if (binder.Name == "Zot")
{
result = "hello world";
return true;
}
return base.TryGetMember(binder, out result);
}
}
}
And then ...
$LOAD_PATH <<
"D:\\Projects\\DynamicTest\\DynamicTest\\bin\\Debug"
require "DynamicTest.dll"
z =DynamicTest::N.new
z.Zot
>>> z.Zot
System.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError)
from (ir):1
---
Rob
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Tomas Matousek
Sent: Tuesday, March 02, 2010 6:00 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
It is a bug in DynamicObject for which I implemented a workaround in IronRuby
some time ago. So the build from latest sources should help.
Tomas
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Jim Deville
Sent: Tuesday, March 02, 2010 2:05 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
Have you tried building Ruby directly? Get the sources from Github, then, from
the command line, run
c:\path\to\merlin\main\languages\ruby\scripts\dev.bat
rb
devenv ruby4.sln
Inside of VS build ruby4.sln then:
1) For basic testing, rbd will open a prompt for you to resume testing.
2) For using it then without the sources, rake package will generate the
release layout at c:\ironruby, which you can then copy to your desired location.
After 1.0, I''m going to look into making nightly drops available, but
that''s a little ways off.
If this still doesn''t work, it might be a bug :(
JD
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Robert Walker
Sent: Tuesday, March 02, 2010 1:22 PM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Consuming DynamicObjects in IronRuby
(All work done with VS2010 RC and matching IronRuby build (v0.9.40, 07-Feb-10)).
I have a C# assembly that implements a dynamic object. When I try to use this
object from Ruby I get the error:
>>> r.StdUnitCost
System.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError)
from (ir):1
This usage works fine from a test C# 4.0 app using the
''dynamic'' keyword.
I suspect that the issue is related to the version of the DLR in use -- there
are a number of ''InvalidOperationExceptions'' being thrown from
the Microsoft.Dynamic.dll and I believe this is no longer a shipping assembly
with .NET 4?
Is there a (simple) work around for this?
Thanks,
Rob Walker
Senior Software Architect
[Description: cid:image001.gif at
01CAB992.6A7F4590]<http://www.kinaxis.com/>
http://www.kinaxis.com
Kinaxis
700 Silver Seven Road
Ottawa, ON, Canada K2V 1C3
Office:
+1 613.592.5780 ext. 5282
Fax:
+1 613.592.0584
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20100303/45ba57da/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 1706 bytes
Desc: image001.gif
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20100303/45ba57da/attachment-0001.gif>
Works great now. Thanks for the fast response!
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Jim Deville
Sent: Wednesday, March 03, 2010 2:53 AM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
K, I''ve pushed. I guarantee it builds, but I pushed it before all the
tests finished since I have reasonable confidence in them. Looks good so far.
I''ll re-push tomorrow if needed.
JD
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Jim Deville
Sent: Tuesday, March 02, 2010 7:53 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
Yeah, between being sick and test changes, I haven''t pushed in a while.
I''ll do a push tonight and make sure the simple repro passes and ends
up as a test.
________________________________
From: Tomas Matousek <Tomas.Matousek at microsoft.com>
Sent: Tuesday, March 02, 2010 7:47 PM
To: ironruby-core at rubyforge.org <ironruby-core at rubyforge.org>
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
This works for me, so I guess the fix just isn''t on GIT yet.
Tomas
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Robert Walker
Sent: Tuesday, March 02, 2010 6:52 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
A simple case appears to reproduce the problem:
using System;
namespace DynamicTest
{
public class N : System.Dynamic.DynamicObject
{
public N()
{
}
public override bool TryGetMember(System.Dynamic.GetMemberBinder binder,
out Object result)
{
if (binder.Name == "Zot")
{
result = "hello world";
return true;
}
return base.TryGetMember(binder, out result);
}
}
}
And then ...
$LOAD_PATH <<
"D:\\Projects\\DynamicTest\\DynamicTest\\bin\\Debug"
require "DynamicTest.dll"
z =DynamicTest::N.new
z.Zot
>>> z.Zot
System.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError)
from (ir):1
---
Rob
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Tomas Matousek
Sent: Tuesday, March 02, 2010 6:00 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
It is a bug in DynamicObject for which I implemented a workaround in IronRuby
some time ago. So the build from latest sources should help.
Tomas
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Jim Deville
Sent: Tuesday, March 02, 2010 2:05 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby
Have you tried building Ruby directly? Get the sources from Github, then, from
the command line, run
c:\path\to\merlin\main\languages\ruby\scripts\dev.bat
rb
devenv ruby4.sln
Inside of VS build ruby4.sln then:
1) For basic testing, rbd will open a prompt for you to resume testing.
2) For using it then without the sources, rake package will generate the
release layout at c:\ironruby, which you can then copy to your desired location.
After 1.0, I''m going to look into making nightly drops available, but
that''s a little ways off.
If this still doesn''t work, it might be a bug :(
JD
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Robert Walker
Sent: Tuesday, March 02, 2010 1:22 PM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Consuming DynamicObjects in IronRuby
(All work done with VS2010 RC and matching IronRuby build (v0.9.40, 07-Feb-10)).
I have a C# assembly that implements a dynamic object. When I try to use this
object from Ruby I get the error:
>>> r.StdUnitCost
System.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError)
from (ir):1
This usage works fine from a test C# 4.0 app using the
''dynamic'' keyword.
I suspect that the issue is related to the version of the DLR in use -- there
are a number of ''InvalidOperationExceptions'' being thrown from
the Microsoft.Dynamic.dll and I believe this is no longer a shipping assembly
with .NET 4?
Is there a (simple) work around for this?
Thanks,
Rob Walker
Senior Software Architect
[cid:image001.gif at 01CABAB3.AD320810]<http://www.kinaxis.com/>
http://www.kinaxis.com
Kinaxis
700 Silver Seven Road
Ottawa, ON, Canada K2V 1C3
Office:
+1 613.592.5780 ext. 5282
Fax:
+1 613.592.0584
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20100303/90a05240/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 1706 bytes
Desc: image001.gif
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20100303/90a05240/attachment-0001.gif>
Jimmy Schementi
2010-Mar-31 06:36 UTC
[Ironruby-core] Consuming DynamicObjects in IronRuby
Also, a small repro would be useful ... I''m not sure how to recreate the assembly finding issues using. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, March 02, 2010 2:05 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Consuming DynamicObjects in IronRuby Have you tried building Ruby directly? Get the sources from Github, then, from the command line, run c:\path\to\merlin\main\languages\ruby\scripts\dev.bat rb devenv ruby4.sln Inside of VS build ruby4.sln then: 1) For basic testing, rbd will open a prompt for you to resume testing. 2) For using it then without the sources, rake package will generate the release layout at c:\ironruby, which you can then copy to your desired location. After 1.0, I''m going to look into making nightly drops available, but that''s a little ways off. If this still doesn''t work, it might be a bug :( JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Robert Walker Sent: Tuesday, March 02, 2010 1:22 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Consuming DynamicObjects in IronRuby (All work done with VS2010 RC and matching IronRuby build (v0.9.40, 07-Feb-10)). I have a C# assembly that implements a dynamic object. When I try to use this object from Ruby I get the error:>>> r.StdUnitCostSystem.Core:0:in `BindCore'': unbound variable: Param_0 (TypeError) from (ir):1 This usage works fine from a test C# 4.0 app using the ''dynamic'' keyword. I suspect that the issue is related to the version of the DLR in use -- there are a number of ''InvalidOperationExceptions'' being thrown from the Microsoft.Dynamic.dll and I believe this is no longer a shipping assembly with .NET 4? Is there a (simple) work around for this? Thanks, Rob Walker Senior Software Architect [cid:image001.gif at 01CAB992.6A7F4590]<http://www.kinaxis.com/> http://www.kinaxis.com Kinaxis 700 Silver Seven Road Ottawa, ON, Canada K2V 1C3 Office: +1 613.592.5780 ext. 5282 Fax: +1 613.592.0584 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100331/2a758d9e/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1706 bytes Desc: image001.gif URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100331/2a758d9e/attachment-0001.gif>