unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#62469: ‘throw’ introduces a continuation barrier
@ 2023-03-26 21:35 Ludovic Courtès
  0 siblings, 0 replies; only message in thread
From: Ludovic Courtès @ 2023-03-26 21:35 UTC (permalink / raw)
  To: 62469

‘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? tag)))))
    (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
‘intrinsics.c’.

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
exception.

Ludo’.





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-26 21:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-26 21:35 bug#62469: ‘throw’ introduces a continuation barrier Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).