[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
09/10: DRAFT serialization: Avoid 'define-values', for the sake of Guile
From: |
guix-commits |
Subject: |
09/10: DRAFT serialization: Avoid 'define-values', for the sake of Guile 2.0. |
Date: |
Sun, 5 Jan 2020 05:51:32 -0500 (EST) |
civodul pushed a commit to branch wip-system-bootstrap
in repository guix.
commit b446a604b491cf66cc818d50fa23461a37dc94a2
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 f793feb..ceccd20 100644
--- a/guix/serialization.scm
+++ b/guix/serialization.scm
@@ -287,6 +287,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 3bccc5e), guix-commits, 2020/01/05
- 03/10: store: Add #:cut? parameter to 'topologically-sorted'., guix-commits, 2020/01/05
- 01/10: utils: 'version-compare' delays 'dynamic-link' code., guix-commits, 2020/01/05
- 04/10: derivations: Add #:skip-dependencies? parameter to 'derivation-input-fold'., guix-commits, 2020/01/05
- 05/10: DRAFT gexp: Add 'raw-derivation-closure'., guix-commits, 2020/01/05
- 02/10: monads: Add portability to Guile 2.0., guix-commits, 2020/01/05
- 06/10: DRAFT gexp: Add 'object-sources'., guix-commits, 2020/01/05
- 09/10: DRAFT serialization: Avoid 'define-values', for the sake of Guile 2.0.,
guix-commits <=
- 08/10: bootstrap: Add %bootstrap-guile+guild., guix-commits, 2020/01/05
- 10/10: system: bootstrap: Compute and print the result's hash., guix-commits, 2020/01/05
- 07/10: DRAFT system: Add (gnu system bootstrap)., guix-commits, 2020/01/05