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/lang/translation/structure.jvm.lux | |
parent | b08f7d83a591be770af64b4c9ccd59f3306689e8 (diff) |
- Refactoring.
- Now giving type checking/inference a higher priority.
- Better error messages.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/structure.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/structure.jvm.lux | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/new-luxc/source/luxc/lang/translation/structure.jvm.lux b/new-luxc/source/luxc/lang/translation/structure.jvm.lux index 3ef03ac2c..68219b87c 100644 --- a/new-luxc/source/luxc/lang/translation/structure.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/structure.jvm.lux @@ -1,6 +1,7 @@ (;module: lux - (lux (control [monad #+ do]) + (lux (control [monad #+ do] + ["ex" exception #+ exception:]) (data text/format (coll [list])) [meta] @@ -16,13 +17,15 @@ (translation [";T" common]))) [../runtime]) +(exception: #export Not-A-Tuple) + (def: $Object $;Type ($t;class "java.lang.Object" (list))) (def: #export (translate-tuple translate members) (-> (-> ls;Synthesis (Meta $;Inst)) (List ls;Synthesis) (Meta $;Inst)) (do meta;Monad<Meta> [#let [size (list;size members)] - _ (&;assert "Cannot translate tuples with less than 2 elements." + _ (&;assert Not-A-Tuple (%code (` [(~@ members)])) (n.>= +2 size)) membersI (|> members list;enumerate |