Function: -when-let

-when-let is a macro defined in dash.el.

Signature

(-when-let (VAR VAL) &rest BODY)

Documentation

If VAL evaluates to non-nil, bind it to VAR and execute body.

Note: binding is done according to -let.

View in manual

Source Code

;; Defined in ~/.emacs.d/elpa/dash-20260221.1346/dash.el
(defmacro -when-let (var-val &rest body)
  "If VAL evaluates to non-nil, bind it to VAR and execute body.

Note: binding is done according to `-let'.

\(fn (VAR VAL) &rest BODY)"
  (declare (debug ((sexp form) body))
           (indent 1))
  `(-if-let ,var-val (progn ,@body)))