About a month ago, a thread here suggested that we change the meaning of
the comma operator.  Currently, in scalar context the expression
    foo(), bar()
means "evaluate foo(), discard the result, then return the value of bar()".
It was suggested that this be changed to return the 2-element array (foo(),
bar()).  Has Larry ruled on this yet?

    By the way, even if we do make this change, I think that in void context
the expression
    foo(), bar()
should still simply evaluate its parameters in order for their side-effects.
This would allow comma expressions to remain as-is in loop statements
(formerly for statements), which is where most of them are found anyway.
For instance
    loop (my ($x = 0, $y = 10); $x < $y; ++$x, --$y) {...}

Joe Gottman


Reply via email to