Re: How can I write code using FP

2007-01-16 Thread kernel1983
yeah! that's easy! althought no so clear a = lambda x,y:(x,y) b = lambda y:a(1,y) a(1,2) (1,2) b(2) (1,2) On 1月17日, 下午12时10分, Alejandro Dubrovsky <[EMAIL PROTECTED]> wrote: > kernel1983 wrote: > > In Function Program?Language can use like this: > > > define a function: > > f = lambda x,y:x,y >

Re: How can I write code using FP

2007-01-16 Thread Alejandro Dubrovsky
kernel1983 wrote: > In Function Program?Language can use like this: > > define a function: > f = lambda x,y:x,y > > then we use f to define another function: > f2 = f(1) > the f2 should equal to: > f2=lambda y:1,y > > we should be able call f2 with one parameter:f2(2) > just return 1,2 > > but

Re: How can I write code using FP

2007-01-16 Thread Dan Bishop
On Jan 16, 9:18 pm, "kernel1983" <[EMAIL PROTECTED]> wrote: > In Function Program,Language can use like this: > > define a function: > f = lambda x,y:x,y > > then we use f to define another function: > f2 = f(1) > the f2 should equal to: > f2=lambda y:1,y > > we should be able call f2 with one para

Re: How can I write code using FP

2007-01-16 Thread Leo Jay
On 16 Jan 2007 19:18:19 -0800, kernel1983 <[EMAIL PROTECTED]> wrote: In Function Program,Language can use like this: define a function: f = lambda x,y:x,y then we use f to define another function: f2 = f(1) the f2 should equal to: f2=lambda y:1,y we should be able call f2 with one parameter:f

How can I write code using FP

2007-01-16 Thread kernel1983
In Function Program,Language can use like this: define a function: f = lambda x,y:x,y then we use f to define another function: f2 = f(1) the f2 should equal to: f2=lambda y:1,y we should be able call f2 with one parameter:f2(2) just return 1,2 but how can I implement the characteristic in Pyth