abort


abort(obj)
      

Calls the current exception-handler with obj as argument. If the exception-handler returns, abort will be tail-called with a noncontinuable-exception object, whose reason field is obj, as argument. Note that only trycc allows the re-invocation of abort. An abort called from a try will behave like a normal error.

Return void.

Examples:


callcc(^(k)
        try abort('hello) 
        catch (e) 
        { showln("caught: ", e)
          if (is_noncontinuable_exception(e)) 
            k(noncontinuable_exception_reason(e))
          else 100 })
//> caught: hello
// 100

callcc(^(k)
        trycc abort('hello) 
        catch (e) 
        { showln("caught: ", e); 
          if (is_noncontinuable_exception(e)) 
            k(noncontinuable_exception_reason(e))
          else 100 })
//> caught: hello
//> caught: [noncontinuable, reason:hello]
// hello
      

Also see:

error
raise


Core Module Index | Contents