Why doesn't this simple Curry-like implemention work?

Michael R. Head burner at core.binghamton.edu
Sun Oct 28 01:30:22 EST 2001


# for some reason this function doesn't work in python 1.5.2.
def curry(f, p):
	return lambda x: apply(f, p, x)

I've looked up on the list better class-based implementations, and am
using one of them, but I'm curious why this doesn't work (when the
curried function is called, f becomes unknown). (I'm looking for a
reason in the language spec). I'm supposing that lamda isn't storing
the reference to its inputs -- which it seems it should -- is this
correct?

mike

-- 
Michael R. Head
burner at core.binghamton.edu
GPG public key: http://www.core.binghamton.edu/~burner/gpg.key.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 536 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20011028/66ac113b/attachment.sig>


More information about the Python-list mailing list