[IronPython] More fun with delegates

Dino Viehland dinov at microsoft.com
Fri Nov 21 05:21:33 CET 2008

System.Windows.Threading.Dispatcher.BeginInvoke in Silverlight has an overload which takes a System.Action.  In .NET 3.5 it seems to only have overloads which take Delegate.  So on the desktop CLR we don't have any idea of what type of delegate to convert it to vs. Silverlight we know to go to Action.

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff
Sent: Thursday, November 20, 2008 8:12 PM
To: Discussion of IronPython
Subject: Re: [IronPython] More fun with delegates

On Thu, Nov 20, 2008 at 4:33 PM, Srivatsn Narayanan
<srivatsn at microsoft.com> wrote:
> Hi Dan,
>  The parameterless Action is actually defined in System.Core.dll so you need to reference that. The crash ofcourse needs to be fixed. There is already a bug on that - http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=19133

Ok, I understand that now. But what about this?

>>> def echo(x):
...     print x
>>> d.BeginInvoke(echo, 2)
TypeError: expected Delegate, got function

It works fine on Silverlight.

Users mailing list
Users at lists.ironpython.com

More information about the Ironpython-users mailing list