How do I raise and handle an exception in MIT scheme?
Something like [it doesn't work]
((< val 0) (raise "-ve value") )
How do I raise and handle an exception in MIT scheme?
Something like [it doesn't work]
((< val 0) (raise "-ve value") )
The documentation does provide the answer, but no code samples, so here is one:
Here we're just displaying the error (what the documentation calls a "condition") and doing nothing.
To have this function handle all conditions do:
Or you can just wrap one code block with: