[EMAIL PROTECTED] wrote:
>
It showed that there is a bug. I already reported it.
And I already replied ENOTABUG as promised ;-)
It's clear what the language should be doing in this situation and it isn't doing it, so it's broken. It's only not a bug in the sense that it's documented
to be broken.

Rob

> No, it is not "clear" what the language "should" be doing.

Of course it is. The operands of addition are evaluated from left to right; the
return value of a pre-increment is the value of the operand after it is
incremented; the return value of a post-increment is the value of the operand
before it is incremented; and pre- and post-increments have a higher priority
than additions. $a = 3; ++$a + $a++ _should_:

- increment $a to 4 and return 4
- increment $a to 5 and return 4
- add 4 and 4 and return 8

and it doesn't. It's broken.

> *EXACTLY AS IN C* multiple assignments within an expression is
> UNDEFINED behavior.

Yes. It's documented to be broken.

Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to