bug#79461: n-par-for-each do not propagate exceptions

Maxim Cournoyer <[email protected]> Wed, 17 Sep 2025 16:15:34 +0900
Newsgroups gmane.lisp.guile.bugs
Organization Guixotic
Message-ID <[email protected]>
Hi,

The documentation of `n-par-for-each' (info "(guile) Parallel Forms")
does not mention that errors thrown in the procedure run in parallel are
absorbed, instead of relayed to the control code to be handled.

Here's an example:

--8<---------------cut here---------------start------------->8---
(use-modules (srfi srfi-26) (ice-9 threads))
(n-par-for-each 10 (cut error <>) '(a b c d e f g h i j))

;; Produces:

In thread:
In thread:In thread:a


b
In thread:
c
In thread:
d
In thread:
e
In thread:
f
In thread:
In thread:
h
g
In thread:
i
In thread:
j
--8<---------------cut here---------------end--------------->8---

The errors are printed but the exception does not cause the whole
program to be aborted.

This makes this (and I assume other similar) parallel forms unpractical
for situations where errors may happen and must be handled at the top
level.

-- 
Thanks,
Maxim