branch: externals/dash
commit 5637bd6f1b9cb757897deed26ec2a7400b63610e
Author: Matus Goljer <[email protected]>
Commit: Matus Goljer <[email protected]>
Add alias from -find to -first
---
README.md | 2 ++
dash.el | 9 ++++++++-
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/README.md b/README.md
index b6fcc96..534edaa 100644
--- a/README.md
+++ b/README.md
@@ -1233,6 +1233,8 @@ Returns the first x in `list` where (`pred` x) is
non-nil, else nil.
To get the first item in the list no questions asked, use `car`.
+This function is also available as `-find`.
+
```cl
(-first 'even? '(1 2 3)) ;; => 2
(-first 'even? '(1 3 5)) ;; => nil
diff --git a/dash.el b/dash.el
index 0f1eebc..d987ef8 100644
--- a/dash.el
+++ b/dash.el
@@ -329,9 +329,14 @@ If ELEMENTS is non nil, append these to the list as well."
(defun -first (pred list)
"Returns the first x in LIST where (PRED x) is non-nil, else nil.
-To get the first item in the list no questions asked, use `car'."
+To get the first item in the list no questions asked, use `car'.
+
+This function is also available as `-find'."
(--first (funcall pred it) list))
+(defalias '-find '-first)
+(defalias '--find '--first)
+
(defmacro --last (form list)
"Anaphoric form of `-last'."
(declare (debug (form form)))
@@ -1480,6 +1485,8 @@ structure such as plist or alist."
"-snoc"
"-first"
"--first"
+ "-find"
+ "--find"
"-last"
"--last"
"-first-item"