On Wed, Dec 20, 2000 at 04:03:39PM +0000, David Mitchell wrote:
> > >1. We no longer save conversions, so
> > >   $i="3"; $j+=$i for (...);
> > >does an aton() or similar each time round the loop
> > 
> > Well just the 1st time - then it is a number...
> 
> Err, option (1) was explicity suggesting we *dont* save the result
> of the conversion, so aton() *would* have to be called each time.
> (I didnt think this was sensible, I was just suggesting it
> for completeness...)

I think Nick is suggesting that we convert it and lose the string
as a side effect. I may be wrong
This would give you

$a="cheese";
printf "%d\n", $a;
print  "$a\n";

0
0

because the %d would trigger a conversion to integer which then replaces
the string. Not what is expected.
The only benefit this would bring is that both TomC and Ilya would agree
on something - that this is not desirable behaviour
(TomC because it's not backwards compatible, Ilya because you can alter
a scalar's value as a side effect of accessing it, so what a scalar
appears to contain becomes a function of its access history, not simply
and solely what you assigned to it)

Nicholas Clark

Reply via email to