From: Eric Hodel Date: 2005-02-03T16:19:59+09:00 Subject: Re: [Terminology] What's the Ruby/OO name for this paradigm? --Apple-Mail-44-258959299 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 02 Feb 2005, at 21:53, E S wrote: > In my current project, one of the main paradigms is code such as in > the following example. I'm wondering if there's a Ruby/OO designation > for it so that I wouldn't have to always show some excerpt when > describing the project. It's sort of an inverse continuation passing > scheme (which, in itself, isn't exactly a prime OO term). > > def three() > return lambda { |s1, s2| puts s1 + s2 } > end > > def two() > return lambda { |s1| three().call(s1, 'world!') } > end > > def one() > return lambda { two().call('Hello ') } > end > > one().call # "Hello world!" Its called "Currying". http://c2.com/cgi/wiki/Curry?CurryingSchonfinkelling Not an OO term, but a functional programming term. > Anything? Input on the style welcome, too, by the way: is this hard to > understand/unintuitive/there's a better way/etc.? -- Eric Hodel - drbrain@segment7.net - http://segment7.net FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --Apple-Mail-44-258959299 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iD8DBQFCAdCLMypVHHlsnwQRAlQ6AJ9xeMD5EGAjf6ySwPNkGGnBUvAzOQCeM5FX qrym2FH4SvsC+L4GMQTDGFY= =QX7h -----END PGP SIGNATURE----- --Apple-Mail-44-258959299--