[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Michael Vanier wrote:
> OTOH this is no problem for scheme or ruby.  Not that this is earth-shaking
> anyway, but I think it's a good argument against indentation-based syntax
> (which I like most of the time).

Except that the difficulties with python's lambda syntax are 
deliberate[1].  The stated intent is that any lambda that is 
sufficiently complex to cause problems should be promoted to
a named function in the same scope.

def Eq(x, y):
	if x == y:
		return 1
		return 0
reduce(Eq, [1,1,1,1])
reduce(Eq, [1,1,1,0])

Note that as you cannot use statements in a python lambda expression, 
there are a number of cases where this approach is not just a cultural 
preference, but mandated.

Andrae Muys

[1] A decision perpeptually debated on various python lists between 
those who consider it a 'blow in the cause of software maintainability', 
and those who consider it an unreasonable imposition on programmers 
ability to choose 'the right tool for the job'.[2]

Andrae Muys                       But can it generate *quantum* Haiku
<andrae.muys@braintree.com.au>    error messages, in Latin, where each
Engineer                          line of the error message is a
Braintree Communications          palindrome? -- Mike Vanier on perl