Python syntax in Lisp and Scheme

Terry Reedy tjreedy at udel.edu
Tue Oct 14 11:21:54 EDT 2003


"Paul Foley" <see at below.invalid> wrote in message
news:m2zng4w05m.fsf at mycroft.actrix.gen.nz...
> True enough.  Naming things is a pain though.  Imagine if you
couldn't
> use numbers without naming them: e.g., if instead of 2 + 3 you had
to
> do something like
>
>   two = 2
>   three = 3
>   two + three

For float constants in a language (such as Fortran) with multiple
float types (of different precisions), naming as part of a declaration
of precision is (or at least has been) a standard practice in some
circles.  It makes it easy to change the precision used throughout a
program.

> [Mind you, Python's lambda is next to useless anyway]

It is quite useful for its designed purpose, which is to abbreviate
and place inline short one-use function definitions of the following
pattern: def _(*params): return <expression using params>.

However, making the keyword 'lambda' instead of something like 'func'
was a mistake for at least two reasons:
1) it confuses those with no knowledge of lambda calculus and for whom
it is an strange, arbitrary term, possibly conjuring images of little
sheep, rather than being familar and mnemonic;
2) it raises unrealistic expectations in who know of 'lambda' as an
anonymous version of 'defun' (or whatever), leading them to make
statements such as the above.

Terry J. Reedy






More information about the Python-list mailing list