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.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy
  • Comment on Re^11: Pre vs Post Incrementing variables

Replies are listed 'Best First'.
Re^12: Pre vs Post Incrementing variables
by ikegami (Patriarch) on Sep 13, 2010 at 15:29 UTC

    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.

    It gets them on the stack as far as I'm concerned. That a function only gets it arguments after it copes them is a silly concept, considering functions can (and often do) work on the arguments directly on the stack.

    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

    There is no value resulting from the pre-increment to "reference". But if such a value were to be created (i.e. if $n were to be copied), then yes, that's correct. I mentioned this in my first post, so I think all's clear now?

      or are you being silly?

      Am I being silly! Me? You are the one that keeps telling me that I'm "mistaken", quoting passages that can not possible be wrong.

      You seem to perceptually misinterpret things that cannot possibly be misinterpreted. The only ways I can that happening so frequently, are if you are a) stupid; b) being deliberately obtuse; c) being deliberately contrary.

      And I know you are not stupid.

      All clear now?

      I have always been very clear. You are the only one who seems confused or ...


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        I have always been very clear. You are the only one who seems confused or ...

        All I've been doing is explaining what Perl does to you. Now that you finally repeated what I said originally, you're saying I'm confused? Could you please identify what part of what we said is different from what Perl does? If my knowledge of what Perl does is incorrect, I'd like to know.