From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Newsgroups: gmane.lisp.guile.devel Subject: [PATCH 1/2] srfi-34: Replace the 'raise' core binding. Date: Mon, 25 Nov 2019 17:45:54 +0100 Message-ID: <20191125164555.15124-2-ludo@gnu.org> References: <20191125164555.15124-1-ludo@gnu.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="215747"; mail-complaints-to="usenet@blaine.gmane.org" Cc: wingo@igalia.com, =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Nov 25 17:46:42 2019 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iZHVZ-000tv8-1u for guile-devel@m.gmane.org; Mon, 25 Nov 2019 17:46:41 +0100 Original-Received: from localhost ([::1]:46474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZHVX-00065k-Lv for guile-devel@m.gmane.org; Mon, 25 Nov 2019 11:46:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49670) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZHV9-000650-Be for guile-devel@gnu.org; Mon, 25 Nov 2019 11:46:16 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iZHV7-0001Jp-SL; Mon, 25 Nov 2019 11:46:13 -0500 Original-Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=49658 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iZHV7-0008Gm-3d; Mon, 25 Nov 2019 11:46:13 -0500 X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191125164555.15124-1-ludo@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:20165 Archived-At: In Guile 2.x, (srfi srfi-34) would already replace 'raise'. Replacing avoids a run-time warning about the core binding being overridden. * module/srfi/srfi-34.scm (raise): New variable. Mark it as #:replace instead of #:re-export. --- module/srfi/srfi-34.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/module/srfi/srfi-34.scm b/module/srfi/srfi-34.scm index 0e7ad995d..255bfecb9 100644 --- a/module/srfi/srfi-34.scm +++ b/module/srfi/srfi-34.scm @@ -1,6 +1,6 @@ ;;; srfi-34.scm --- Exception handling for programs -;; Copyright (C) 2003, 2006, 2008, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2006, 2008, 2010, 2019 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public @@ -27,12 +27,16 @@ ;;; Code: (define-module (srfi srfi-34) - #:re-export (with-exception-handler - (raise-exception . raise)) + #:re-export (with-exception-handler) + #:replace (raise) #:export-syntax (guard)) (cond-expand-provide (current-module) '(srfi-34)) +(define (raise exn) + "Raise the given exception, invoking the current exception handler on EXN." + (raise-exception exn)) + (define-syntax guard (syntax-rules (else) "Syntax: (guard ( ...) ) -- 2.24.0