Re: [IronPython] IP 2: Execute multiple expression in different scopes

2008-08-19 Thread Curt Hagenlocher
There's an "Operations" property on the ScriptEngine that returns an ObjectOperations object. On Tue, Aug 19, 2008 at 9:26 AM, Christian Schmidt < [EMAIL PROTECTED]> wrote: > Hi Dino, > > Is there a reason ObjectOperations.Call(scope.GetVariable("Process"), >> args) doesn't work? >> > > It seems

Re: [IronPython] IP 2: Execute multiple expression in different scopes

2008-08-19 Thread Christian Schmidt
Hi Dino, Is there a reason ObjectOperations.Call(scope.GetVariable("Process"), args) doesn't work? It seems that ObjectOperations does not have a static method Call. Where do I get an ObjectOperations instance from? I found another solution: Delegate process = scope.GetVariable("process")

Re: [IronPython] IP 2: Execute multiple expression in different scopes

2008-08-19 Thread Dody Gunawinata
8 7:50 AM > To: [EMAIL PROTECTED]; Discussion of IronPython > Subject: Re: [IronPython] IP 2: Execute multiple expression in different > scopes > > Hi Dody, > > thanks for your patience. > > > delegate System.Int32 FunctionProcess(System.Int32[] parameters) > > > > Th

Re: [IronPython] IP 2: Execute multiple expression in different scopes

2008-08-19 Thread Dino Viehland
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christian Schmidt Sent: Tuesday, August 19, 2008 7:50 AM To: [EMAIL PROTECTED]; Discussion of IronPython Subject: Re: [IronPython] IP 2: Execute multiple expression in different scopes Hi Dody, thanks fo

Re: [IronPython] IP 2: Execute multiple expression in different scopes

2008-08-19 Thread Christian Schmidt
Hi Dody, thanks for your patience. delegate System.Int32 FunctionProcess(System.Int32[] parameters) This assumes that your Python implement will only do integer operation. If you are going to use the delegate for generic holder of arguments, don't forget to cast for example: delegate objec

Re: [IronPython] IP 2: Execute multiple expression in different scopes

2008-08-19 Thread Dody Gunawinata
delegate System.Int32 FunctionProcess(System.Int32[] parameters) This assumes that your Python implement will only do integer operation. If you are going to use the delegate for generic holder of arguments, don't forget to cast for example: delegate object FunctionProcess(object[] parametser) py

Re: [IronPython] IP 2: Execute multiple expression in different scopes

2008-08-19 Thread Dody Gunawinata
http://www.c-sharpcorner.com/UploadFile/rambab/Assembly04292006002740AM/Assembly.aspx?ArticleID=69edb807-8118-4933-8366-773e87ee80ad On Tue, Aug 19, 2008 at 4:50 PM, Christian Schmidt < [EMAIL PROTECTED]> wrote: > Hi Dody, > > If you are not using this in a .Net 3.5 website project, you can use

Re: [IronPython] IP 2: Execute multiple expression in different scopes

2008-08-19 Thread Christian Schmidt
Hi Dody, thanks for your help. > delegate object FunctionProcess(object[] params); I've already tried this one and also delegate object FunctionProcess(params object[] p); > scope.GetVariable ("Process") But get an ArgumentException ("Invalid type of return expression value at 0:0-0:0") here

Re: [IronPython] IP 2: Execute multiple expression in different scopes

2008-08-19 Thread Christian Schmidt
Hi Dody, > If you are not using this in a .Net 3.5 website project, you can use alias to deal with this Beta 4 issue. I'm not using IP2 in a website project, but would like to use it in a 3.5 project. How do I have to set this alias? Thanks, Christian ___

Re: [IronPython] IP 2: Execute multiple expression in different scopes

2008-08-19 Thread Dody Gunawinata
If you are not using this in a .Net 3.5 website project, you can use alias to deal with this Beta 4 issue. On Tue, Aug 19, 2008 at 2:12 PM, Christian Schmidt < [EMAIL PROTECTED]> wrote: > Hi Dody, > > scope.GetVariable> ("Process") >> > > The problem is that I do not know the number of arguments

Re: [IronPython] IP 2: Execute multiple expression in different scopes

2008-08-19 Thread Dody Gunawinata
delegate object FunctionProcess(object[] params); scope.GetVariable ("Process") and modify your Python code to deal with the object[] params. On Tue, Aug 19, 2008 at 2:12 PM, Christian Schmidt < [EMAIL PROTECTED]> wrote: > Hi Dody, > > scope.GetVariable> ("Process") >> > > The problem is that

Re: [IronPython] IP 2: Execute multiple expression in different scopes

2008-08-19 Thread Christian Schmidt
Hi Dody, scope.GetVariable> ("Process") The problem is that I do not know the number of arguments at compile time but at runtime. So I need something like Func. Anyway, this would only work if running on framework 3.5, which I can't because of the problems brought up by Fernando Correia -

Re: [IronPython] IP 2: Execute multiple expression in different scopes

2008-08-19 Thread Dody Gunawinata
scope.GetVariable> ("Process") On Tue, Aug 19, 2008 at 12:09 PM, Christian Schmidt < [EMAIL PROTECTED]> wrote: > Hi Curt, > > thanks for your answer. It's an interesting idea, to hand over the items as > function arguments. I was trying to add them to the ScriptScope. > > But I'm still stuck with

Re: [IronPython] IP 2: Execute multiple expression in different scopes

2008-08-19 Thread Christian Schmidt
Hi Curt, thanks for your answer. It's an interesting idea, to hand over the items as function arguments. I was trying to add them to the ScriptScope. But I'm still stuck with calling the function: ScriptScope scope = ScriptRuntime.Create().GetEngine("py").CreateScope(); scope.Execute("from

Re: [IronPython] IP 2: Execute multiple expression in different scopes

2008-08-18 Thread Curt Hagenlocher
I wouldn't say that there's any "right" way to do this, but given the requirements as stated, I'd probably build a single Python function that accepts all n attributes and returns m values, where n is the number of names/values and m is the number of expressions. So for the code below, I'd dynamic

[IronPython] IP 2: Execute multiple expression in different scopes

2008-08-11 Thread Christian Schmidt
Hi, I'm trying to figure out the best way to embed IP 2 expressions into C# to implement the following: I have given a scope that consists of an IList and a mapping of the list's indices to a name. Now I want to evaluate several expressions within this scope. After this, the scope changes, but