summaryrefslogtreecommitdiff
path: root/guix/packages.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-01-10 08:42:42 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-01-10 17:12:22 -0500
commit31ebecf73dadb51ccc72053f54dee36c93a2d0ab (patch)
treefdd3ec7548b0ee0bb6d1d037a51272acb0c0f8eb /guix/packages.scm
parent0715793373059951e79bf94c92a4c75f547752d6 (diff)
downloadguix-patches-31ebecf73dadb51ccc72053f54dee36c93a2d0ab.tar
guix-patches-31ebecf73dadb51ccc72053f54dee36c93a2d0ab.tar.gz
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.
Diffstat (limited to 'guix/packages.scm')
-rw-r--r--guix/packages.scm38
1 files changed, 19 insertions, 19 deletions
diff --git a/guix/packages.scm b/guix/packages.scm
index 93407c143c..4caaa9cb79 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -168,6 +168,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)
@@ -303,25 +322,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."