release 0.1.0
This commit is contained in:
commit
30d94536a9
90 changed files with 7722 additions and 0 deletions
22
modules/core/error.owa
Normal file
22
modules/core/error.owa
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
(seq
|
||||
(fn throw! []
|
||||
(throw.runtime_error! (str.join "" %%)))
|
||||
(fn panic! [v]
|
||||
(throw.panic! v))
|
||||
(fn unreachable! []
|
||||
(throw! "Reached unreachable code"))
|
||||
(fn not_implemented! []
|
||||
(throw! "Not implemented"))
|
||||
(def try builtins.errors.try)
|
||||
|
||||
(defmacro catch [pattern then]
|
||||
(lambda [msg type] (if-eq (type $pattern)
|
||||
$then
|
||||
:null)))
|
||||
|
||||
(namespace throw
|
||||
(def panic! builtins.errors.throw_panic)
|
||||
(def type_error! builtins.errors.throw_type_error)
|
||||
(def arity_error! builtins.errors.throw_arity_error)
|
||||
(def runtime_error! builtins.errors.throw_runtime_error)
|
||||
))
|
||||
Loading…
Add table
Add a link
Reference in a new issue