guile-devel
[Top][All Lists]
Advanced

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

Re: continuation efficiency


From: Thomas Bushnell, BSG
Subject: Re: continuation efficiency
Date: 07 Jul 2001 16:11:29 -0700
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Martin Grabmueller <address@hidden> writes:

> call/cc does a full copy of the machine stack, to be able to install
> it again when the continuation is invoked.  This requires memory
> allocation and copying, which is a bit slow.
> 
> call/ec, on the other hand, does not need to preserve the stack, since
> it only allows calls upwards in the call chain.  Think of call/ec as
> throw/catch and you'll see.  So call/ec is less powerful, but faster
> (in Guile, other Schemes may vary).

This all depends on the *implementation*.  The original post implied
that call/ec was not a primitive.  If it is implemented as a wrapper
around call/cc, then how can it be more efficient?




reply via email to

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