On Fri, Apr 25, 2008 at 01:07:29PM -0500, David Nicol wrote: > On Fri, Apr 25, 2008 at 5:17 AM, Nicholas Clark <nick@ccl4.org> wrote: > > > didn't do what I expected, because that constant string "constant" in the > > optree isn't constant. Well, it can't be written to, but it gets conversions > > cached on it. > > If conversions of constants were done early instead > of cached, there wouldn't even be the opportunity to warn. > > Do we have consensus on this issue? No, because then all constants would use a lot more memory: $ perl -MDevel::Peek -e 'sub a {Dump $_[0]; $_[0] + 0} a("pie") for 0,1' SV = PV(0x801168) at 0x80021c REFCNT = 1 FLAGS = (POK,READONLY,pPOK) PV = 0x2017c0 "pie"\0 CUR = 3 LEN = 4 SV = PVNV(0x803468) at 0x80021c REFCNT = 1 FLAGS = (IOK,NOK,POK,READONLY,pIOK,pNOK,pPOK) IV = 0 NV = 0 PV = 0x2017c0 "pie"\0 CUR = 3 LEN = 4 Nicholas ClarkThread Previous