RE: [IronPython] function thread target delegates

2005-08-06 Thread Keith J. Farmer
I *knew* there had to be a way to create a Delegate object :) Delegates are great. They're what you get when you create a DynamicMethod using Lightweight Code Generation. You can put them to interesting uses (IronPython, getting around the lack of operator overloads in generics, etc). - Keith

Re: [IronPython] function thread target delegates

2005-08-06 Thread Anthony Tarlano
Keith, Thanks for your insight and reply. I found that it works if instead of using generics, I just wrapped the function as an ParameterizedThreadStart instance.. Take a look: Anthony IronPython 0.9.2036 on .NET 2.0.50215.44 Copyright (c) Microsoft Corporation. All rights reserved. >>> from S

RE: [IronPython] function thread target delegates

2005-08-06 Thread Keith J. Farmer
Okay, had a brief check. You should take a look at delegates. They're not the same as passing around Python methods. In particular, they're typed. The type of a delegate is its signature. In particular: ThreadStart -> void foo() ParameterizedThreadStart -> void foo(object) The Thread constructo

[IronPython] function thread target delegates

2005-08-06 Thread Anthony Tarlano
I have a quick question regarding threads and IronPython. I need to code a python function having an input parameter to be the target delegate of a newly created thread using the ThreadStart method to pass the parameter. Here an example of the code that fails: IronPython 0.9.2036 on .NET 2.0.50