emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/cider 4b1710595f 5/8: Deprecate 3-argument call to nrepl-d


From: ELPA Syncer
Subject: [nongnu] elpa/cider 4b1710595f 5/8: Deprecate 3-argument call to nrepl-dict-get
Date: Tue, 11 Jun 2024 03:59:33 -0400 (EDT)

branch: elpa/cider
commit 4b1710595f88c3fed5f29d69af96a7444dae480b
Author: yuhan0 <qythium@gmail.com>
Commit: Bozhidar Batsov <bozhidar@batsov.dev>

    Deprecate 3-argument call to nrepl-dict-get
    
    Calling the function with 3 arguments will continue to work, but
    raise a warning during byte compilation.
---
 nrepl-dict.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/nrepl-dict.el b/nrepl-dict.el
index dadf41f7fa..a408d13625 100644
--- a/nrepl-dict.el
+++ b/nrepl-dict.el
@@ -61,14 +61,20 @@ whose car is KEY.  Comparison is done with `equal'."
   (member key (nrepl-dict-keys dict)))
 
 (defun nrepl-dict-get (dict key &optional default)
-  "Get from DICT value associated with KEY, optional DEFAULT if KEY not in 
DICT.
-If dict is nil, return nil.  If DEFAULT not provided, and KEY not in DICT,
-return nil.  If DICT is not an nREPL dict object, an error is thrown."
+  "Get from DICT value associated with KEY.
+If DICT is nil, return nil.
+If DICT is not an nREPL dict object, an error is thrown.
+
+If KEY is not in DICT, return DEFAULT (if provided).
+Note that the use of DEFAULT is deprecated and will be
+removed in a future release."
+  (declare (advertised-calling-convention (dict key) "1.16"))
   (when dict
     (if (nrepl-dict-p dict)
         ;; Note: The structure of the following expression avoids the
         ;; expensive containment check in nearly all cases, see #3717
         (or (lax-plist-get (cdr dict) key)
+            ;; TODO: remove DEFAULT argument and the following clause
             (when default
               (and (not (nrepl-dict-contains dict key))
                    default)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]