mirror of
https://codeberg.org/guix/guix.git
synced 2026-01-25 03:55:08 -06:00
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.
This commit is contained in:
parent
3e480b17c7
commit
22a9dc1b79
1 changed files with 11 additions and 6 deletions
|
|
@ -1,5 +1,5 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013, 2014, 2015, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; 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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue