[Python-ideas] One more time... lambda function <--- from *** signature def.

David Townshend aquavitae69 at gmail.com
Tue Mar 4 10:07:28 CET 2014


On Tue, Mar 4, 2014 at 9:26 AM, Bruce Leban <bruce at leapyear.org> wrote:

>
>
> On Mar 3, 2014, at 22:02, David Townshend <aquavitae69 at gmail.com> wrote:
>>
>> What about a new code literal object, e.g.
>>
>>     thunk = c'x + 3'
>>     thunk(x=2)
>>
>> This already exists.
>
>     thunk = lambda: x + 3
>     thunk(x=2)
>
> Your original post in this thread wanted to allow functions to magically
> capture their parameters as code (~ call by name) and it's been pointed out
> that that is incompatible with the way the language is designed and
> function calls are implemented. Yes, there are languages where the called
> function gets to tell the caller how to package arguments but Python isn't
> one of them.
>
> Now you seem to have veered in a different direction. I have no idea what
> problem you are trying to solve.
>
>
This is my first post in this thread - I don't recall who the OP was, but
it wasn't me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140304/d05a0fe2/attachment-0001.html>


More information about the Python-ideas mailing list