<div dir="ltr">scope.GetVariable<Func<int,int,int,int>> ("Process")<br><br><div class="gmail_quote">On Tue, Aug 19, 2008 at 12:09 PM, Christian Schmidt <span dir="ltr"><<a href="mailto:christian2.schmidt@gmx.de">christian2.schmidt@gmx.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Curt,<br>
<br>
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.<br>
<br>
But I'm still stuck with calling the function:<br>
<br>
ScriptScope scope =<br>
ScriptRuntime.Create().GetEngine("py").CreateScope();<br>
scope.Execute("from math import *");<br>
scope.Execute(@"<br>
def process(a, b, c):<br>
return [a+b, sqrt(b*c)]<br>
");<br>
object process = scope.GetVariable("process");<br>
foreach(object[] row in data)<br>
object[] result = process(row); // ??<br>
<br>
How do I call the function?<br>
<br>
I have some further question regarding this approach:<br>
<br>
1. Will the function be interpreted on each call or is it compiled?<br>
2. Is the number of arguments limited? I could have up to 200 arguments.<br>
<br>
Meanwhile I've tried the CustomSymbolDictionary way, but couldn't find any helpful tutorial.<br>
<br>
Thanks for your time,<div><div></div><div class="Wj3C7c"><br>
Christian<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><a href="http://nomadlife.org">nomadlife.org</a><br><br>
</div>