develooper Front page | perl.perl5.porters | Postings from October 2000

Re: Did change 1307 (GSAR) break self ties?

Thread Previous | Thread Next
From:
Alan Burlison
Date:
October 2, 2000 10:07
Subject:
Re: Did change 1307 (GSAR) break self ties?
Message ID:
39D8C0BB.E8DEF13C@uk.sun.com
Nicholas Clark wrote:

> > Shouldn't tie magic be disabled when retrieving from the array
> > 'underneath' a tie?  Unless this is done, self-ties cannot ever work.
> 
> That would stop A-tiedto-B-tiedto-C working, surely?
> [But is A-tiedto-B-tiedto-C desirable?]

I was thinking of something like:

	disable_magic(sv)
	real_sv = sv_mortalcopy(sv);
	enable_magic(sv);

This should still allow nested magic to work, but should stop the
recursion.

> Is there anywhere for pp_tie to flag an object as active, so if you come
> back to it via a loop (A-tiedto-A or anything more complex) it doesn't
> use the tie method for a second (third (fourth (...))) trip?

That seems like the only workable fix.  However, I have no idea where
such a flag should go, and how to 'unwind' it when the tied access has
finished.  Personally I'd be content just to see self-ties and tie loops
made illegal.  However, at the moment the position WRT the supportedness
of self-ties is unclear.

-- 
Alan Burlison

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About