aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/structure.jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/structure.jvm.lux')
-rw-r--r--new-luxc/source/luxc/lang/translation/structure.jvm.lux7
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