Function: nrepl-dict-get

nrepl-dict-get is a byte-compiled function defined in nrepl-dict.el.

Signature

(nrepl-dict-get DICT KEY)

Documentation

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.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/nrepl-dict.el
(defun nrepl-dict-get (dict key &optional default)
  "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 (nrepl-plist-get (cdr dict) key)
            ;; TODO: remove DEFAULT argument and the following clause
            (when default
              (and (not (nrepl-dict-contains dict key))
                   default)))
      (error "Not an nREPL dict object: %s" dict))))