develooper Front page | perl.perl6.internals | Postings from November 2004

Re: Continuations, basic blocks, loops and register allocation

Thread Previous | Thread Next
From:
Matt Fowles
Date:
November 16, 2004 10:07
Subject:
Re: Continuations, basic blocks, loops and register allocation
Message ID:
f2601a7f04111610073df2e712@mail.gmail.com
Leo~

On Tue, 16 Nov 2004 18:32:07 +0100, Leopold Toetsch <lt@toetsch.at> wrote:
> Matt Fowles wrote:
> 
> 
> > I disagree with that analysis.  Let us consider the actual effect of
> > such an implementation.
> >
> > First iteration
> >
> > i = 0;
> > foo(); #at this point a continuation created capturing i=0, promoted
> > by Jens and stuff happens
> > #eventually it is invoked, restoring i=0
> > i++; #i = 1
> > foo(); #at this point a NEW return continuation is created capturing
> 
> That would work if there is a one to one representation of the invoation
> of foo() an it's continuation. But no one guarantees that.

I suppose that what I am arguing is that anyone who does not maintain
such a one-to-one representation (at least from the perspective of
code calling foo()); full well deserves what they get.  They are
restoring the execution to an earlier state by invoking an old
continuation.  If the earlier state called them again the first time,
they should probably expect the earlier state to call them again the
second time.  Unless they have some specific knowledge that the
earlier state will change it behavior (because things in the heap have
changed), there should be no expectation for it to.

Matt
-- 
"Computer Science is merely the post-Turing Decline of Formal Systems Theory."
-???

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