Skip to content
TurtleKitty edited this page May 11, 2019 · 2 revisions

return

This dynamic variable terminates a procedure and returns the value given. As procedures return their final expression's value by default, this operator is only necessary for early termination.

(proc foo (x)
   (when (= x 0)
      (return 42))
   (* x 7))

(foo 0) ; 42
(foo 2) ; 14
Clone this wiki locally