erlang: try/catch/of/after, Phase 4 complete (+19 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled

This commit is contained in:
2026-04-25 03:26:01 +00:00
parent 1a5a2e8982
commit 882205aa70
6 changed files with 257 additions and 7 deletions

View File

@@ -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