in reply to Re^10: Pre vs Post Incrementing variables
in thread Pre vs Post Incrementing variables
You are mistaken.
Nuh uh.
The first result in placed on the stack before the second is evaluated.
When the values are "placed on the stack" IS "before the subroutine gets whatever it is given.". It gets them when it takes them off the stack. And that can't happen until both have been placed on it.
And by the time they have both been placed on the stack, which even you'll have to agree is "before the subroutine get whatever it is given", both increments have occurred.
So, if (references to) the values resulting from the pre-increments were placed on the stack, instead of references to the preincremented variable, then the anomaly would not arise.
And the only thing that allows it have been implemented as is, and to have persisted, is the previously, exhaustively described missive.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^12: Pre vs Post Incrementing variables
by ikegami (Patriarch) on Sep 13, 2010 at 15:29 UTC | |
by BrowserUk (Patriarch) on Sep 13, 2010 at 16:00 UTC | |
by ikegami (Patriarch) on Sep 13, 2010 at 16:47 UTC |