[IronPython] Lamba Expressions in IronPython
ben2004uk at googlemail.com
Mon Apr 7 01:54:44 CEST 2008
Just been playing around with C# and IronPython interop and I wanted
to define a lambda expression.
My CLR object is just a wrapper around a generic list (as generics
public class GenericWrapper : List<int>
I tried to do a lamba expression to pull back a item from the
collection, however I got the following exception:
>>> i = GenericWrapper()
>>> v = i.Find(item => item == 1)
File "", line 1
v = i.Find(item => item == 1)
SyntaxError: unexpected token '>'
I guess I can use a method\delegate like in C# 2.0, but is there any
way to do anything like Lamba Expressions? Or is there something
similar in Python?
Any help would be great.
More information about the Ironpython-users