aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-12-15 00:11:30 +0100
committerLudovic Courtès <ludo@gnu.org>2019-12-15 00:34:05 +0100
commit5f9cd63eb0d803966ce645c9d1db3438370e5505 (patch)
treedfb5aa672d78ca3bb5409494b16037c310a59601
parent428561aa63e7ddcafdd80a50e2b147fc97f77662 (diff)
downloadpatches-5f9cd63eb0d803966ce645c9d1db3438370e5505.tar
patches-5f9cd63eb0d803966ce645c9d1db3438370e5505.tar.gz
base64: Do not use (rnrs).
* guix/base64.scm: Remove #:use-module clauses for (rnrs) and (srfi srfi-13). Add other #:use-module clauses. (fxbit-field): Define as an alias for 'bit-field. (fx=?, fx+, mod): New aliases. (assert): New macro.
-rw-r--r--guix/base64.scm18
1 files changed, 12 insertions, 6 deletions
diff --git a/guix/base64.scm b/guix/base64.scm
index 0fa501eca0..c4fdd9c390 100644
--- a/guix/base64.scm
+++ b/guix/base64.scm
@@ -52,11 +52,10 @@
base64url-alphabet
get-delimited-base64
put-delimited-base64)
- #:use-module (rnrs)
- #:use-module ((srfi srfi-13)
- #:select (string-index
- string-prefix? string-suffix?
- string-concatenate string-trim-both)))
+ #:use-module (srfi srfi-11)
+ #:use-module (srfi srfi-60)
+ #:use-module (rnrs bytevectors)
+ #:use-module (rnrs io ports))
(define-syntax define-alias
@@ -67,12 +66,19 @@
;; Force the use of Guile's own primitives to avoid the overhead of its 'fx'
;; procedures.
-(define-alias fxbit-field bitwise-bit-field)
+(define-alias fxbit-field bit-field)
(define-alias fxarithmetic-shift ash)
(define-alias fxarithmetic-shift-left ash)
(define-alias fxand logand)
(define-alias fxior logior)
(define-alias fxxor logxor)
+(define-alias fx=? =)
+(define-alias fx+ +)
+(define-alias mod modulo)
+
+(define-syntax-rule (assert exp)
+ (unless exp
+ (throw 'assertion-failure 'exp)))
(define base64-alphabet
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")