erlang: try/catch/of/after, Phase 4 complete (+19 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
This commit is contained in:
@@ -531,6 +531,30 @@
|
||||
er-mk-exit-marker
|
||||
(fn (reason) {:tag "er-exit-marker" :reason reason}))
|
||||
|
||||
(define
|
||||
er-mk-throw-marker
|
||||
(fn (reason) {:tag "er-throw-marker" :reason reason}))
|
||||
|
||||
(define
|
||||
er-mk-error-marker
|
||||
(fn (reason) {:tag "er-error-marker" :reason reason}))
|
||||
|
||||
(define
|
||||
er-thrown?
|
||||
(fn
|
||||
(v)
|
||||
(and
|
||||
(= (type-of v) "dict")
|
||||
(= (get v :tag) "er-throw-marker"))))
|
||||
|
||||
(define
|
||||
er-errored?
|
||||
(fn
|
||||
(v)
|
||||
(and
|
||||
(= (type-of v) "dict")
|
||||
(= (get v :tag) "er-error-marker"))))
|
||||
|
||||
(define
|
||||
er-sched-run-all!
|
||||
(fn
|
||||
@@ -592,7 +616,16 @@
|
||||
(guard
|
||||
(c
|
||||
((er-suspended? c) (set-nth! result-ref 0 c))
|
||||
((er-exited? c) (set-nth! result-ref 0 c)))
|
||||
((er-exited? c) (set-nth! result-ref 0 c))
|
||||
((er-thrown? c)
|
||||
(set-nth!
|
||||
result-ref
|
||||
0
|
||||
(er-mk-exit-marker
|
||||
(er-mk-tuple
|
||||
(list (er-mk-atom "nocatch") (get c :reason))))))
|
||||
((er-errored? c)
|
||||
(set-nth! result-ref 0 (er-mk-exit-marker (get c :reason)))))
|
||||
(set-nth!
|
||||
result-ref
|
||||
0
|
||||
|
||||
Reference in New Issue
Block a user