iterative lambda construction

2005-02-21 Thread markscottwright
Just for the hell of it, I've been going through the old Scheme-based textbook Structure and Interpretation of Computer Programs and seeing what I can and can't do with python. I'm trying to create a function that returns the function (not the results of the function, but a function object) that

Re: iterative lambda construction

2005-02-21 Thread Paul Rubin
markscottwright [EMAIL PROTECTED] writes: But when I try to do it iteratively, it just hangs when I try to evaluate the results (for count 1): def repeated2(f, count): newfun = f for i in range(count-1): newfun = lambda x: newfun(f(x)) return newfun For the life of

Re: iterative lambda construction

2005-02-21 Thread Steven Bethard
markscottwright wrote: Just for the hell of it, I've been going through the old Scheme-based textbook Structure and Interpretation of Computer Programs and seeing what I can and can't do with python. I'm trying to create a function that returns the function (not the results of the function, but a

Re: iterative lambda construction

2005-02-21 Thread Jack Diederich
On Mon, Feb 21, 2005 at 01:14:00PM -0800, Paul Rubin wrote: markscottwright [EMAIL PROTECTED] writes: But when I try to do it iteratively, it just hangs when I try to evaluate the results (for count 1): def repeated2(f, count): newfun = f for i in range(count-1):