auto increment operator??

Thomas Wouters thomas at xs4all.net
Tue May 30 07:21:03 EDT 2000


On Mon, May 29, 2000 at 08:49:36PM -0700, Dennis Lee Bieber wrote:

> The x++, x-- type operators were naturals for C, as C was sort
> of a super-assembly in its origins; and the original C hardware
> incorporated instructions just for increment/decrement. 

Actually, this isn't true. C had the auto-increment operators because B had
it, and B (and C ? i forget) were first developped on the PDP-7. The PDP-7
did not have the auto-increment assembler instruction -- the PDP-11 did,
but B and C didn't get ported to that machine until later.

Not that it isn't a very helpful operator, in C, regardless of the
underlying assembler :-) I would like to see the +=-style operators in
Python, as they (imho) clearly fit in, and using '+= 1' is not that much
more typing than '++'. It also stays an assignment statement, and it still
*looks* like an assignment operator. I hope Guido or someone with Guido's
ear (or permission) in time grabs Michael Hudsons' patch and incorporates it
into the CVS tree... Hopefully even before 1.6, but I'm not putting up any
bets ;-P

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list