diff --git a/README.md b/README.md index c2f4a39..453b5ab 100644 --- a/README.md +++ b/README.md @@ -442,6 +442,8 @@ Return a new list of the items in `list` for which `pred` returns a non-nil valu Alias: `-select` +See also: [`-keep`](#-keep-fn-list) + ```el (-filter (lambda (num) (= 0 (% num 2))) '(1 2 3 4)) ;; => '(2 4) (-filter 'even? '(1 2 3 4)) ;; => '(2 4) @@ -1237,6 +1239,8 @@ Take a predicate `pred` and a `list` and return the index of the first element in the list satisfying the predicate, or nil if there is no such element. +See also [`-first`](#-first-pred-list). + ```el (-find-index 'even? '(2 4 1 6 3 3 5 8)) ;; => 0 (--find-index (< 5 it) '(2 4 1 6 3 3 5 8)) ;; => 3 @@ -1249,6 +1253,8 @@ Take a predicate `pred` and a `list` and return the index of the last element in the list satisfying the predicate, or nil if there is no such element. +See also [`-last`](#-last-pred-list). + ```el (-find-last-index 'even? '(2 4 1 6 3 3 5 8)) ;; => 7 (--find-last-index (< 5 it) '(2 7 1 6 3 8 5 2)) ;; => 5 diff --git a/dash.el b/dash.el index 5f9f840..b799b44 100644 --- a/dash.el +++ b/dash.el @@ -1159,7 +1159,9 @@ predicate PRED, in ascending order." (defun -find-index (pred list) "Take a predicate PRED and a LIST and return the index of the first element in the list satisfying the predicate, or nil if -there is no such element." +there is no such element. + +See also `-first'." (car (-find-indices pred list))) (defmacro --find-index (form list) @@ -1170,7 +1172,9 @@ there is no such element." (defun -find-last-index (pred list) "Take a predicate PRED and a LIST and return the index of the last element in the list satisfying the predicate, or nil if -there is no such element." +there is no such element. + +See also `-last'." (-last-item (-find-indices pred list))) (defmacro --find-last-index (form list)