[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/10: monads: Add portability to Guile 2.0.
From: |
guix-commits |
Subject: |
02/10: monads: Add portability to Guile 2.0. |
Date: |
Sun, 5 Jan 2020 05:51:31 -0500 (EST) |
civodul pushed a commit to branch wip-system-bootstrap
in repository guix.
commit 22a9dc1b797de72ce17d24ab68ed1a7908f5f661
Author: Ludovic Courtès <address@hidden>
Date: Fri Dec 6 23:11:23 2019 +0100
monads: Add portability to Guile 2.0.
This allows (guix monads) to be compiled and use on the current
"guile-bootstrap" package, which is Guile 2.0.9.
* guix/monads.scm (define-syntax-parameter-once): Add 'cond-expand' form.
---
guix/monads.scm | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/guix/monads.scm b/guix/monads.scm
index 6924471..d7bc98f 100644
--- a/guix/monads.scm
+++ b/guix/monads.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2017 Ludovic Courtès <address@hidden>
+;;; Copyright © 2013, 2014, 2015, 2017, 2019 Ludovic Courtès <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -279,11 +279,16 @@ more optimizations."
;; does not get redefined. This works around a race condition in a
;; multi-threaded context with Guile <= 2.2.4: <https://bugs.gnu.org/27476>.
(eval-when (load eval expand compile)
- (define name
- (if (module-locally-bound? (current-module) 'name)
- (module-ref (current-module) 'name)
- (make-syntax-transformer 'name 'syntax-parameter
- (list proc))))))
+ (cond-expand
+ ((not guile-2.2)
+ ;; The trick below doesn't work on Guile 2.0.
+ (define-syntax-parameter name proc))
+ (else
+ (define name
+ (if (module-locally-bound? (current-module) 'name)
+ (module-ref (current-module) 'name)
+ (make-syntax-transformer 'name 'syntax-parameter
+ (list proc))))))))
(define-syntax-parameter-once >>=
;; The name 'bind' is already taken, so we choose this (obscure) symbol.
- 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 <=
- 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, 2020/01/05
- 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