Python syntax in Lisp and Scheme

Hartmann Schaffer hs at heaven.nirvananet
Tue Oct 14 12:31:02 EDT 2003


In article <6mWdnVM6bOIOiRGiU-KYhA at comcast.com>,
	"Terry Reedy" <tjreedy at udel.edu> writes:
> ...
>>   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.

this is a good practice when the literals are parameters that you want
to change occasionally.  other reasons why you want to do that is that
typing certain constants (e.g. pi or e) is error prone, so writing
them down once and binding them to a (descriptive) name is preferrably
to having to type them repeatedly.  but unless they play a parameter
role, binding short literals to name doesn't serve any purpose

>> [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>.

the last version of python i used was 1.5.x, and then the absence of
closures made the anonymous functions pretty useless

> ...

hs

-- 

ceterum censeo SCO esse delendam




More information about the Python-list mailing list