Next: Integrating Relations and Up: LL: LISP light Previous: Prelude

User-definable Functions

In LL, functions can only be defined via defun in the following form:

(defun function (var var) . body)

Optional, keyword, and rest parameters are not directly supported. However, in contrast to COMMON LISP, a function may have - just like a REL procedure - more than one arity. This allows REL procedures to be transformed into LL functions more easily because renaming is not necessary.

This also allows optional and keyword parameters to be simulated. For instance, the COMMON LISP function definition

(defun f (x y &optional(z 0)) )

can be expressed in LL as:

(defun f (x y z) )
(defun f (x y) (f x y 0))

Similarly, `finite rests' (e.g. a fixed number, , of arities), can be expressed:

(defun f () )
(defun f (x) )

(defun f (x x) )

Harold Boley & Michael Sintek (