aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/control/aspect.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/control/aspect.lux')
-rw-r--r--stdlib/source/library/lux/control/aspect.lux46
1 files changed, 23 insertions, 23 deletions
diff --git a/stdlib/source/library/lux/control/aspect.lux b/stdlib/source/library/lux/control/aspect.lux
index ae08932e3..eda6a78c7 100644
--- a/stdlib/source/library/lux/control/aspect.lux
+++ b/stdlib/source/library/lux/control/aspect.lux
@@ -109,7 +109,7 @@
(def (without_global [module short])
(-> Symbol (analysis.Operation Any))
(function (_ lux)
- (let [without_global (is (-> (property.List .Global) (property.List .Global))
+ (let [without_global (is (-> (property.List [Bit .Global]) (property.List [Bit .Global]))
(property.lacks short))
without_global (is (-> .Module .Module)
(revised .#definitions without_global))
@@ -121,30 +121,30 @@
[]]})))
(def (global_reference name)
- (-> Symbol (Meta .Global))
+ (-> Symbol (Meta [Bit .Global]))
(do meta.monad
[name (meta.normal name)
current_module_name meta.current_module_name
lux meta.compiler_state]
(loop (again [[normal_module normal_short] name])
- (when (is (Maybe .Global)
+ (when (is (Maybe [Bit .Global])
(do maybe.monad
[(open "/[0]") (|> lux
(the .#modules)
(property.value normal_module))]
(property.value normal_short /#definitions)))
- {.#Some it}
+ {.#Some [exported? it]}
(when it
- {.#Definition [exported? type value]}
+ {.#Definition [type value]}
(if (or exported?
(text#= current_module_name normal_module))
- (in it)
+ (in [exported? it])
(meta.failure (%.format "Global is not an export: " (%.symbol name))))
- {.#Default [exported? type value]}
+ {.#Default [type value]}
(if (or exported?
(text#= current_module_name normal_module))
- (in it)
+ (in [exported? it])
(meta.failure (%.format "Global is not an export: " (%.symbol name))))
{.#Alias de_aliased}
@@ -159,9 +159,9 @@
(analysis.Operation of)))
(do phase.monad
[g!cache (macro.symbol "g!cache")
- global (global_reference name)
+ [exported? global] (global_reference name)
.let [cache_name (%.code g!cache)]
- _ (module.define cache_name global)
+ _ (module.define cache_name [exported? global])
it (then [g!cache global])
current_module_name meta.current_module_name
_ (without_global [current_module_name cache_name])]
@@ -174,11 +174,11 @@
(do phase.monad
[g!cache (declaration.lifted_analysis
(macro.symbol "g!cache"))
- global (declaration.lifted_analysis
- (global_reference name))
+ [exported? global] (declaration.lifted_analysis
+ (global_reference name))
.let [cache_name (%.code g!cache)]
_ (declaration.lifted_analysis
- (module.define cache_name global))
+ (module.define cache_name [exported? global]))
it (then [g!cache global])
current_module_name (declaration.lifted_analysis
meta.current_module_name)
@@ -191,10 +191,10 @@
(-> [Symbol .Global] (analysis.Operation of)
(analysis.Operation of)))
(do phase.monad
- [old (global_reference name)
- _ (module.override_definition name new)
+ [[exported? old] (global_reference name)
+ _ (module.override_definition name [exported? new])
it then
- _ (module.override_definition name old)]
+ _ (module.override_definition name [exported? old])]
(in it)))
(def (with_temporary_global' [name new] then)
@@ -202,13 +202,13 @@
(-> [Symbol .Global] (declaration.Operation anchor expression declaration of)
(declaration.Operation anchor expression declaration of)))
(do phase.monad
- [old (declaration.lifted_analysis
- (global_reference name))
+ [[exported? old] (declaration.lifted_analysis
+ (global_reference name))
_ (declaration.lifted_analysis
- (module.override_definition name new))
+ (module.override_definition name [exported? new]))
it then
_ (declaration.lifted_analysis
- (module.override_definition name old))]
+ (module.override_definition name [exported? old]))]
(in it)))
(def (expression type term)
@@ -226,7 +226,7 @@
(do phase.monad
[g!cache (macro.symbol "g!cache")
.let [cache_name (%.code g!cache)]
- _ (module.define cache_name {.#Definition [false Analysis (expression type term)]})
+ _ (module.define cache_name [false {.#Definition [Analysis (expression type term)]}])
it (then g!cache)
current_module_name meta.current_module_name
_ (without_global [current_module_name cache_name])]
@@ -279,7 +279,7 @@
(list#mix (function (_ [original value] then)
(<| (with_cached_analysis original)
(function (_ [g!original original_global]))
- (with_temporary_global [original {.#Definition [true Analysis (value g!original aspect)]}])
+ (with_temporary_global [original {.#Definition [Analysis (value g!original aspect)]}])
then))
(phase archive body)
(list [(symbol .local#) ..local]
@@ -296,7 +296,7 @@
(list#mix (function (_ [original value] then)
(<| (with_cached_analysis' original)
(function (_ [g!original original_global]))
- (with_temporary_global' [original {.#Definition [true Analysis (value g!original aspect)]}])
+ (with_temporary_global' [original {.#Definition [Analysis (value g!original aspect)]}])
then))
(phase archive body)
(list [(symbol .local#) ..local]