develooper Front page | perl.perl5.porters | Postings from July 2001

Re: [PATCH sv.c] mortal doc thinko

Thread Previous | Thread Next
From:
Nick Ing-Simmons
Date:
July 30, 2001 06:21
Subject:
Re: [PATCH sv.c] mortal doc thinko
Message ID:
20010730132122.11518.3@bactrian.ni-s.u-net.com
Dave Mitchell <davem@fdgroup.co.uk> writes:
>Nick Ing-Simmons <nick@ing-simmons.net> wrote:
>> >(I wanted to get rid of the word "context", since that has specific
>> >connotations in the internals).
>> 
>> In my (possibly confused) tiny mind the meaning of "context" 
>> that is specific to the internals includes "when mortals get freed".
>> That is SAVETMPS (which is paired with FREETMPS) is pushed onto 
>> the "context" stack. It is true that not all context exits free
>> mortals, but the two operations are related.
>
>I was thinking of context as being 'something pushed onto the context
>stack' an entity which I have only the haziest notion about, but which
>appears to be longer-lasting than the tmps stack. eg { foo; bar; baz }
>has 3 calls to FREETMPS, but only one context (ignoring what foo etc
>themselves may get up to). That's why I thought my original use of 'context'
>was misleading.

It is confusing I agree - your idea on "context" seems to 
relate to {} in the perl source - but the internal sense
is less obvious. As I hinted at above the three FREETMPS are paired 
with three SAVETMPS to the context stack for each of the calls 
to foo, bar and baz. It is done that way so if (say) foo "dies",
the FREETMPS still happens - so in _my_ mental model each of 
foo bar baz does have its own "context" - in addition to what ever 
it may do internally.



-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/


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