throw

(throw [str])


Description:

Throws an exception


Arguments:

            str -- optional error message for use if thrown outside a catch


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