guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Non-stack-copying call-with-current-continuation?


From: Noah Lavine
Subject: Re: Non-stack-copying call-with-current-continuation?
Date: Thu, 1 Mar 2012 20:25:53 -0500

Hello,

> IIRC, the stack copying in Guile's continuation implementation is
> inevitable. Though it's inefficient, the consideration is to cooperate with
> other languages such as C.

It's inevitable in the general case, where the continuation might
return multiple times.

However, in this situation, he knows the continuation will only ever
return once, so it is not necessary to copy the stack. This control
structure will be the equivalent of setjmp and longjmp in C.

Prompts have an optimization where they don't actually copy the stack
if it is clear that they can only return once. That is why catch and
throw are implemented that way.

Noah



reply via email to

[Prev in Thread] Current Thread [Next in Thread]