branch: externals/dash
commit bbc1d9c0c7485be8342b5b4c165abe8dbb5fe21e
Author: Matus Goljer <[email protected]>
Commit: Matus Goljer <[email protected]>
`--each-while` should also expose `it-index`
---
dash.el | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/dash.el b/dash.el
index 4e214d0..41aea86 100644
--- a/dash.el
+++ b/dash.el
@@ -78,10 +78,12 @@ special values."
(let ((l (make-symbol "list"))
(c (make-symbol "continue")))
`(let ((,l ,list)
- (,c t))
+ (,c t)
+ (it-index 0))
(while (and ,l ,c)
(let ((it (car ,l)))
(if (not ,pred) (setq ,c nil) ,@body))
+ (setq it-index (1+ it-index))
(!cdr ,l)))))
(defun -each-while (list pred fn)