diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2019-12-11 23:50:13 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2020-01-05 11:40:02 +0100 |
| commit | b446a604b491cf66cc818d50fa23461a37dc94a2 (patch) | |
| tree | af1c18547f91fab0a08d4be41c7c2ddcff0c7150 | |
| parent | eb8eba95dab5005c16895648b8f7c4838290d26b (diff) | |
DRAFT serialization: Avoid 'define-values', for the sake of Guile 2.0.
DRAFT: We should probably just use 'let-values' instead.
* guix/serialization.scm (define-values) [not guile-2.2]: New macro.
| -rw-r--r-- | guix/serialization.scm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/guix/serialization.scm b/guix/serialization.scm index f793feb53dc..ceccd207aa7 100644 --- a/guix/serialization.scm +++ b/guix/serialization.scm | |||
| @@ -287,6 +287,21 @@ order." | |||
| 287 | string<?) | 287 | string<?) |
| 288 | string=?)) | 288 | string=?)) |
| 289 | 289 | ||
| 290 | (cond-expand | ||
| 291 | ((not guile-2.2) | ||
| 292 | ;; Guile 2.0 lacks 'define-values'. | ||
| 293 | (define-syntax define-values | ||
| 294 | (syntax-rules () | ||
| 295 | ((_ (a b) exp) | ||
| 296 | (begin | ||
| 297 | (define a #f) | ||
| 298 | (define b #f) | ||
| 299 | (call-with-values (lambda () exp) | ||
| 300 | (lambda (x y) | ||
| 301 | (set! a x) | ||
| 302 | (set! b y)))))))) | ||
| 303 | (else #t)) | ||
| 304 | |||
| 290 | (define* (write-file-tree file port | 305 | (define* (write-file-tree file port |
| 291 | #:key | 306 | #:key |
| 292 | file-type+size | 307 | file-type+size |
