[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
12/13: DRAFT serialization: Avoid 'define-values', for the sake of Guile
From: |
guix-commits |
Subject: |
12/13: DRAFT serialization: Avoid 'define-values', for the sake of Guile 2.0. |
Date: |
Thu, 12 Dec 2019 07:49:42 -0500 (EST) |
civodul pushed a commit to branch wip-system-bootstrap
in repository guix.
commit 152511ad4a32d269021a254488e32e49c1e6b9cb
Author: Ludovic Courtès <address@hidden>
Date: Wed Dec 11 23:50:13 2019 +0100
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.
---
guix/serialization.scm | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/guix/serialization.scm b/guix/serialization.scm
index e14b7d1..f7ac8d7 100644
--- a/guix/serialization.scm
+++ b/guix/serialization.scm
@@ -317,6 +317,21 @@ order."
string<?)
string=?))
+(cond-expand
+ ((not guile-2.2)
+ ;; Guile 2.0 lacks 'define-values'.
+ (define-syntax define-values
+ (syntax-rules ()
+ ((_ (a b) exp)
+ (begin
+ (define a #f)
+ (define b #f)
+ (call-with-values (lambda () exp)
+ (lambda (x y)
+ (set! a x)
+ (set! b y))))))))
+ (else #t))
+
(define* (write-file-tree file port
#:key
file-type+size
- branch wip-system-bootstrap created (now ba36483), guix-commits, 2019/12/12
- 01/13: utils: 'version-compare' delays 'dynamic-link' code., guix-commits, 2019/12/12
- 03/13: store: Add #:cut? parameter to 'topologically-sorted'., guix-commits, 2019/12/12
- 02/13: monads: Add portability to Guile 2.0., guix-commits, 2019/12/12
- 05/13: DRAFT gexp: Add 'raw-derivation-file'., guix-commits, 2019/12/12
- 07/13: DRAFT gexp: Add 'object-sources'., guix-commits, 2019/12/12
- 09/13: guile-build-system: Add #:implicit-inputs., guix-commits, 2019/12/12
- 12/13: DRAFT serialization: Avoid 'define-values', for the sake of Guile 2.0.,
guix-commits <=
- 10/13: gnu: Add guile-hashing., guix-commits, 2019/12/12
- 06/13: DRAFT gexp: Add 'raw-derivation-closure'., guix-commits, 2019/12/12
- 04/13: derivations: Add #:skip-dependencies? parameter to 'derivation-input-fold'., guix-commits, 2019/12/12
- 08/13: DRAFT system: Add (gnu system bootstrap)., guix-commits, 2019/12/12
- 11/13: bootstrap: Add %bootstrap-guile+guild., guix-commits, 2019/12/12
- 13/13: system: bootstrap: Compute and print the result's hash., guix-commits, 2019/12/12