[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/11: monads: Add portability to Guile 2.0.
From: |
guix-commits |
Subject: |
02/11: monads: Add portability to Guile 2.0. |
Date: |
Wed, 11 Dec 2019 18:21:51 -0500 (EST) |
civodul pushed a commit to branch wip-system-bootstrap
in repository guix.
commit 5747113c9de5a0907406b6096f4ec71f6c3e5b4a
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 f97e759), guix-commits, 2019/12/11
- 01/11: utils: 'version-compare' delays 'dynamic-link' code., guix-commits, 2019/12/11
- 03/11: DRAFT gexp: Add 'raw-derivation-file'., guix-commits, 2019/12/11
- 02/11: monads: Add portability to Guile 2.0.,
guix-commits <=
- 04/11: DRAFT gexp: Add 'raw-derivation-closure'., guix-commits, 2019/12/11
- 07/11: guile-build-system: Add #:implicit-inputs., guix-commits, 2019/12/11
- 08/11: gnu: Add guile-hashing., guix-commits, 2019/12/11
- 10/11: DRAFT serialization: Avoid 'define-values', for the sake of Guile 2.0., guix-commits, 2019/12/11
- 05/11: DRAFT gexp: Add 'object-sources'., guix-commits, 2019/12/11
- 09/11: bootstrap: Add %bootstrap-guile+guild., guix-commits, 2019/12/11
- 11/11: system: bootstrap: Compute and print the result's hash., guix-commits, 2019/12/11
- 06/11: DRAFT system: Add (gnu system bootstrap)., guix-commits, 2019/12/11