Skip to content

Commit

Permalink
Improve nrepl-dict error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
vemv committed Jul 21, 2023
1 parent 74be055 commit c2e4338
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
### Changes

- Bump the injected `cider-nrepl` to [0.32](https://github.com/clojure-emacs/cider-nrepl/blob/master/CHANGELOG.md).
- Improve `nrepl-dict` error reporting.

## 1.7.0 (2023-03-23)

Expand Down
6 changes: 3 additions & 3 deletions nrepl-dict.el
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,22 @@ Return new dict. Dict is modified by side effects."
(if (nrepl-dict-p dict)
(cl-loop for l on (cdr dict) by #'cddr
collect (car l))
(error "Not an nREPL dict")))
(error "Not an nREPL dict object: %s" dict)))

(defun nrepl-dict-vals (dict)
"Return all the values in the nREPL DICT."
(if (nrepl-dict-p dict)
(cl-loop for l on (cdr dict) by #'cddr
collect (cadr l))
(error "Not an nREPL dict")))
(error "Not an nREPL dict object: %s" dict)))

(defun nrepl-dict-map (fn dict)
"Map FN on nREPL DICT.
FN must accept two arguments key and value."
(if (nrepl-dict-p dict)
(cl-loop for l on (cdr dict) by #'cddr
collect (funcall fn (car l) (cadr l)))
(error "Not an nREPL dict")))
(error "Not an nREPL dict object: %s" dict)))

(defun nrepl-dict-merge (dict1 dict2)
"Destructively merge DICT2 into DICT1.
Expand Down

0 comments on commit c2e4338

Please sign in to comment.