Of what use is 'lambda'???

Kragen Sitaker kragen at dnaco.net
Wed Sep 27 05:01:12 EDT 2000


In article <8FBC626EAduncanrcpcouk at 194.238.50.13>,
Duncan Booth <duncan at rcp.co.uk> wrote:
>Call by name, for those that have been fortunate enough to escape it, 
>allows you to give an expression as the argument to a function, but delays 
>the evaluation of the expression until it is used. A typical example if 
>python supported call-by-name might look like:
>
> [ Jensen's device variant ]
>
>Python, thankfully, returns 90 as the result. If it used call by name, it 
>would return 45.

I wasn't around when call-by-name was a current reality instead of a
historical curiosity, but I'd be surprised if Jensen's device were
really a "typical" use.
-- 
<kragen at pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Perilous to all of us are the devices of an art deeper than we ourselves
possess.
                -- Gandalf the Grey [J.R.R. Tolkien, "Lord of the Rings"]



More information about the Python-list mailing list