[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/08: monads: Add portability to Guile 2.0.
From: |
guix-commits |
Subject: |
04/08: monads: Add portability to Guile 2.0. |
Date: |
Fri, 6 Dec 2019 18:28:11 -0500 (EST) |
civodul pushed a commit to branch wip-system-bootstrap
in repository guix.
commit 8a172be26e91725db99efb4ac2502b2f45705307
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 6ab64e3), guix-commits, 2019/12/06
- 01/08: machine: ssh: Deprecate missing 'host-key' field., guix-commits, 2019/12/06
- 04/08: monads: Add portability to Guile 2.0.,
guix-commits <=
- 03/08: utils: 'version-compare' delays 'dynamic-link' code., guix-commits, 2019/12/06
- 02/08: derivations: Add 'derivation-input-fold'., guix-commits, 2019/12/06
- 06/08: DRAFT gexp: Add 'raw-derivation-closure'., guix-commits, 2019/12/06
- 05/08: DRAFT gexp: Add 'raw-derivation-file'., guix-commits, 2019/12/06
- 07/08: DRAFT gexp: Add 'object-sources'., guix-commits, 2019/12/06
- 08/08: DRAFT system: Add (gnu system bootstrap)., guix-commits, 2019/12/06