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

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

Thread Previous | Thread Next
From:
Nick Ing-Simmons
Date:
October 2, 2000 10:26
Subject:
Re: Did change 1307 (GSAR) break self ties?
Message ID:
200010021725.SAA13498@mikado.tiuk.ti.com
Nicholas Clark <nick@ccl4.org> writes:
>> 
>> 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?]

As I said in earlier mail - there is code in mg.c i.e. mg_get
which does 

save_magic();
...
restore_magic();

And there is MGf_GSKIP which is tested as well.

But the code for FETCH does: 

int
Perl_magic_getpack(pTHX_ SV *sv, MAGIC *mg)
{
    magic_methpack(sv,mg,"FETCH");
    if (mg->mg_ptr)
	mg->mg_flags |= MGf_GSKIP;
    return 0;
}

i.e. it sets the "skip" flag _after_ calling the method - which seems odd.

>
>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?
>
>Nicholas Clark
-- 
Nick Ing-Simmons <nik@tiuk.ti.com>
Via, but not speaking for: Texas Instruments Ltd.


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