From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 17 03:16:03 2025 Received: (at submit) by debbugs.gnu.org; 17 Sep 2025 07:16:03 +0000 Received: from localhost ([127.0.0.1]:53807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uymOY-0008Tk-Jm for submit@debbugs.gnu.org; Wed, 17 Sep 2025 03:16:02 -0400 Received: from lists.gnu.org ([2001:470:142::17]:46834) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uymOV-0008Sj-PW for submit@debbugs.gnu.org; Wed, 17 Sep 2025 03:16:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uymOO-0007jq-L1 for bug-guile@gnu.org; Wed, 17 Sep 2025 03:15:52 -0400 Received: from mailtransmit05.runbox.com ([2a0c:5a00:149::26]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uymOL-0005Q2-Nv for bug-guile@gnu.org; Wed, 17 Sep 2025 03:15:52 -0400 Received: from mailtransmit02.runbox ([10.9.9.162] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1uymOC-003rwj-K3 for bug-guile@gnu.org; Wed, 17 Sep 2025 09:15:40 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=guixotic.coop; s=selector1; h=Content-Type:MIME-Version:Message-ID:Date: Subject:To:From; bh=3Lt8RTalAH4yLE+jNiUWa+fAt21NPYPqYCafNxYIZyg=; b=AmQ1+ejX8 u4vC9j0QTj1HrIw/y0RWOcloar7L3LOUZAgRRoN4Pc0rtSUdc6uHbYCny61lVUHsgyvUv4NY4UMLM XOnp2coUiBNbYdjVRkQmHhygc2B10vJgY3gpJPrt7erismo+d0dCit1+Gfvq6GDKbJaGK4NJgXbTl KIzvDnZESp/KJ4twhy9WqPMIpvmVSNYaYCiug+SjH9KOE/aK6k5auMGyKDdWGywDxN9ByLqUOcBY9 aavRmhAljlvVgt0jSa8pR/4mlF9ujJYYq0bjeJTXFIMPbhjL7YFckvw51VqG8FEs+aa4hzFqN7w/c 0wcBbp6RHukoxQM8l6c3aquHg==; Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1uymOC-0007dn-85 for bug-guile@gnu.org; Wed, 17 Sep 2025 09:15:40 +0200 Received: by submission03.runbox with esmtpsa [Authenticated ID (1476852)] (TLS1.2:ECDHE_SECP256R1__RSA_SHA256__AES_256_GCM:256) (Exim 4.93) id 1uymOA-00HEE1-4y for bug-guile@gnu.org; Wed, 17 Sep 2025 09:15:38 +0200 From: Maxim Cournoyer To: bug-guile Subject: n-par-for-each do not propagate exceptions Organization: Guixotic Date: Wed, 17 Sep 2025 16:15:34 +0900 Message-ID: <87cy7plfc9.fsf@guixotic.coop> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a0c:5a00:149::26; envelope-from=maxim@guixotic.coop; helo=mailtransmit05.runbox.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) 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