Next: , Previous: , Up: Non-Local Exits   [Contents][Index]


5.13.4.2 Function Exits

Librep has no explicit return statement, as found in most other languages. Where a value has to returned from a function before the function would normally exit, a catch/throw pair may be used.

For example:

(defun foo (x y)
  (catch 'return
     (when (= x 2)
       (throw 'return nil))
     …