unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: guile-devel@gnu.org
Cc: wingo@igalia.com, "Ludovic Courtès" <ludo@gnu.org>
Subject: [PATCH 1/2] srfi-34: Replace the 'raise' core binding.
Date: Mon, 25 Nov 2019 17:45:54 +0100	[thread overview]
Message-ID: <20191125164555.15124-2-ludo@gnu.org> (raw)
In-Reply-To: <20191125164555.15124-1-ludo@gnu.org>

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 (<var> <clause1> <clause2> ...) <body>)
-- 
2.24.0




  reply	other threads:[~2019-11-25 16:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25 16:45 [PATCH 0/2] Silence run-time warnings for SRFI-3[45] Ludovic Courtès
2019-11-25 16:45 ` Ludovic Courtès [this message]
2019-11-26 10:09   ` [PATCH 1/2] srfi-34: Replace the 'raise' core binding Andy Wingo
2019-11-26 13:09     ` Ludovic Courtès
2019-11-29 11:00       ` Andy Wingo
2019-11-25 16:45 ` [PATCH 2/2] srfi-35: Replace '&error' Ludovic Courtès
2019-11-26 10:10   ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191125164555.15124-2-ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=wingo@igalia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).