aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux.lux
diff options
context:
space:
mode:
authorEduardo Julian2022-10-28 23:11:52 -0400
committerEduardo Julian2022-10-28 23:11:52 -0400
commit736521eb56a45122eb0a545b677d3ffca1451080 (patch)
tree484221adf44f4cd5b9d0132fc41441d0ad098533 /stdlib/source/library/lux.lux
parent54d22bc41b874d52a94a96aafca18ab3a6357edb (diff)
Eliminated the .alias# extension. Now detecting aliases in .def#.
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux.lux47
1 files changed, 26 insertions, 21 deletions
diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux
index 0be0527c4..d8ef5fd2f 100644
--- a/stdlib/source/library/lux.lux
+++ b/stdlib/source/library/lux.lux
@@ -489,11 +489,11 @@
#0)
... (type .public Definition
-... [Bit Type Any])
+... [Type Any])
(.def# Definition
(.is# Type
{#Named [..prelude "Definition"]
- {#Product Bit {#Product Type Any}}})
+ {#Product Type Any}})
.public)
... (type .public Default
@@ -692,7 +692,7 @@
... (Record
... [#module_hash Nat
... #module_aliases (List [Text Text])
-... #definitions (List [Text Global])
+... #definitions (List [Text [Bit Global]])
... #imports (List Text)
... #module_state Module_State]))
(.def# Module
@@ -706,7 +706,7 @@
{#Apply {#Product Text Text} List}
{#Product
... definitions
- {#Apply {#Product Text Global} List}
+ {#Apply {#Product Text {#Product Bit Global}} List}
{#Product
... imports
{#Apply Text List}
@@ -1841,7 +1841,7 @@
..#seed seed ..#expected expected ..#location location ..#extensions extensions
..#scope_type_vars scope_type_vars ..#eval _eval] state]
({{#Some [..#module_hash _ ..#module_aliases _ ..#definitions definitions ..#imports _ ..#module_state _]}
- ({{#Some constant}
+ ({{#Some [_ constant]}
({{#Definition _}
{#Right [state full_name]}
@@ -1972,11 +1972,11 @@
({{#None}
{#Left (text#composite "Unknown definition: " (symbol#encoded name))}
- {#Some definition}
+ {#Some [exported? definition]}
({{#Alias real_name}
(definition_value real_name state)
- {#Definition [exported? def_type def_value]}
+ {#Definition [def_type def_value]}
(if (available? expected_module current_module exported?)
{#Right [state [def_type def_value]]}
{#Left (text#composite "Unavailable definition: " (symbol#encoded name))})
@@ -2637,12 +2637,13 @@
($ Maybe Macro))
(do maybe#monad
[$module (property#value module modules)
- gdef (let' [[..#module_hash _ ..#module_aliases _ ..#definitions bindings ..#imports _ ..#module_state _] (.is# Module $module)]
- (property#value name bindings))]
+ exported?,gdef (let' [[..#module_hash _ ..#module_aliases _ ..#definitions bindings ..#imports _ ..#module_state _] (.is# Module $module)]
+ (property#value name bindings))
+ .let' [[exported? gdef] exported?,gdef]]
({{#Alias [r_module r_name]}
(named_macro' modules current_module r_module r_name)
- {#Definition [exported? def_type def_value]}
+ {#Definition [def_type def_value]}
(if (macro_type? def_type)
(if exported?
{#Some (.as# Macro def_value)}
@@ -3889,7 +3890,7 @@
..#imports _
..#module_state _] =module]]
(when (property#value name definitions)
- {#Some {#Definition [exported type value]}}
+ {#Some [exported {#Definition [type value]}]}
(meta#in [exported (as Label value)])
_
@@ -3905,13 +3906,13 @@
..#definitions definitions
..#imports _
..#module_state _] module]]
- (in ((is (-> (List [Text Global])
+ (in ((is (-> (List [Text [Bit Global]])
(Maybe (List Symbol)))
(function (again remaining)
(when remaining
{#Item [slot head] tail}
(when head
- {#Definition [exported? type value]}
+ [exported? {#Definition [type value]}]
(if (and (type#= Slot type)
(or exported?
(text#= expected_module actual_module)))
@@ -3954,7 +3955,7 @@
..#imports _
..#module_state _] =module]]
(when (property#value name definitions)
- {#Some {#Definition [exported? type value]}}
+ {#Some [exported? {#Definition [type value]}]}
(if (type#= Type type)
(do meta#monad
[slots (slot_family module (as Type value))]
@@ -4470,14 +4471,16 @@
[current_module modules])]
(when (property#value module modules)
{#Some =module}
- (let [to_alias (list#each (is (-> [Text Global]
+ (let [to_alias (list#each (is (-> [Text [Bit Global]]
(List Text))
- (function (_ [name definition])
+ (function (_ [name [exported? definition]])
(when definition
{#Alias _}
- (list)
+ (if exported?
+ (list name)
+ (list))
- {#Definition [exported? def_type def_value]}
+ {#Definition [def_type def_value]}
(if exported?
(list name)
(list))
@@ -4537,7 +4540,9 @@
(def (alias_definition imported_module def)
(-> Text Text Code)
- (` (.alias# (, (local$ def)) (, (symbol$ [imported_module def])))))
+ (` (.def# (, (local$ def))
+ (, (symbol$ [imported_module def]))
+ .private)))
(def .public only
(macro (_ tokens)
@@ -4609,12 +4614,12 @@
{#None}
{#None}
- {#Some definition}
+ {#Some [exported? definition]}
(when definition
{#Alias real_name}
(definition_type real_name state)
- {#Definition [exported? def_type def_value]}
+ {#Definition [def_type def_value]}
{#Some def_type}
{#Default _}