lambdak: multi-line lambda implementation in native Python

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sat Jan 17 13:49:24 CET 2015


Jussi Piitulainen wrote:

> I've only seen small amounts of Ruby code on the net. The only way I
> can make some sense of that is if it gets analyzed as follows, using
> parentheses for calls:
> 
>  a + b => 7  # a() + b => a(4) + b => 4 + 2 + 1
>  a+b   => 7  # a() + b
>  a+ b  => 7  # a() + b
>  a +b  => 3  # a(+b)   => a(b) => a(1) = 1 + 2
> 
> I'm not quite fond of such surprise in programming language syntax.

Full marks!



-- 
Steven




More information about the Python-list mailing list