Remove dependecy `macroexp`

We need to support lower version since `macroexp-let2` was introduced at
Emacs 24.3
master
citreu 7 years ago
parent fd5980eace
commit 93e0465e0e
  1. 6
      dash.el

@ -1828,12 +1828,12 @@ kv can be any key-value store, such as plist, alist or hash-table."
"Generate extracting KEY from SOURCE for &alist destructuring."
`(cdr (assoc ,key ,source)))
(require 'macroexp)
(defun dash-expand:&hash? (key source)
"Generate extracting KEY from SOURCE for &hash? destructuring.
Similar to &hash but check whether the map is not nil."
(macroexp-let2 nil source source `(when ,source (gethash ,key ,source))))
(let ((src (make-symbol "src")))
`(let ((,src ,source))
(when ,src (gethash ,key ,src)))))
(defalias 'dash-expand:&keys 'dash-expand:&plist)

Loading…
Cancel
Save