Which brings up again my warnocked question: How can return
   continuations get reused? Please provide some PASM code that enables my
   brain to follow your argument that we cant't simply cache them.

Well, I can't do PASM code, but let me give it try. ;)

Single vs multiple use.  It should be possible to give the same
continuation to multiple people, and have them variously invoke it,
perhaps repeatedly, whenever someone wants to.  Though all those
invocations would come to the same "place", so if you wished to
distinguish just who was invoking you, you would have to cooperatively
arrange for that yourself (or use something like caller()).

"Reuse" implies something stronger.  That the continuation becomes
somehow invalid, and thus its dead husk can be used to host a new
continuation.

As continuations can be stashed anyplace, and invoked at any later
time, the only way to know folks are done with it is wait until it
gets garbage collected.  So one might say create a special memory
pool, used just for continuations, which might perhaps allow for easier
construction.

Forcing a continuation to become invalid, to say throw an exception if
it is later invoked, would seem to require something like creating a
derivative "revocable continuation", and uid in normal continuations.
So one gives people the revocable continuation, and if/when it's
underlying continuation is "reused", it's uid is changed, which the
derivative checks when deciding whether to invoke it, or to die.

Some memory systems allow one to forcibly declare an object dead, and
subsequent use triggers an exception.  But you don't get to reuse the
object.  Unless there is an extra level of indirection between object
ids and their memory, which we don't have.

It's not clear to me what "return" continuations are intended to be.
Up-calls?  This would not avoid the "can it be reused now?"  question,
as one might stash one's return continuation in say a timer, to be
invoked again on every third tuesday.

One might try to contractually enforce a "one use only" rule, so if
the continuation is ever invoked, you're promised it won't be used
again.  But that would have to be binding on the entire call tree
beneath you.  And on anyone who might reflectively snoop on the call
tree. :) Otherwise anyone could stash _their_ continuation, and by
later reinvoking it, reinvoke yours.  Though you might generate
"firewall" one-use code objects to insulate yourself, but... blech.
However, language compilers are of course free to use their own
calling conventions when dealing only with themselves, where they can
make any kind of strange guarantee they wish.  They just wouldnt be
able to call out of these specialized zones, without significant
border guarding.

So I don't immediately see how a continuation can be "reused" in a
now-it-will-do-something-different sense.

Then again, there _is_ this "return continuation" thing in the code.
I just cant quite figure out what it is... ;)

Mitchell

Reply via email to