[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: packages: Fix 'base32' used before definition war
From: |
guix-commits |
Subject: |
branch master updated: packages: Fix 'base32' used before definition warning. |
Date: |
Mon, 11 Jan 2021 08:16:21 -0500 |
This is an automated email from the git hooks/post-receive script.
apteryx pushed a commit to branch master
in repository guix.
The following commit(s) were added to refs/heads/master by this push:
new 8152fd1 packages: Fix 'base32' used before definition warning.
8152fd1 is described below
commit 8152fd1af551f4bcec2ef59243264c10ff48daea
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Sun Jan 10 08:42:42 2021 -0500
packages: Fix 'base32' used before definition warning.
Before this change, compiling the module would emit the following message:
"guix/packages.scm:213:25: warning: macro `base32' used before definition".
* guix/packages.scm (define-compile-time-decoder)
(base32, base64): Move definitions to the top of the module.
---
guix/packages.scm | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/guix/packages.scm b/guix/packages.scm
index 6fa761f..9305dab 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -167,6 +167,25 @@
;;;
;;; Code:
+(define-syntax-rule (define-compile-time-decoder name string->bytevector)
+ "Define NAME as a macro that runs STRING->BYTEVECTOR at macro expansion time
+if possible."
+ (define-syntax name
+ (lambda (s)
+ "Return the bytevector corresponding to the given textual
+representation."
+ (syntax-case s ()
+ ((_ str)
+ (string? (syntax->datum #'str))
+ ;; A literal string: do the conversion at expansion time.
+ (with-syntax ((bv (string->bytevector (syntax->datum #'str))))
+ #''bv))
+ ((_ str)
+ #'(string->bytevector str))))))
+
+(define-compile-time-decoder base32 nix-base32-string->bytevector)
+(define-compile-time-decoder base64 base64-decode)
+
;; Crytographic content hash.
(define-immutable-record-type <content-hash>
(%content-hash algorithm value)
@@ -302,25 +321,6 @@ specifications to 'hash'."
(set-record-type-printer! <origin> print-origin)
-(define-syntax-rule (define-compile-time-decoder name string->bytevector)
- "Define NAME as a macro that runs STRING->BYTEVECTOR at macro expansion time
-if possible."
- (define-syntax name
- (lambda (s)
- "Return the bytevector corresponding to the given textual
-representation."
- (syntax-case s ()
- ((_ str)
- (string? (syntax->datum #'str))
- ;; A literal string: do the conversion at expansion time.
- (with-syntax ((bv (string->bytevector (syntax->datum #'str))))
- #''bv))
- ((_ str)
- #'(string->bytevector str))))))
-
-(define-compile-time-decoder base32 nix-base32-string->bytevector)
-(define-compile-time-decoder base64 base64-decode)
-
(define (origin-actual-file-name origin)
"Return the file name of ORIGIN, either its 'file-name' field or the file
name of its URI."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: packages: Fix 'base32' used before definition warning.,
guix-commits <=