[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/06: deprecation: Add 'define-deprecated/alias'.
From: |
guix-commits |
Subject: |
01/06: deprecation: Add 'define-deprecated/alias'. |
Date: |
Mon, 21 Jan 2019 17:21:47 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 1b7dd99738f17d3e3ebc29500bc475f9dd214ba3
Author: Ludovic Courtès <address@hidden>
Date: Mon Jan 21 15:30:14 2019 +0100
deprecation: Add 'define-deprecated/alias'.
* guix/deprecation.scm (define-deprecated/alias): New macro.
---
guix/deprecation.scm | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/guix/deprecation.scm b/guix/deprecation.scm
index 453aad7..8d9e427 100644
--- a/guix/deprecation.scm
+++ b/guix/deprecation.scm
@@ -20,7 +20,7 @@
#:use-module (guix i18n)
#:use-module (ice-9 format)
#:export (define-deprecated
- without-deprecation-warnings
+ define-deprecated/alias
deprecation-warning-port))
;;; Commentary:
@@ -87,3 +87,23 @@ This will write a deprecation warning to
DEPRECATION-WARNING-PORT."
(id
(identifier? #'id)
#'real))))))))))
+
+(define-syntax-rule (define-deprecated/alias deprecated replacement)
+ "Define as an alias a deprecated variable, procedure, or macro, along
+these lines:
+
+ (define-deprecated/alias nix-server? store-connection?)
+
+where 'nix-server?' is the deprecated name for 'store-connection?'.
+
+This will write a deprecation warning to DEPRECATION-WARNING-PORT."
+ (define-syntax deprecated
+ (lambda (s)
+ (warn-about-deprecation 'deprecated (syntax-source s)
+ #:replacement 'replacement)
+ (syntax-case s ()
+ ((_ args (... ...))
+ #'(replacement args (... ...)))
+ (id
+ (identifier? #'id)
+ #'replacement)))))
- branch master updated (6185732 -> f896abc), guix-commits, 2019/01/21
- 06/06: gnu: emacs-nix-mode: Move to emacs-xyz.scm., guix-commits, 2019/01/21
- 04/06: store: Rename '&nix-error' to '&store-error'., guix-commits, 2019/01/21
- 03/06: store: Rename <nix-server> to <store-connection>., guix-commits, 2019/01/21
- 05/06: tests: Adjust for removal of 'device' field in <bootloader-configuration>., guix-commits, 2019/01/21
- 02/06: deprecation: Send warnings to (current-error-port) by default., guix-commits, 2019/01/21
- 01/06: deprecation: Add 'define-deprecated/alias'.,
guix-commits <=