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: 08 Jul 2001 12:33:03 -0700
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Martin Grabmueller <address@hidden> writes:

> Yes, but aren't we talking about the implementation in Guile here?
> IIRC, you started this thread, asking about the performance of call/cc
> in Guile, and Marius posted an example of call/ec, based on
> catch/throw, _not_ based on call/cc.  It was this implementation I was
> talking about, which uses catch/throw---these are primitives, and
> they are faster than call/cc *in Guile*.

I was misled by Marius's sample implementation in his article:

    (define (call-with-escape-continuation proc)
      (let* ((valid #t)
             (source-handlers escape-handlers)
             (val (call-with-current-continuation
                   (lambda (k)
                     (proc (lambda (v)
                             (set! source-handlers escape-handlers)
                             (k v)))))))
        (if (not valid)
            (error "escape continuation called from invalid context"))
        (set! valid #f)
        (do ((handlers source-handlers (cdr handlers)))
            ((eq? handlers escape-handlers))
          (run-handler (car handlers)))
        val))

and also my (incorrect) assumption that Guile implements catch in the
normal Schemey way.



reply via email to

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