mutable default parameter problem [Prothon]
Dave Brueck
dave at pythonapocrypha.com
Fri Jun 25 16:45:48 EDT 2004
More information about the Python-list mailing list
Fri Jun 25 16:45:48 EDT 2004
- Previous message (by thread): mutable default parameter problem [Prothon]
- Next message (by thread): mutable default parameter problem [Prothon]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message (by thread): mutable default parameter problem [Prothon]
- Next message (by thread): mutable default parameter problem [Prothon]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list