diff options
author | Eduardo Julian | 2017-11-13 23:26:06 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-11-13 23:26:06 -0400 |
commit | 70005a6dee1eba3e3f5694aa4903e95988dcaa3d (patch) | |
tree | 19141f900847092c3aa5032a62b6b97eb1ea9a33 /new-luxc/source/luxc/base.lux | |
parent | b08f7d83a591be770af64b4c9ccd59f3306689e8 (diff) |
- Refactoring.
- Now giving type checking/inference a higher priority.
- Better error messages.
Diffstat (limited to 'new-luxc/source/luxc/base.lux')
-rw-r--r-- | new-luxc/source/luxc/base.lux | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/new-luxc/source/luxc/base.lux b/new-luxc/source/luxc/base.lux index c7768cd8c..373c6b12b 100644 --- a/new-luxc/source/luxc/base.lux +++ b/new-luxc/source/luxc/base.lux @@ -9,7 +9,8 @@ text/format (coll [list])) [meta] - (meta (type ["tc" check]))) + (meta (type ["tc" check]) + ["s" syntax #+ syntax:])) (luxc (lang ["la" analysis]))) (type: #export Eval @@ -30,16 +31,15 @@ (meta;fail (format message "\n\n" "@ " location)))) -(def: #export (assert message test) - (-> Text Bool (Meta Unit)) - (if test - (:: meta;Monad<Meta> wrap []) - (fail message))) - (def: #export (throw exception message) (All [a] (-> ex;Exception Text (Meta a))) (fail (exception message))) +(syntax: #export (assert exception message test) + (wrap (list (` (if (~ test) + (:: meta;Monad<Meta> (~' wrap) []) + (;;throw (~ exception) (~ message))))))) + (def: #export (with-expected-type expected action) (All [a] (-> Type (Meta a) (Meta a))) (function [compiler] |