diff options
Diffstat (limited to '')
-rw-r--r-- | luxc/src/lux/analyser.clj | 4 | ||||
-rw-r--r-- | stdlib/source/lux.lux | 18 |
2 files changed, 13 insertions, 9 deletions
diff --git a/luxc/src/lux/analyser.clj b/luxc/src/lux/analyser.clj index fe560ed10..116102f37 100644 --- a/luxc/src/lux/analyser.clj +++ b/luxc/src/lux/analyser.clj @@ -117,6 +117,10 @@ (&/with-analysis-meta cursor exo-type (&&lux/analyse-ann analyse eval! exo-type ?type ?value))) + "lux check type" + (|let [(&/$Cons ?value (&/$Nil)) parameters] + (analyse-ast optimize eval! compile-module compilers &type/Type ?value)) + "lux coerce" (|let [(&/$Cons ?type (&/$Cons ?value diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux index 7aa9a96a6..bf77ca259 100644 --- a/stdlib/source/lux.lux +++ b/stdlib/source/lux.lux @@ -185,11 +185,11 @@ ## ) ("lux def" Type (+12 ["lux" "Type"] - ("lux case" (+11 (+6 +1) (+6 +0)) + ("lux case" ("lux check type" (+11 (+6 +1) (+6 +0))) Type - ("lux case" (+11 Type List) + ("lux case" ("lux check type" (+11 Type List)) Type-List - ("lux case" (+4 Type Type) + ("lux case" ("lux check type" (+4 Type Type)) Type-Pair (+11 Void (+9 #Nil @@ -336,11 +336,11 @@ ## (#Record (List [(w (Code' w)) (w (Code' w))]))) ("lux def" Code' (#Named ["lux" "Code'"] - ("lux case" (#Apply (#Apply (#Bound +1) - (#Bound +0)) - (#Bound +1)) + ("lux case" ("lux check type" (#Apply (#Apply (#Bound +1) + (#Bound +0)) + (#Bound +1))) Code - ("lux case" (#Apply Code List) + ("lux case" ("lux check type" (#Apply Code List)) Code-List (#UnivQ #Nil (#Sum ## "lux;Bool" @@ -393,7 +393,7 @@ ## (Ann Cursor (Code' (Ann Cursor)))) ("lux def" Code (#Named ["lux" "Code"] - ("lux case" (#Apply Cursor Ann) + ("lux case" ("lux check type" (#Apply Cursor Ann)) w (#Apply (#Apply w Code') w))) [dummy-cursor @@ -866,7 +866,7 @@ (#Cons body #Nil)))))) #Nil)))))) #Nil)) - + _ (fail "Wrong syntax for function''")))) (record$ default-macro-meta)) |