On Tue, Jul 13, 2010 at 06:55:33PM +0100, Ben Morrow wrote: > Quoth nick@ccl4.org (Nicholas Clark): > > On Tue, Jul 13, 2010 at 01:11:11PM +0000, ?var Arnfj?r? Bjarmason wrote: > > > > > Of course we can't liberally change things that are documented to be > > > undefined as liberally as a C compiler would, becuase there's only one > > > perl(1) but multiple cc(1)'s. > > > > But whatever we call it, that's the key problem. There is only one > > implementation, and as that implementation strives hard to internally avoid > > C undefined behaviour, its output will be deterministic, in some fashion. > > Hence people come to rely on the current behaviour of the implementation, > > documented or not. > > Quite. And > > print $i++, $i++; > > has DWIM forever (probably since perl 1). I'm not saying we *cannot* > change it, just that any change needs to be either only within the scope > of a lexical pragma or to go through a full deprecation cycle with > mandatory warnings before it changes. Actually, I added the explicite statement about undefinedness in the documentation, because not all expressions containing multiple $i ++ did DWIM for everyone, leading to lots of (pointless) discussions on what the 'right' value of complicated statements where supposed to be. $i = $j = 1; print $i ++, $i ++; # Prints 12. print ++ $j, ++ $j; # Prints 33. Both are really DWIM? AbigailThread Previous | Thread Next