To use Func you just need to do:
import clr
clr.AddReference('System.Core')
from System import Func
Func[object, object](targetCallableHere)
This is equivalent to CallTarget1. You can add more "object, " or you can
replace object with some other type.
From: [email protected]
[mailto:[email protected]] On Behalf Of Brian Curtin
Sent: Monday, September 14, 2009 10:53 AM
To: Discussion of IronPython
Subject: Re: [IronPython] CallTargetX delegates
How would someone replace CallTargetX with Func<...> within a script? For
example, how would you change the Invoke calls in onChanged and onRenamed here:
http://www.ironpython.info/index.php/Invoking_onto_the_GUI_%28Control%29_Thread
I've never seen how to use Func within an IP script, just within C#.
On Wed, Sep 2, 2009 at 04:59, Davy Mitchell
<[email protected]<mailto:[email protected]>> wrote:
Could someone pop an example of this on http://www.ironpython.info?
Sounds like it could be a common 'gotcha' especially for newbies
running old example code.
Cheers,
Davy
On Wed, Sep 2, 2009 at 6:38 AM, David
Escobar<[email protected]<mailto:[email protected]>> wrote:
> Ok cool. I've used Func<> from C# before. That did the trick. Thanks.
>
>
> On Tue, Sep 1, 2009 at 6:19 PM, Dino Viehland
> <[email protected]<mailto:[email protected]>> wrote:
>>
>> Yes. CallTarget's were really a part of IronPython's internal calling
>> convention for used defined functions. We kept CallTarget0 around because
>> we knew lots of users had come to depend on that one when they needed a
>> delegate type. But we removed all the others and switched to using Func<...>
>> internally. Ideally you can switch to using Func<> as well.
>>
>>
>>
>> From:
>> [email protected]<mailto:[email protected]>
>> [mailto:[email protected]<mailto:[email protected]>]
>> On Behalf Of David Escobar
>> Sent: Tuesday, September 01, 2009 5:41 PM
>> To: Discussion of IronPython
>> Subject: [IronPython] CallTargetX delegates
>>
>>
>>
>> In IronPython 2.6 beta 2, did the CallTargetX delegates get moved to
>> another module or were they simply removed altogether? The only delegate in
>> IronPython.Compiler is CallTarget0. I checked IronPython 2.0.2 and it has up
>> to CallTarget16.
>
> _______________________________________________
> Users mailing list
> [email protected]<mailto:[email protected]>
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
--
--
Davy Stuff - http://daftspaniel.blogspot.com
Geeky Stuff - http://daftpython.blogspot.com
Davy's Ironpython Editor - http://code.google.com/p/davysironpythoneditor/
_______________________________________________
Users mailing list
[email protected]<mailto:[email protected]>
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com