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:16
Subject:
Re: Did change 1307 (GSAR) break self ties?
Message ID:
39D8C2EE.B2EE4908@uk.sun.com
Gurusamy Sarathy wrote:

> >> I doubt that change#1307 is the problem--we call sv_mortalcopy() in
> >> lots of other situations.
> >
> >Yes, but not where tied magic is involved.
> 
> How do you know?  sv_mortalcopy() is called *unconditionally* in lots
> of places (when returning values from a subroutine, or in C<($x,@a) = @a>,
> for instance).

Sorry - what I mean is that the code in pp_aelem specifically checks for
magic and then calls sv_mortalcopy only if the sv is magical.  If it is
not magical the call to sv_mortalcopy doesn't happen.

> >Shouldn't tie magic be disabled when retrieving from the array
> >'underneath' a tie?  Unless this is done, self-ties cannot ever work.
> >If self-ties are deemed to be unsupported, then pp_tie should detect and
> >attemt to do so and croak.  That is certainly the easiest option.  I'm
> >happy to have a crack at getting them to work correctly, but I'd need
> >someone with a sufficiently pointy hat to make some suggestions as to
> >how to do it.
> 
> Code always makes people talk. :-)

And a little guidance is likely to avoid wasted effort and frustration. 
At the moment the only patch I'm likely to submit will croak if it
detects a self-tie.  Is this what is wanted?

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