From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vivien Kraus via General Guile related discussions Newsgroups: gmane.lisp.guile.user Subject: Exception handler installed when handling a continuable exception Date: Mon, 09 Aug 2021 09:26:38 +0200 Message-ID: <877dgv2i4x.fsf@planete-kraus.eu> Reply-To: Vivien Kraus Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2133"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Mon Aug 09 09:27:21 2021 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mCzgv-0000Md-4w for guile-user@m.gmane-mx.org; Mon, 09 Aug 2021 09:27:21 +0200 Original-Received: from localhost ([::1]:39370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCzgt-0005o6-Iz for guile-user@m.gmane-mx.org; Mon, 09 Aug 2021 03:27:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCzgg-0005nj-4d for guile-user@gnu.org; Mon, 09 Aug 2021 03:27:06 -0400 Original-Received: from planete-kraus.eu ([2a00:5881:4008:2810::309]:49260) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1mCzgd-0001Cm-33 for guile-user@gnu.org; Mon, 09 Aug 2021 03:27:05 -0400 Original-Received: from planete-kraus.eu (localhost.lan [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id 8b781855 for ; Mon, 9 Aug 2021 07:26:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h=from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=*; bh=xl/CRnyJJoVIT4F6kpLkwIc9AtU=; b= G4LSR0BBnKLPdvvfqzdw1i1SqO3ifOOZlQpM+e5YoEh1gYcvScBTksY4z6rFyJYt Te0zU2fPCf2hfvhU3YO+JPIiA0WYjHAT0edyzRYmqfnrGIt+AoQyXpby1/0PdIfu VyMKN9y8hAPKDe/emUyZcNwa/ki9nVegd+rZsLV9smI= Original-Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id 8763a68f (TLSv1.3:AEAD-CHACHA20-POLY1305-SHA256:256:NO) for ; Mon, 9 Aug 2021 07:26:43 +0000 (UTC) Received-SPF: pass client-ip=2a00:5881:4008:2810::309; envelope-from=vivien@planete-kraus.eu; helo=planete-kraus.eu X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17676 Archived-At: Dear guile users, When an exception is raised with #:continuable?, and when the handler returns a value, then the program continues. This is why this program prints "hello": (use-modules (ice-9 exceptions)) (with-exception-handler (lambda (exn) ;; We want to return "hello" "hello\n") (lambda () (format (current-error-port) (raise-exception (make-exception-with-message "What should I sa= y?") #:continuable? #t)))) Now, in the handler, I may want to handle other kinds of exceptions: (use-modules (ice-9 exceptions)) (with-exception-handler (lambda (exn) ;; We want to return "hello" (false-if-exception ;; Shouldn=E2=80=99t this error be ignored? (error "messing around")) "hello\n") (lambda () (format (current-error-port) (raise-exception (make-exception-with-message "What should I sa= y?") #:continuable? #t)))) Is this a bug? Best regards, Vivien