mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 22:08:16 -05:00
records: Make a couple of procedures available at expansion time.
* guix/records.scm (current-abi-identifier, abi-check): Wrap in 'eval-when'.
This commit is contained in:
parent
b1059b38b2
commit
9768848af8
1 changed files with 17 additions and 14 deletions
|
@ -63,6 +63,9 @@ (define (print-record-abi-mismatch-error port key args
|
|||
(set-exception-printer! 'record-abi-mismatch-error
|
||||
print-record-abi-mismatch-error)
|
||||
|
||||
(eval-when (expand load eval)
|
||||
;; The procedures below are needed both at run time and at expansion time.
|
||||
|
||||
(define (current-abi-identifier type)
|
||||
"Return an identifier unhygienically derived from TYPE for use as its
|
||||
\"current ABI\" variable."
|
||||
|
@ -78,7 +81,7 @@ (define (abi-check type cookie)
|
|||
interface\" (ABI) for TYPE is equal to COOKIE."
|
||||
(with-syntax ((current-abi (current-abi-identifier type)))
|
||||
#`(unless (eq? current-abi #,cookie)
|
||||
(throw 'record-abi-mismatch-error #,type))))
|
||||
(throw 'record-abi-mismatch-error #,type)))))
|
||||
|
||||
(define-syntax make-syntactic-constructor
|
||||
(syntax-rules ()
|
||||
|
|
Loading…
Reference in a new issue