diff options
author | Eduardo Julian | 2022-10-03 02:22:11 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-10-03 02:22:11 -0400 |
commit | 2800492f26ee51c75fc056493e0946b39d5f503b (patch) | |
tree | eb2816edd80e53001431f5aac49a13c56491ed66 /stdlib/source/library/lux.lux | |
parent | ed779c7bbbf3c625461fd1c09c1a3c39eaabd9d6 (diff) |
Migrating default extensions to the new format [Part 0]
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux.lux | 47 |
1 files changed, 38 insertions, 9 deletions
diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index 19cc619a2..e1092f696 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -524,6 +524,15 @@ {#Product Bit {#Product Type Any}}}) .public) +... (type .public Default +... Definition) +("lux def" Default + ("lux type check" + Type + {#Named [..prelude "Default"] + Definition}) + .public) + ... (type .public Alias ... Symbol) ("lux def" Alias @@ -536,13 +545,15 @@ ... (type .public Global ... (Variant ... {#Definition Definition} -... {#Alias Alias})) +... {#Alias Alias} +... {#Default Default})) ("lux def" Global ("lux type check" Type {#Named [..prelude "Global"] {#Sum Definition - Alias}}) + {#Sum Alias + Default}}}) .public) ("lux def" global_tags @@ -550,10 +561,12 @@ {#Apply Symbol List} {#Item [..prelude "#Definition"] {#Item [..prelude "#Alias"] - {#End}}}) + {#Item [..prelude "#Default"] + {#End}}}}) #0) ("lux def" #Definition (tag [{#Some [0 #0 ..global_tags]} Global]) .public) -("lux def" #Alias (tag [{#Some [0 #1 ..global_tags]} Global]) .public) +("lux def" #Alias (tag [{#Some [1 #0 ..global_tags]} Global]) .public) +("lux def" #Default (tag [{#Some [1 #1 ..global_tags]} Global]) .public) ... (type .public (Bindings k v) ... (Record @@ -1907,7 +1920,10 @@ {#Right [state full_name]} {#Alias real_name} - {#Right [state real_name]}} + {#Right [state real_name]} + + {#Default _} + {#Left (all text#composite "Unknown definition: " (symbol#encoded full_name))}} constant) {#None} @@ -2037,7 +2053,10 @@ {#Definition [exported? 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))})} + {#Left (text#composite "Unavailable definition: " (symbol#encoded name))}) + + {#Default _} + {#Left (text#composite "Unknown definition: " (symbol#encoded name))}} definition)} (property#value expected_short definitions))} (property#value expected_module modules)))) @@ -2713,7 +2732,10 @@ (if (text#= module current_module) {#Some ("lux type as" Macro def_value)} {#None})) - {#None})} + {#None}) + + {#Default _} + {#None}} ("lux type check" Global gdef)))) (def' .private (named_macro full_name) @@ -4545,7 +4567,10 @@ {#Definition [exported? def_type def_value]} (if exported? (list name) - (list))))) + (list)) + + {#Default _} + (list)))) (let [[..#module_hash _ ..#module_aliases _ ..#definitions definitions ..#imports _ ..#module_state _] =module] definitions))] {#Right state (list#conjoint to_alias)}) @@ -4677,7 +4702,10 @@ (definition_type real_name state) {#Definition [exported? def_type def_value]} - {#Some def_type}))))) + {#Some def_type} + + {#Default _} + {#None}))))) (def (type_variable idx bindings) (-> Nat (List [Nat (Maybe Type)]) (Maybe Type)) @@ -5880,6 +5908,7 @@ (with_template [<type>] [(def .public <type> + Type (let [[_ short] (symbol <type>)] {.#Primitive (text#composite "#" short) (list)}))] |