gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 07/08: hat-let: Allow both _.


From: gnunet
Subject: [gnunet-scheme] 07/08: hat-let: Allow both _.
Date: Mon, 29 Aug 2022 00:15:12 +0200

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

commit e5b35985816cd966d3bb1744c4199dcdb3b4bdfd
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Mon Aug 29 00:13:42 2022 +0200

    hat-let: Allow both _.
---
 gnu/gnunet/utils/hat-let.scm | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/gnu/gnunet/utils/hat-let.scm b/gnu/gnunet/utils/hat-let.scm
index df280a0..582d452 100644
--- a/gnu/gnunet/utils/hat-let.scm
+++ b/gnu/gnunet/utils/hat-let.scm
@@ -34,19 +34,17 @@
 ;;            usable.
 ;;   * (2 3): Allow dotted variable lists with <--.
 ;;   * (2 4): New: !^
+;;   * (2 5): Allow both RnRS _ and plain _.
 
-(library (gnu gnunet utils hat-let (2 4))
+(library (gnu gnunet utils hat-let (2 5))
   (export let^)
-  ;; Avoid letting users of (gnu gnunet utils hat-let)
-  ;; having to import _ from (rnrs base).
-  (import (only (rnrs base)
-               define-syntax syntax-rules let if begin
-               lambda assert call-with-values ...))
+  (import (except (rnrs base) _)
+         (rename (rnrs base) (_ rnrs:_)))
 
   ;; A generalisation of let*, and-let*, receive, begin,
   ;; and generalised let for avoiding nesting.
   (define-syntax let^
-    (syntax-rules (? ! !! _ <- <-- /o/)
+    (syntax-rules (? ! !! _ rnrs:_ <- <-- /o/)
       ((: () code ...)
        (let () code ...))
       ;; if x, then return @code{(begin esc esc* ...)}
@@ -76,11 +74,15 @@
        (begin
         (assert x)
         (let^ (etc ...) code ...)))
-      ;; Throw a result away
+      ;; Throw a result away.  Allow both RnRS _ and unbound _.
       ((: ((_ x) etc ...) code ...)
        (begin
         x
         (let^ (etc ...) code ...)))
+      ((: ((rnrs:_ x) etc ...) code ...)
+       (begin
+        x
+        (let^ (etc ...) code ...)))
       ;; Assign multiple values (from a thunk).
       ;; This is a historical mistake, use <--
       ;; instead (see mini changelog).

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]