Origin of the term "first-class object"
Rainer Deyke
rainerd at eldwood.com
Tue Nov 18 14:10:10 EST 2003
More information about the Python-list mailing list
Tue Nov 18 14:10:10 EST 2003
- Previous message (by thread): Origin of the term "first-class object"
- Next message (by thread): Origin of the term "first-class object"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Aahz wrote: >> l[x * 2 + f(y)] = f(l[x * 2 + f(y)]) >> >> This statement contains an obvious redundancy that will make code >> maintenance difficult. Python allows me to factor out some of the >> redundancy: >> >> index = x * 2 + f(y) >> l[index] = f(l[index]) >> >> However, Python gives me no way to factor out the remaining >> redundancy. > > Sure it does: change the immutable to a mutable. Not good enough. I'd rather write "l[x] = f(l[x])" with all of its redundancy than wrap every conceivable immutable object in a mutable wrapper. Besides, I don't *want* 'f' to change an object (which may also be referenced elsewhere); I want it to change a binding. And, really, "l[x] = f(l[x])" isn't that big of a deal. It's a bit of redundancy that I'd rather not have, but it's not bad enough that I feel the need to do anything about it. -- Rainer Deyke - rainerd at eldwood.com - http://eldwood.com
- Previous message (by thread): Origin of the term "first-class object"
- Next message (by thread): Origin of the term "first-class object"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list