mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-25 20:19:18 -05:00
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.
This commit is contained in:
parent
428561aa63
commit
5f9cd63eb0
1 changed files with 12 additions and 6 deletions
|
@ -52,11 +52,10 @@ (define-module (guix base64)
|
||||||
base64url-alphabet
|
base64url-alphabet
|
||||||
get-delimited-base64
|
get-delimited-base64
|
||||||
put-delimited-base64)
|
put-delimited-base64)
|
||||||
#:use-module (rnrs)
|
#:use-module (srfi srfi-11)
|
||||||
#:use-module ((srfi srfi-13)
|
#:use-module (srfi srfi-60)
|
||||||
#:select (string-index
|
#:use-module (rnrs bytevectors)
|
||||||
string-prefix? string-suffix?
|
#:use-module (rnrs io ports))
|
||||||
string-concatenate string-trim-both)))
|
|
||||||
|
|
||||||
|
|
||||||
(define-syntax define-alias
|
(define-syntax define-alias
|
||||||
|
@ -67,12 +66,19 @@ (define-syntax new (identifier-syntax old)))))
|
||||||
;; Force the use of Guile's own primitives to avoid the overhead of its 'fx'
|
;; Force the use of Guile's own primitives to avoid the overhead of its 'fx'
|
||||||
;; procedures.
|
;; procedures.
|
||||||
|
|
||||||
(define-alias fxbit-field bitwise-bit-field)
|
(define-alias fxbit-field bit-field)
|
||||||
(define-alias fxarithmetic-shift ash)
|
(define-alias fxarithmetic-shift ash)
|
||||||
(define-alias fxarithmetic-shift-left ash)
|
(define-alias fxarithmetic-shift-left ash)
|
||||||
(define-alias fxand logand)
|
(define-alias fxand logand)
|
||||||
(define-alias fxior logior)
|
(define-alias fxior logior)
|
||||||
(define-alias fxxor logxor)
|
(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
|
(define base64-alphabet
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
|
||||||
|
|
Loading…
Reference in a new issue