OTWO-1213 Works around lost encoding in Ruby/C binding layer
[ohcount] / test / src_dir / scheme.scm
1 (+ 1 (/ 1 0) 3)
2 ; => A divide by zero error is raised
3
4 (with-failure-continuation
5     (lambda (error-record error-k)
6       'error)
7   (lambda () (+ 1 (/ 1 0) 3)))
8 ; => The symbol 'error
9
10 (with-failure-continuation
11     (lambda (error-record error-k)
12       (error-k 2))
13   (lambda () (+ 1 (/ 1 0) 3)))
14 ; => 6
15
16 (with-failure-continuation
17     (lambda (error-record error-k)
18       (throw error-record error-k))
19   (lambda () (+ 1 (/ 1 0) 3)))
20 ; => A divide by zero error is raised
21
22 (with-failure-continuation
23     (lambda (error-record error-k)
24       (throw (make-error '/ "could not perform the division.") error-k))
25   (lambda () (+ 1 (/ 1 0) 3)))
26 ; => An error is raised: Error in /: could not perform the division.
27
28 (with-failure-continuation
29     (lambda (error-record error-k)
30       (error 'example-function "could not evaluate the expression."))
31   (lambda () (+ 1 (/ 1 0) 3)))
32 ; => An error is raised: Error in example-function: could not evaluate the expression.