Go to the first, previous, next, last section, table of contents.


Functions

A function is a Lisp object which, when applied to a sequence of argument values, produces a value -- the function's result. It may also produce side-effects. All Lisp functions return results -- there is nothing like a procedure in Pascal.

Functions are the main building-block in Lisp programs, each program is usually a system of inter-related functions.

There are two types of function: primitive functions are functions written in the C language, these are sometimes called built-in functions, the object containing the C code itself is called a subr. All other functions are written in Lisp.

Function: functionp object
Returns t if object is a function (i.e. it can be used as the function argument of funcall.

(functionp 'set)
    => t

(functionp 'setq)
    => nil

(functionp #'(lambda (x) (+ x 2)))
   => t


Go to the first, previous, next, last section, table of contents.