diff options
author | Eduardo Julian | 2017-12-04 18:51:25 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-12-04 18:51:25 -0400 |
commit | 880b1a68c0b92a9271ebe028202dd9d71e8e69c6 (patch) | |
tree | 4c52113628ca11a727a969c4f5bdca0d9903b9b6 /stdlib/source/lux.lux | |
parent | 07af667db0ca6b831cf6e24ba6bc288886c95dd8 (diff) |
- Re-named "Def" to "Definition".
Diffstat (limited to 'stdlib/source/lux.lux')
-rw-r--r-- | stdlib/source/lux.lux | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux index cdfe0e313..17eb44933 100644 --- a/stdlib/source/lux.lux +++ b/stdlib/source/lux.lux @@ -484,10 +484,10 @@ #Nil)) (record$ #Nil)) -## (type: Def +## (type: Definition ## [Type Code Top]) -("lux def" Def - (#Named ["lux" "Def"] +("lux def" Definition + (#Named ["lux" "Definition"] (#Product Type (#Product Code Top))) (record$ (#Cons [(tag$ ["lux" "doc"]) (text$ "Represents all the data associated with a definition: its type, its annotations, and its value.")] @@ -595,11 +595,11 @@ ## (type: Module ## {#module-hash Nat ## #module-aliases (List [Text Text]) -## #defs (List [Text Def]) +## #definitions (List [Text Definition]) ## #imports (List Text) ## #tags (List [Text [Nat (List Ident) Bool Type]]) ## #types (List [Text [(List Ident) Bool Type]]) -## #module-anns (Maybe Anns) +## #module-anns (Maybe Code) ## #module-state Module-State}) ("lux def" Module (#Named ["lux" "Module"] @@ -607,8 +607,8 @@ Nat (#Product ## "lux.module-aliases" (#Apply (#Product Text Text) List) - (#Product ## "lux.defs" - (#Apply (#Product Text Def) List) + (#Product ## "lux.definitions" + (#Apply (#Product Text Definition) List) (#Product ## "lux.imports" (#Apply Text List) (#Product ## "lux.tags" @@ -631,7 +631,7 @@ (record$ (#Cons [(tag$ ["lux" "tags"]) (tuple$ (#Cons (text$ "module-hash") (#Cons (text$ "module-aliases") - (#Cons (text$ "defs") + (#Cons (text$ "definitions") (#Cons (text$ "imports") (#Cons (text$ "tags") (#Cons (text$ "types") @@ -1811,8 +1811,8 @@ #seed seed #expected expected #cursor cursor #scope-type-vars scope-type-vars} state] ("lux case" (get module modules) - {(#Some {#module-hash _ #module-aliases _ #defs defs #imports _ #tags tags #types types #module-annotations _ #module-state _}) - ("lux case" (get name defs) + {(#Some {#module-hash _ #module-aliases _ #definitions definitions #imports _ #tags tags #types types #module-annotations _ #module-state _}) + ("lux case" (get name definitions) {(#Some [def-type def-meta def-value]) ("lux case" (get-meta ["lux" "alias"] def-meta) {(#Some [_ (#Symbol real-name)]) @@ -2419,9 +2419,9 @@ ($' Maybe Macro)) (do Monad<Maybe> [$module (get module modules) - gdef (let' [{#module-hash _ #module-aliases _ #defs bindings #imports _ #tags tags #types types #module-annotations _ #module-state _} ("lux check" Module $module)] + gdef (let' [{#module-hash _ #module-aliases _ #definitions bindings #imports _ #tags tags #types types #module-annotations _ #module-state _} ("lux check" Module $module)] (get name bindings))] - (let' [[def-type def-meta def-value] ("lux check" Def gdef)] + (let' [[def-type def-meta def-value] ("lux check" Definition gdef)] ("lux case" (get-meta ["lux" "macro?"] def-meta) {(#Some [_ (#Bool true)]) ("lux case" (get-meta ["lux" "export?"] def-meta) @@ -3594,7 +3594,7 @@ (-> Ident (Meta [Nat (List Ident) Bool Type])) (do Monad<Meta> [=module (find-module module) - #let [{#module-hash _ #module-aliases _ #defs bindings #imports _ #tags tags-table #types types #module-annotations _ #module-state _} =module]] + #let [{#module-hash _ #module-aliases _ #definitions bindings #imports _ #tags tags-table #types types #module-annotations _ #module-state _} =module]] (case (get name tags-table) (#Some output) (return output) @@ -3617,7 +3617,7 @@ (#Named [module name] unnamed) (do Monad<Meta> [=module (find-module module) - #let [{#module-hash _ #module-aliases _ #defs bindings #imports _ #tags tags #types types #module-annotations _ #module-state _} =module]] + #let [{#module-hash _ #module-aliases _ #definitions bindings #imports _ #tags tags #types types #module-annotations _ #module-state _} =module]] (case (get name types) (#Some [tags exported? (#Named _ _type)]) (case (resolve-struct-type _type) @@ -3701,22 +3701,22 @@ (let [[exported? tokens'] (export^ tokens) ?parts (: (Maybe [Code (List Code) Code Code (List Code)]) (case tokens' - (^ (list& [_ (#Form (list& name args))] [meta-rec-cursor (#Record meta-rec-parts)] type defs)) - (#Some name args type [meta-rec-cursor (#Record meta-rec-parts)] defs) + (^ (list& [_ (#Form (list& name args))] [meta-rec-cursor (#Record meta-rec-parts)] type definitions)) + (#Some name args type [meta-rec-cursor (#Record meta-rec-parts)] definitions) - (^ (list& name [meta-rec-cursor (#Record meta-rec-parts)] type defs)) - (#Some name #Nil type [meta-rec-cursor (#Record meta-rec-parts)] defs) + (^ (list& name [meta-rec-cursor (#Record meta-rec-parts)] type definitions)) + (#Some name #Nil type [meta-rec-cursor (#Record meta-rec-parts)] definitions) - (^ (list& [_ (#Form (list& name args))] type defs)) - (#Some name args type (` {}) defs) + (^ (list& [_ (#Form (list& name args))] type definitions)) + (#Some name args type (` {}) definitions) - (^ (list& name type defs)) - (#Some name #Nil type (` {}) defs) + (^ (list& name type definitions)) + (#Some name #Nil type (` {}) definitions) _ #None))] (case ?parts - (#Some [name args type meta defs]) + (#Some [name args type meta definitions]) (case (case name [_ (#Symbol ["" "_"])] (case type @@ -3754,7 +3754,7 @@ (~ (meta-code-merge (` {#.struct? true}) meta)) (~ type) - (struct (~+ defs))))))) + (struct (~+ definitions))))))) #None (fail "Cannot infer name, so struct must have a name other than \"_\"!")) @@ -4160,7 +4160,7 @@ imports)] (wrap (list/join imports')))) -(def: (exported-defs module state) +(def: (exported-definitions module state) (-> Text (Meta (List Text))) (let [modules (case state {#info info #source source #current-module _ #modules modules @@ -4170,7 +4170,7 @@ modules)] (case (get module modules) (#Some =module) - (let [to-alias (list/map (: (-> [Text Def] + (let [to-alias (list/map (: (-> [Text Definition] (List Text)) (function [[name [def-type def-meta def-value]]] (case (get-meta ["lux" "export?"] def-meta) @@ -4179,8 +4179,8 @@ _ (list)))) - (let [{#module-hash _ #module-aliases _ #defs defs #imports _ #tags tags #types types #module-annotations _ #module-state _} =module] - defs))] + (let [{#module-hash _ #module-aliases _ #definitions definitions #imports _ #tags tags #types types #module-annotations _ #module-state _} =module] + definitions))] (#Right state (list/join to-alias))) #None @@ -4248,8 +4248,8 @@ #None #None - (#Some {#defs defs #module-hash _ #module-aliases _ #imports _ #tags tags #types types #module-annotations _ #module-state _}) - (case (get v-name defs) + (#Some {#definitions definitions #module-hash _ #module-aliases _ #imports _ #tags tags #types types #module-annotations _ #module-state _}) + (case (get v-name definitions) #None #None @@ -4267,8 +4267,8 @@ #None (#Left (text/compose "Unknown definition: " (ident/encode name))) - (#Some {#defs defs #module-hash _ #module-aliases _ #imports _ #tags tags #types types #module-annotations _ #module-state _}) - (case (get v-name defs) + (#Some {#definitions definitions #module-hash _ #module-aliases _ #imports _ #tags tags #types types #module-annotations _ #module-state _}) + (case (get v-name definitions) #None (#Left (text/compose "Unknown definition: " (ident/encode name))) @@ -4612,7 +4612,7 @@ (-> Text Text (Meta Bool)) (do Monad<Meta> [module (find-module module-name) - #let [{#module-hash _ #module-aliases _ #defs _ #imports imports #tags _ #types _ #module-annotations _ #module-state _} module]] + #let [{#module-hash _ #module-aliases _ #definitions _ #imports imports #tags _ #types _ #module-annotations _ #module-state _} module]] (wrap (is-member? imports import-name)))) (def: (read-refer module-name options) @@ -4659,17 +4659,17 @@ referred-defs)))] defs' (case r-defs #All - (exported-defs module-name) + (exported-definitions module-name) (#Only +defs) (do Monad<Meta> - [*defs (exported-defs module-name) + [*defs (exported-definitions module-name) _ (test-referrals module-name *defs +defs)] (wrap +defs)) (#Exclude -defs) (do Monad<Meta> - [*defs (exported-defs module-name) + [*defs (exported-definitions module-name) _ (test-referrals module-name *defs -defs)] (wrap (filter (|>> (is-member? -defs) not) *defs))) @@ -5501,7 +5501,7 @@ )) (macro: #export (^~ tokens) - {#.doc (doc "Use global defs with simple values, such as text, int, frac and bool in place of literals in patterns." + {#.doc (doc "Use global definitions with simple values, such as text, int, frac and bool in place of literals in patterns." "The definitions must be properly-qualified (though you may use one of the short-cuts Lux provides)." (def: (empty?' node) (All [K V] (-> (Node K V) Bool)) |