aboutsummaryrefslogtreecommitdiff
path: root/source/lux/meta/lux.lux
diff options
context:
space:
mode:
authorEduardo Julian2015-08-17 16:59:18 -0400
committerEduardo Julian2015-08-17 16:59:18 -0400
commit1b48e9e06cb90187b28381bcadbeeba60806964d (patch)
tree1e30e61bd5ec7f5d3b0c2c12f1f549bc23b5ee48 /source/lux/meta/lux.lux
parentdf3e4ba2df6462812174e69ea5c334a7edbbd5c7 (diff)
- Finished turning tags into indices.
- As an unexpected bonus, the compiler has become 2.5x faster. - Fixed some minor bugs. - Tag declarations now include associated types. - Tag declarations info is now stored twice (one from the perspective of tags, the other from the perspective of types). - Changed the named of the "types" member of the Compiler type, to "type-vars" to avoid collision with the "types" member of the Module type.
Diffstat (limited to 'source/lux/meta/lux.lux')
-rw-r--r--source/lux/meta/lux.lux16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/lux/meta/lux.lux b/source/lux/meta/lux.lux
index d1bc4e219..057345622 100644
--- a/source/lux/meta/lux.lux
+++ b/source/lux/meta/lux.lux
@@ -29,7 +29,7 @@
## [Structures]
(defstruct #export Lux/Functor (F;Functor Lux)
- (def (map f fa)
+ (def (F;map f fa)
(lambda [state]
(case (fa state)
(#;Left msg)
@@ -39,11 +39,11 @@
(#;Right [state' (f a)])))))
(defstruct #export Lux/Monad (M;Monad Lux)
- (def _functor Lux/Functor)
- (def (wrap x)
+ (def M;_functor Lux/Functor)
+ (def (M;wrap x)
(lambda [state]
(#;Right [state x])))
- (def (join mma)
+ (def (M;join mma)
(lambda [state]
(case (mma state)
(#;Left msg)
@@ -254,7 +254,7 @@
(let [vname' (ident->text name)]
(case state
{#;source source #;modules modules
- #;envs envs #;types types #;host host
+ #;envs envs #;type-vars types #;host host
#;seed seed #;eval? eval? #;expected expected
#;cursor cursor}
(some (: (-> (Env Text (, LuxVar Type)) (Maybe Type))
@@ -275,14 +275,14 @@
(-> Ident Compiler (Maybe Type))
(let [[v-prefix v-name] name
{#;source source #;modules modules
- #;envs envs #;types types #;host host
+ #;envs envs #;type-vars types #;host host
#;seed seed #;eval? eval? #;expected expected
#;cursor cursor} state]
(case (get v-prefix modules)
#;None
#;None
- (#;Some {#;defs defs #;module-aliases _ #;imports _})
+ (#;Some {#;defs defs #;module-aliases _ #;imports _ #;tags _ #;types _})
(case (get v-name defs)
#;None
#;None
@@ -311,7 +311,7 @@
_
(let [{#;source source #;modules modules
- #;envs envs #;types types #;host host
+ #;envs envs #;type-vars types #;host host
#;seed seed #;eval? eval? #;expected expected
#;cursor cursor} state]
(#;Left ($ text:++ "Unknown var: " (ident->text name) "\n\n" (show-envs envs))))))))