On Wed, Jun 22, 2005 at 11:10:51PM +0100, Dave Mitchell wrote: > On Tue, Jun 14, 2005 at 10:45:17PM +0100, Dave Mitchell wrote: > > On Fri, Jun 10, 2005 at 11:04:36AM +0100, Dave Mitchell wrote: > > > I'm vaguely assuming that for tieing, during localization you would *copy* > > > the magic; then at restore time you just ditch any magic on the new SV, > > > and stick the old SV back into the typeglob with its current magic > > > intact. ie > > > > I now have a working patch that does just that > > and now applied as change #24942
Two further things related to this. 1) I have added an mg_localize() function, which can be viewed as part of familily of functions that include mg_copy() and mg_dup(). Now, the mgvtbl structure happens to have been extended to have function pointers svt_copy and svt_dup which allow a particular magic to override the standard mg_copy() and mg_dup(); but to provide bincompat, these functions are only called if the MGf_COPY or MGf_DUP flags are set. Currently I believe threads::shared is the only part of the core to provide these hooks. I propose, by analogy, to provide a similar hook for mg_localize(); although I haven't checked closely; I think my patch currently breaks local $shared_var; If I don't hear any complaints, I'll do this in a few days time. 2) Nicholas, my patch is specifically supposed to fix all the $#foo problems; an earlier email of yours included a test file for this; do you want me to add it to bleed or leave it to you? -- "Strange women lying in ponds distributing swords is no basis for a system of government. Supreme executive power derives from a mandate from the masses, not from some farcical aquatic ceremony." -- Dennis - Monty Python and the Holy Grail.