[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/08: records: Make a couple of procedures available at expansion time.
From: |
Ludovic Courtès |
Subject: |
04/08: records: Make a couple of procedures available at expansion time. |
Date: |
Thu, 31 May 2018 12:13:16 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 9768848af80764af6040e75867ae15a41228364b
Author: Ludovic Courtès <address@hidden>
Date: Thu May 31 17:32:22 2018 +0200
records: Make a couple of procedures available at expansion time.
* guix/records.scm (current-abi-identifier, abi-check): Wrap in
'eval-when'.
---
guix/records.scm | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/guix/records.scm b/guix/records.scm
index c71cfcf..da3ecda 100644
--- a/guix/records.scm
+++ b/guix/records.scm
@@ -63,22 +63,25 @@
(set-exception-printer! 'record-abi-mismatch-error
print-record-abi-mismatch-error)
-(define (current-abi-identifier type)
- "Return an identifier unhygienically derived from TYPE for use as its
+(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."
- (let ((type-name (syntax->datum type)))
- (datum->syntax
- type
- (string->symbol
- (string-append "% " (symbol->string type-name)
- " abi-cookie")))))
-
-(define (abi-check type cookie)
- "Return syntax that checks that the current \"application binary
+ (let ((type-name (syntax->datum type)))
+ (datum->syntax
+ type
+ (string->symbol
+ (string-append "% " (symbol->string type-name)
+ " abi-cookie")))))
+
+ (define (abi-check type cookie)
+ "Return syntax that checks that the current \"application binary
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))))
+ (with-syntax ((current-abi (current-abi-identifier type)))
+ #`(unless (eq? current-abi #,cookie)
+ (throw 'record-abi-mismatch-error #,type)))))
(define-syntax make-syntactic-constructor
(syntax-rules ()
- branch master updated (404e5c7 -> 555ab08), Ludovic Courtès, 2018/05/31
- 01/08: self: Reduce the set of dependencies., Ludovic Courtès, 2018/05/31
- 04/08: records: Make a couple of procedures available at expansion time.,
Ludovic Courtès <=
- 05/08: gnu: bear: Fix python path., Ludovic Courtès, 2018/05/31
- 02/08: file-systems: Always wait for devices to show up., Ludovic Courtès, 2018/05/31
- 03/08: system: 'read-boot-parameters' provides a more meaningful warning., Ludovic Courtès, 2018/05/31
- 06/08: gnu: Add python-bigfloat., Ludovic Courtès, 2018/05/31
- 07/08: gnu: Add emacs-org-caldav., Ludovic Courtès, 2018/05/31
- 08/08: gnu: Add emacs-zotxt., Ludovic Courtès, 2018/05/31