http://qs321.pair.com?node_id=663805


in reply to Re^2: Scalars, Lists, and Arrays (run time)
in thread Scalars, Lists, and Arrays

> No, the comma operator is actually compiled exactly the same way.
Please reread the sentence you quoted. I did not say the comma operator is compiled differently. I said the scalar operator changes the way the program is compiled. And it does change the way the program is compiled, by causing the insertion of an additional op node into the optree.

Then I said that the change to the way the program was compiled causes the comma operator to return its second operand, instead of constructing a list value. As you explained, the additional op node has precisely this effect.

  • Comment on Re^3: Scalars, Lists, and Arrays (run time)

Replies are listed 'Best First'.
Re^4: Scalars, Lists, and Arrays (run time)
by tye (Sage) on Jan 23, 2008 at 15:43 UTC

    I could buy that weaseling out if you had said those things in the order in which I had quoted them. But the first thing you said about compile/run time was:

    because all contextual effects occur at compile time, never at run time

    So forget my complaint about your subsequenty statement (which I find misleading but can be awkwardly interpretted as "correct" as you note, especially if you ignore the above phrase).

    You could claim that contexts are created at compile time but the effects of those contexts clearly must at least sometimes be applied at run time (since contexts get passed in to subroutines) and, in current versions of Perl, most if not all contextual effects occur at run time (nearly the opposite of what you claimed).

    - tye