catch

(catch (error expression) . (eval expressions))


Description:

Catch statement surrounding eval expressions. error expression will be run upon experiencing a throw in any eval expressions


Arguments:


Returns: boolean


Examples:

(define myfunc

   (lambda (x)

      (if (negative? x) (throw) x)))


(catch (print-error "Negatives Not Allowed")

       (print "Try 5")

       (print (myfunc 5))

       (print "Try -5")

       (print (myfunc -5)))



Back to index