From: Maurice Codik Date: 2006-05-18T23:54:07+09:00 Subject: Re: [OT] Partial functions? ------=_Part_4986_23051427.1147964043665 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline This feature is very similar to currying: http://en.wikipedia.org/wiki/Currying which is common in many functional languages (ex, ML automatically curries for you). I can't really think of a good usecase off the top of my head, but searchin= g around for currying examples may help. Maurice On 5/18/06, Berger, Daniel wrote: > > Hi all, > > I'm trying to understand a new feature of Python 2.5 (PEP 309) called > "partial functions". Here's the Python example I pulled from Vincent > Foley's blog: > > import functional > > def multiply(x, y): > return x * y > > multiply_by_3 =3D functional.partial(multiply, 3) > > multiply_by_3(4) #=3D> Will return 12 > > I understand what it's doing, I just don't understand what purpose of > partial functions would be. Can someone provide a use case for me? > > Also, can/should we do this in Ruby? > > Regards, > > Dan > > > This communication is the property of Qwest and may contain confidential > or > privileged information. Unauthorized use of this communication is strictl= y > prohibited and may be unlawful. If you have received this communication > in error, please immediately notify the sender by reply e-mail and destro= y > all copies of the communication and any attachments. > > --=20 http://blog.mauricecodik.com ------=_Part_4986_23051427.1147964043665--