Function: -take-while

-take-while is a byte-compiled function defined in dash.el.

Signature

(-take-while PRED LIST)

Documentation

Take successive items from LIST for which PRED returns non-nil.

PRED is a function of one argument. Return a new list of the successive elements from the start of LIST for which PRED returns non-nil.

This function's anaphoric counterpart is --take-while.

For another variant, see also -drop-while.

View in manual

Source Code

;; Defined in ~/.emacs.d/elpa/dash-20260221.1346/dash.el
(defun -take-while (pred list)
  "Take successive items from LIST for which PRED returns non-nil.
PRED is a function of one argument.  Return a new list of the
successive elements from the start of LIST for which PRED returns
non-nil.

This function's anaphoric counterpart is `--take-while'.

For another variant, see also `-drop-while'."
  (declare (important-return-value t))
  (--take-while (funcall pred it) list))