[Top][All Lists]

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

bug#62469: ‘throw’ introduces a continuation barrier

From: Ludovic Courtès
Subject: bug#62469: ‘throw’ introduces a continuation barrier
Date: Sun, 26 Mar 2023 23:35:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

‘throw’ introduces a continuation barrier as of Guile 3.0.9:

--8<---------------cut here---------------start------------->8---
$ cat ~/src/guile-debugging/suspendable-continuation.scm
(use-modules (ice-9 control))

(let ((tag (make-prompt-tag)))
  (call-with-prompt tag
    (lambda ()
      (catch #t
        (lambda ()
          (pk 'suspendable-from-catch? tag (suspendable-continuation? tag))
          (throw 'whatever))
        (const #t)
        (lambda args
          (pk 'suspendable-from-exn-handler? tag (suspendable-continuation? 
    (const #t)))
$ guile ~/src/guile-debugging/suspendable-continuation.scm

;;; (suspendable-from-catch? ("prompt") #t)

;;; (suspendable-from-exn-handler? ("prompt") #f)
--8<---------------cut here---------------end--------------->8---

Apparently this is because that goes through ‘scm_throw’ via

A practical consequence is that a REPL running in Fibers on non-blocking
ports enters an endless “Attempt to suspend fiber within continuation
barrier” loop when it starts a recursive REPL due to an uncaught


reply via email to

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