BEE Lisp Functions Reference

<object> EXIT (value)

Exits from current function and returns value as result. Calling EXIT within main program branch causes process to terminate.

Example:

(DEFUN factorial (n)

     (

          COND (  (ISINTEGER n) 1) (1 (EXIT ( – 0 1) ) )

     )

     (

          COND ( (< n 0 ) (EXIT ( – 0 1))  )

     )

     (

          COND ( n ( IMUL n (factorial ( – n 1 ) ) ) ) (1 1)

     )

)