On Wed, Jan 17, 2001 at 02:39:52PM +0000, Simon Cozens wrote: > On Wed, Jan 17, 2001 at 02:21:34PM +0100, Johan Vromans wrote: > > Stephen McCamant <smcc@CSUA.Berkeley.EDU> writes: > > > > > IMHO, pp_pre(inc|dec) were written the way they are now for a reason > > > (namely efficiency), and it isn't worth slowing them down just to make > > > some pathological examples more intuitive. > > > > And, my dear Stephen, how much is the slowdown for an average Perl > > program? > > I'm of the opinion that if people think that writing > > (++$a, ++$a) > > is a good idea, then they're fundamentally confused anyway. Slowing > Perl down isn't going to unconfuse them. I don't agree that they are confused. C has a documented concept of "undefined" (and a spec) perl only has implementation defined behaviour, and no comprehensive spec. for $a=2 (++$a, ++$a) could easily mean 2 things (3, 4) if I assume that arguments get evaluated left to right (not an unreasonable assumption, but if people should not make this we need to document it) (4, 3) or (3, 4) if I assume that argument get evaluated in some order. I'm not worried what that order is, but I am assuming that one is fully evaluated before the other's evaluation starts. However, (4, 4) isn't intuitive, unless you are a *good* C programmer. [bad C programmers will assume one of the above] Nicholas ClarkThread Previous | Thread Next