Defining Functions in Lisp

Functions, as seen already with Lisp built-in car, cdr, etc, process data. To declare a new function other than those pre-existing ones, Lisp provides defun, itself a function, to be followed by a list of argument names representing data. The body of the function consists of other functions operation on the list of specified arguments. The following example demonstrates the definition of a new function that given any time- duration will return its golden-section:

(defun find-golden-section (time-duration)
(* .618 time-duration))


Once defined, the new function can be called up, as for example:

> (find-golden-section 60)
37.08