From 744ee69630de59ca3ba660b0aab6361cd17ce1b4 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 30 Jun 2021 23:24:55 -0400 Subject: "signature:" -> "interface:" & "structure:" -> "implementation:" "signature" & "structure" feel like very ML-specific terminology and might not be easy on programmers unfamiliar with it.--- stdlib/source/lux.lux | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'stdlib/source/lux.lux') diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux index ff676e592..be6755ebe 100644 --- a/stdlib/source/lux.lux +++ b/stdlib/source/lux.lux @@ -1517,7 +1517,7 @@ (fail "Wrong syntax for $_")} tokens)) -## (signature: (Monad m) +## (interface: (Monad m) ## (: (All [a] (-> a (m a))) ## wrap) ## (: (All [a b] (-> (-> a (m b)) (m a) (m b))) @@ -3131,10 +3131,10 @@ #None (fail "Wrong syntax for macro:")))) -(macro: #export (signature: tokens) +(macro: #export (interface: tokens) {#.doc (text$ ($_ "lux text concat" "## Definition of signatures ala ML." ..\n - "(signature: #export (Ord a)" ..\n + "(interface: #export (Ord a)" ..\n " (: (Equivalence a)" ..\n " eq)" ..\n " (: (-> a a Bit)" ..\n @@ -3195,7 +3195,7 @@ (return (list (` (..type: (~+ (export exported?)) (~ usage) (~ sig_meta) (~ sig_type)))))) #None - (fail "Wrong syntax for signature:")))) + (fail "Wrong syntax for interface:")))) (def: (find f xs) (All [a b] @@ -3483,8 +3483,8 @@ #None (#Left "Not expecting any type."))))) -(macro: #export (structure tokens) - {#.doc "Not meant to be used directly. Prefer 'structure:'."} +(macro: #export (implementation tokens) + {#.doc "Not meant to be used directly. Prefer 'implementation:'."} (do meta_monad [tokens' (monad\map meta_monad macro_expand tokens) struct_type get_expected_type @@ -3509,10 +3509,10 @@ (wrap [tag value]) _ - (fail (text\compose "Unknown structure member: " tag_name))) + (fail (text\compose "Unknown implementation member: " tag_name))) _ - (fail "Invalid structure member.")))) + (fail "Invalid implementation member.")))) (list\join tokens'))] (wrap (list (record$ members))))) @@ -3528,10 +3528,10 @@ head tail))) -(macro: #export (structure: tokens) +(macro: #export (implementation: tokens) {#.doc (text$ ($_ "lux text concat" "## Definition of structures ala ML." ..\n - "(structure: #export order (Order Int)" ..\n + "(implementation: #export order (Order Int)" ..\n " (def: &equivalence equivalence)" ..\n " (def: (< test subject)" ..\n " (< test subject))" ..\n @@ -3569,13 +3569,13 @@ _ (` ((~ name) (~+ args))))] (return (list (` (..def: (~+ (export exported?)) (~ usage) - (~ (meta_code_merge (` {#.struct? #1}) + (~ (meta_code_merge (` {#.implementation? #1}) meta)) (~ type) - (structure (~+ definitions))))))) + (implementation (~+ definitions))))))) #None - (fail "Wrong syntax for structure:")))) + (fail "Wrong syntax for implementation:")))) (def: (function\identity x) (All [a] (-> a a)) x) @@ -3751,7 +3751,7 @@ (return struct_name) _ - (fail "Expected all structures of opening form to be identifiers."))) + (fail "Expected all implementations of opening form to be identifiers."))) structs) next+remainder (parse_openings parts')] (let [[next remainder] next+remainder] @@ -4234,8 +4234,8 @@ [enhanced_target (monad\fold meta_monad (function (_ [m_local m_type] enhanced_target) (do meta_monad - [m_structure (resolve_type_tags m_type)] - (case m_structure + [m_implementation (resolve_type_tags m_type)] + (case m_implementation (#Some m_tags&members) (recur m_local m_tags&members @@ -4368,7 +4368,7 @@ (macro: #export (open: tokens) {#.doc (text$ ($_ "lux text concat" - "## Opens a structure and generates a definition for each of its members (including nested members)." + "## Opens a implementation and generates a definition for each of its members (including nested members)." __paragraph "## For example:" ..\n "(open: ''i:.'' number)" @@ -4587,7 +4587,7 @@ (macro: #export (\ tokens) {#.doc (text$ ($_ "lux text concat" - "## Allows accessing the value of a structure's member." ..\n + "## Allows accessing the value of a implementation's member." ..\n "(\ codec encode)" __paragraph "## Also allows using that value as a function." ..\n @@ -5171,7 +5171,7 @@ {#.doc (doc "Controlled macro-expansion." "Bind an arbitraty number of Code nodes resulting from macro-expansion to local bindings." "Wherever a binding appears, the bound Code nodes will be spliced in there." - (test: "Code operations & structures" + (test: "Code operations & implementations" (with_expansions [ (template [ ] [(compare (\ Code/encode encode ))] -- cgit v1.2.3