On 5/7/05, PhiHo Hoang <[EMAIL PROTECTED]> wrote: > Greetings, > > Does IronPython support lambda form ? > > Is this make_inc correct ? > > Thanks, > > PhiHo > > >>> def make_inc(n): > ... return lambda x : x + n > ... > >>> f = make_inc(100) > >>> f(1) > IronPython.Objects.PythonNameError: name 'n' is not defined > at IronPython.Objects.Frame.GetGlobal(String name) > at input_98.lamda$0$f10(Object x) > at IronPython.Objects.Function1.Call(Object arg0) > at IronPython.Objects.Ops.Call(Object func, Object arg0) > at input_100.Run(Frame frame) > at IronPython.Hosting.PythonEngine.DoOneInteractive(Frame topFrame) > at IronPython.Hosting.PythonEngine.RunInteractive() > >>> > _______________________________________________ > users-ironpython.com mailing list > users-ironpython.com@lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >
That works on CPython so I'd say it's a bug. -- Travis Watkins http://www.realistanew.com _______________________________________________ users-ironpython.com mailing list users-ironpython.com@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com