auto increment operator??
Dennis Lee Bieber
wlfraed at ix.netcom.com
Mon May 29 23:49:36 EDT 2000
On Tue, 30 May 2000 00:01:39 GMT, "Fredrik Lundh" <effbot at telia.com>
declaimed the following in comp.lang.python:
> Bob van der Poel wrote:
> > First off, why are there no operators equivalent to C's
> > ++, --, +=, etc.? Very useful, and readable. Writing things
> > like: 'var = var+1' is getting old real fast.
>
> if you write things like "var = var + 1" a lot, you might be
> missing some important python idioms...
<snip>
Or, from a different angle (one who had to learn C on his own,
from a time when FORTRAN, COBOL, and assembly were king [Okay, BASIC
gets a nod too])...
If one does not find the time to program in C, why should one
have the right to insist that others languages incorporate C-like
operations?
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. Not all
subsequent processors had/have such instructions in their
architecture... Nor is "increment" (or add&assign) meaningful to many
objects in an OO type language.
--
> ============================================================== <
> wlfraed at ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
> wulfraed at dm.net | Bestiaria Support Staff <
> ============================================================== <
> Bestiaria Home Page: http://www.beastie.dm.net/ <
> Home Page: http://www.dm.net/~wulfraed/ <
More information about the Python-list
mailing list