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

Re: [PATCH sv.c] mortal doc thinko

Thread Previous | Thread Next
Nick Ing-Simmons
July 30, 2001 06:21
Re: [PATCH sv.c] mortal doc thinko
Message ID:
Dave Mitchell <> writes:
>Nick Ing-Simmons <> 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

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About