anything like C++ references?

Moshe Zadka m at
Wed Jul 16 19:51:20 CEST 2003

On Wed, 16 Jul 2003, Michael Chermside <mcherm at> wrote:

>     stuff[i] = newComplexObject(i++, "name", "fred")

I'm not entirely sure that C code is not undefined. I think it
is, but it could be that I'm mistaken and that "=" is a "sequence point".
It's a variant on the old


thing. The problem here is that it's not certain what happens first --
the a[i] (evalating to an lvalue) or i++. Since an optimizing compiler
might even put both instruction in a single pipeline, it could be that
i is neither the old value or the new value at all by the time a[i]
is on the stack. In fact, the C standard, if I'm right, gives the C
compiler carte blanche to do whatever it feels like doing.

In Python, you'd've been forced to write

stuff[i] = nCO(i)


stuff[i] = nCO(i)


stuff[i] = nCO(j)

depending on what you meant.
Moshe Zadka --
Buffy: I don't like you hanging out with someone that... short.
Riley: Yeah, a lot of young people nowadays are experimenting with shortness.
Agile Programming Language --

More information about the Python-list mailing list