Re: A replacement for lambda
- From: Reinhold Birkenfeld <reinhold-birkenfeld-nospam@xxxxxxxxxx>
- Date: Sat, 30 Jul 2005 14:55:19 +0200
Stefan Rank wrote:
> on 30.07.2005 10:20 Paolino said the following:
>> why (x**2 with(x))<(x**3 with(x)) is not taken in consideration?
>>
>> If 'with' must be there (and substitue 'lambda:') then at least the
>> syntax is clear.IMO Ruby syntax is also clear.
>>
>
> I am sorry if this has already been proposed (I am sure it has).
>
> Why not substitue python-lambdas with degenerated generator expressions::
>
> (lambda x: func(x)) == (func(x) for x)
>
> i.e. a one time callable generator expression (missing the `in` part).
> The arguments get passed into the generator, I am sure that can be
> combined with the PEP about passing args and Exceptions into a generator.
It's hard to spot, and it's too different to a genexp to have such a similar
syntax.
Reinhold
.
- Follow-Ups:
- Re: A replacement for lambda
- From: Seth Nielson
- Re: A replacement for lambda
- References:
- A replacement for lambda
- From: Mike Meyer
- Re: A replacement for lambda
- From: Christopher Subich
- Re: A replacement for lambda
- From: Stefan Rank
- A replacement for lambda
- Prev by Date: Re: Path inherits from basestring again
- Next by Date: Re: How can I run a program?
- Previous by thread: Re: A replacement for lambda
- Next by thread: Re: A replacement for lambda
- Index(es):
Relevant Pages
|