Function: when

when is a macro defined in subr.el.gz.

Signature

(when COND BODY...)

Documentation

If COND yields non-nil, do BODY, else return nil.

When COND yields non-nil, eval BODY forms sequentially and return value of last one, or nil if there are none.

Probably introduced at or before Emacs version 1.1.

Source Code

;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defmacro when (cond &rest body)
  "If COND yields non-nil, do BODY, else return nil.
When COND yields non-nil, eval BODY forms sequentially and return
value of last one, or nil if there are none.

\(fn COND BODY...)"
  (declare (indent 1) (debug t))
  (list 'if cond (cons 'progn body)))