deprecation: Add a two-element form for simple aliases.
authorLudovic Courtès <ludo@gnu.org>
Fri, 10 Jan 2020 10:27:29 +0000 (11:27 +0100)
committerLudovic Courtès <ludo@gnu.org>
Sat, 11 Jan 2020 23:19:09 +0000 (00:19 +0100)
* guix/deprecation.scm (define-deprecated): Add a two-element form for
simple aliases: (define-deprecated old new).

guix/deprecation.scm

index 468b2e9..04d4d4a 100644 (file)
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +44,7 @@
     "Define a deprecated variable or procedure, along these lines:
 
   (define-deprecated foo bar 42)
+  (define-deprecated old new)
   (define-deprecated (baz x y) qux (qux y x))
 
 This will write a deprecation warning to GUIX-WARNING-PORT."
@@ -73,7 +74,10 @@ This will write a deprecation warning to GUIX-WARNING-PORT."
                     #'(real args (... ...)))
                    (id
                     (identifier? #'id)
-                    #'real))))))))))
+                    #'real)))))))
+      ((_ variable alias)
+       (identifier? #'alias)
+       #'(define-deprecated variable alias alias)))))
 
 (define-syntax-rule (define-deprecated/alias deprecated replacement)
   "Define as an alias a deprecated variable, procedure, or macro, along