Function: if

if is a special form defined in eval.c.

Signature

(if COND THEN ELSE...)

Documentation

If COND yields non-nil, do THEN, else do ELSE...

Returns the value of THEN or the value of the last of the ELSE's. THEN must be one expression, but ELSE... can be zero or more expressions. If COND yields nil, and there are no ELSE's, the value is nil.

View in manual

Probably introduced at or before Emacs version 15.

Source Code

// Defined in /usr/src/emacs/src/eval.c
{
  Lisp_Object cond;

  cond = eval_sub (XCAR (args));

  if (!NILP (cond))
    return eval_sub (Fcar (XCDR (args)));
  return Fprogn (Fcdr (XCDR (args)));
}