mutable default parameter problem [Prothon]

Dave Brueck dave at pythonapocrypha.com
Fri Jun 25 16:45:48 EDT 2004


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

An apples-to-oranges comparison, IMO - it makes sense to delimit a side
effect in a functional language.

-Dave





More information about the Python-list mailing list