mutable default parameter problem [Prothon]

Christopher T King squirrel at WPI.EDU
Fri Jun 25 22:35:30 CEST 2004

Dave Brueck wrote:

> Seems like a waste to reserve a
> symbol for something so rarely needed.

Lisp and Scheme do the same thing:

(set! a 5)	<- sets a variable (i.e. changes its value)
(eq? a 6)	<- tests equality (returns true or false)

It's defined precisely because it's not needed often (at least in the ! 
case): the functions that modify their arguments are few and far between, 
so it is best to warn the programmer of this behaviour.

Though ? doesn't have such a pressing case as !, it does make code easier 
to read (distinguishing functions that do something from those that make 
simple queries).

More information about the Python-list mailing list