grafts: Inline 'grafting?' and 'set-grafting'.
As for 'current-target-system' & co., this makes sure we don't needlessly allocate closures. * guix/grafts.scm (grafting?, set-grafting): Inline.master
parent
3c548c3e0e
commit
db45712a67
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -323,14 +323,14 @@ DRV, and graft DRV itself to refer to those grafted dependencies."
|
||||||
;; Whether to honor package grafts by default.
|
;; Whether to honor package grafts by default.
|
||||||
(make-parameter #t))
|
(make-parameter #t))
|
||||||
|
|
||||||
(define (set-grafting enable?)
|
(define-inlinable (set-grafting enable?)
|
||||||
"This monadic procedure enables grafting when ENABLE? is true, and disables
|
;; This monadic procedure enables grafting when ENABLE? is true, and
|
||||||
it otherwise. It returns the previous setting."
|
;; disables it otherwise. It returns the previous setting.
|
||||||
(lambda (store)
|
(lambda (store)
|
||||||
(values (%graft? enable?) store)))
|
(values (%graft? enable?) store)))
|
||||||
|
|
||||||
(define (grafting?)
|
(define-inlinable (grafting?)
|
||||||
"Return a Boolean indicating whether grafting is enabled."
|
;; Return a Boolean indicating whether grafting is enabled.
|
||||||
(lambda (store)
|
(lambda (store)
|
||||||
(values (%graft?) store)))
|
(values (%graft?) store)))
|
||||||
|
|
||||||
|
|
Reference in New Issue