diff options
author | Eduardo Julian | 2021-09-14 02:56:22 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-09-14 02:56:22 -0400 |
commit | 971767f1eafb22208912353d8709f11081f2d3c8 (patch) | |
tree | 9b043f1238af49a33c1a625d737c9f0e1abb6e99 | |
parent | 1c93f003f73116202b1f964b0d1b6d3f07b69fb0 (diff) |
Re-named "Identifier" to "Symbol".
144 files changed, 1146 insertions, 1161 deletions
diff --git a/lux-js/source/program.lux b/lux-js/source/program.lux index c9eb90f54..3f9fa6997 100644 --- a/lux-js/source/program.lux +++ b/lux-js/source/program.lux @@ -138,7 +138,7 @@ [(ffi.interface: <name> (getValue [] java/lang/Object)) - (`` (import: (~~ (template.identifier ["program/" <name>])) + (`` (import: (~~ (template.symbol ["program/" <name>])) ["[1]::[0]" (getValue [] java/lang/Object)]))] diff --git a/lux-jvm/source/luxc/lang/host/jvm.lux b/lux-jvm/source/luxc/lang/host/jvm.lux index dc4a3b351..321316261 100644 --- a/lux-jvm/source/luxc/lang/host/jvm.lux +++ b/lux-jvm/source/luxc/lang/host/jvm.lux @@ -92,20 +92,20 @@ (type: .public (Generator i) (-> Phase Archive i (Operation Inst))) -(syntax: (config: [type <code>.local_identifier - none <code>.local_identifier - ++ <code>.local_identifier - options (<code>.tuple (<>.many <code>.local_identifier))]) - (let [g!type (code.local_identifier type) - g!none (code.local_identifier none) - g!tags+ (list#each (|>> (format "#") code.local_identifier) options) - g!_left (code.local_identifier "_left") - g!_right (code.local_identifier "_right") +(syntax: (config: [type <code>.local_symbol + none <code>.local_symbol + ++ <code>.local_symbol + options (<code>.tuple (<>.many <code>.local_symbol))]) + (let [g!type (code.local_symbol type) + g!none (code.local_symbol none) + g!tags+ (list#each (|>> (format "#") code.local_symbol) options) + g!_left (code.local_symbol "_left") + g!_right (code.local_symbol "_right") g!options+ (list#each (function (_ option) - (` (def: .public (~ (code.local_identifier option)) + (` (def: .public (~ (code.local_symbol option)) (~ g!type) (|> (~ g!none) - (with@ (~ (code.local_identifier (format "#" option))) #1))))) + (with@ (~ (code.local_symbol (format "#" option))) #1))))) options)] (in (list& (` (type: .public (~ g!type) (.Record @@ -123,7 +123,7 @@ list#conjoint code.tuple)))) - (` (def: .public ((~ (code.local_identifier ++)) (~ g!_left) (~ g!_right)) + (` (def: .public ((~ (code.local_symbol ++)) (~ g!_left) (~ g!_right)) (-> (~ g!type) (~ g!type) (~ g!type)) (~ (|> g!tags+ (list#each (function (_ tag) diff --git a/lux-jvm/source/luxc/lang/host/jvm/inst.lux b/lux-jvm/source/luxc/lang/host/jvm/inst.lux index 1ac0a61cc..fbb6da059 100644 --- a/lux-jvm/source/luxc/lang/host/jvm/inst.lux +++ b/lux-jvm/source/luxc/lang/host/jvm/inst.lux @@ -44,9 +44,9 @@ (import: java/lang/Object) (import: java/lang/String) -(syntax: (declare [codes (p.many s.local_identifier)]) +(syntax: (declare [codes (p.many s.local_symbol)]) (|> codes - (list@each (function (_ code) (` ((~' "static") (~ (code.local_identifier code)) (~' int))))) + (list@each (function (_ code) (` ((~' "static") (~ (code.local_symbol code)) (~' int))))) in)) (`` (import: org/objectweb/asm/Opcodes @@ -174,7 +174,7 @@ ) (template: (!prefix short) - [(`` ((~~ (template.identifier ["org/objectweb/asm/Opcodes::" short]))))]) + [(`` ((~~ (template.symbol ["org/objectweb/asm/Opcodes::" short]))))]) (template [<constant>] [(def: .public <constant> diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux index 8eb51c777..eec9f187d 100644 --- a/lux-lua/source/program.lux +++ b/lux-lua/source/program.lux @@ -158,7 +158,7 @@ [(ffi.interface: <name> (getValue [] java/lang/Object)) - (`` (ffi.import: (~~ (template.identifier ["program/" <name>])) + (`` (ffi.import: (~~ (template.symbol ["program/" <name>])) ["[1]::[0]" (getValue [] java/lang/Object)]))] diff --git a/lux-php/source/program.lux b/lux-php/source/program.lux index 7aa88558d..11bf0d113 100644 --- a/lux-php/source/program.lux +++ b/lux-php/source/program.lux @@ -165,7 +165,7 @@ [(ffi.interface: <name> (getValue [] java/lang/Object)) - (`` (ffi.import: (~~ (template.identifier ["program/" <name>])) + (`` (ffi.import: (~~ (template.symbol ["program/" <name>])) ["[1]::[0]" (getValue [] java/lang/Object)]))] diff --git a/lux-ruby/source/program.lux b/lux-ruby/source/program.lux index 59a840169..2b9831d04 100644 --- a/lux-ruby/source/program.lux +++ b/lux-ruby/source/program.lux @@ -136,7 +136,7 @@ (monad.each meta.monad (function (_ class) (do meta.monad - [var (macro.identifier "input")] + [var (macro.symbol "input")] (in (code.record (list [var class]))))) input_classes)) diff --git a/lux-scheme/source/program.lux b/lux-scheme/source/program.lux index 2073e1d90..0b1f97740 100644 --- a/lux-scheme/source/program.lux +++ b/lux-scheme/source/program.lux @@ -157,7 +157,7 @@ [(ffi.interface: <name> (getValue [] java/lang/Object)) - (`` (ffi.import: (~~ (template.identifier ["program/" <name>])) + (`` (ffi.import: (~~ (template.symbol ["program/" <name>])) ["[1]::[0]" (getValue [] java/lang/Object)]))] diff --git a/stdlib/source/documentation/lux.lux b/stdlib/source/documentation/lux.lux index 3bb2eed7d..71fc37125 100644 --- a/stdlib/source/documentation/lux.lux +++ b/stdlib/source/documentation/lux.lux @@ -438,7 +438,7 @@ (^template [<tag>] [(^ (list [_ {<tag> [module name]}])) (in (list (` [(~ (text$ module)) (~ (text$ name))])))]) - ([#Identifier] [#Tag]) + ([#Symbol]) _ (failure "Wrong syntax for symbol")))]) @@ -707,13 +707,13 @@ (compare <text> (# codec encoded <function> <parameter>)))] - [bit #1 "#1"] - [int +123 "+123"] - [frac +123.0 "+123.0"] - [text "123" "'123'"] - [identifier ["yolo" "lol"] "yolo.lol"] - [form (list (bit #1)) "(#1)"] - [tuple (list (bit #1)) "[#1]"] + [bit #1 "#1"] + [int +123 "+123"] + [frac +123.0 "+123.0"] + [text "123" "'123'"] + [symbol ["yolo" "lol"] "yolo.lol"] + [form (list (bit #1)) "(#1)"] + [tuple (list (bit #1)) "[#1]"] )] ($_ and <tests> @@ -763,7 +763,7 @@ {#Left (format "Static part " (%t static) " does not match URI: " uri)})]) (documentation: /.symbol - "Given an identifier or a tag, gives back a 2 tuple with the module and name parts, both as Text." + "Gives back a 2 tuple with the module and name parts, both as Text." [(symbol ..#doc) "=>" ["documentation/lux" "#doc"]]) diff --git a/stdlib/source/documentation/lux/control/concatenative.lux b/stdlib/source/documentation/lux/control/concatenative.lux index 0fd92c9b5..fc76c2a7d 100644 --- a/stdlib/source/documentation/lux/control/concatenative.lux +++ b/stdlib/source/documentation/lux/control/concatenative.lux @@ -52,7 +52,7 @@ ((apply 1) ++))]) (template [<arity>] - [(with_expansions [<name> (template.identifier [/._] ["apply/" <arity>]) + [(with_expansions [<name> (template.symbol [/._] ["apply/" <arity>]) <doc> (template.text ["Lift a function of arity " <arity> " into a concatenative function of arity " <arity> "."])] (documentation: <name> @@ -93,7 +93,7 @@ "Right-injects the top into sum.") (template [<input> <word> <func>] - [(`` (documentation: (~~ (template.identifier [/._] [<word>])) + [(`` (documentation: (~~ (template.symbol [/._] [<word>])) (~~ (template.text [<func> " for " <input> " arithmetic."]))))] [Nat n/+ n.+] diff --git a/stdlib/source/documentation/lux/control/parser/code.lux b/stdlib/source/documentation/lux/control/parser/code.lux index f9177abad..9663b10b8 100644 --- a/stdlib/source/documentation/lux/control/parser/code.lux +++ b/stdlib/source/documentation/lux/control/parser/code.lux @@ -22,14 +22,13 @@ (`` (documentation: <check> (format "Checks for a specific " (~~ (template.text [<query>])) " input.")))] - [/.bit /.bit!] - [/.nat /.nat!] - [/.int /.int!] - [/.rev /.rev!] - [/.frac /.frac!] - [/.text /.text!] - [/.identifier /.identifier!] - [/.tag /.tag!] + [/.bit /.bit!] + [/.nat /.nat!] + [/.int /.int!] + [/.rev /.rev!] + [/.frac /.frac!] + [/.text /.text!] + [/.symbol /.symbol!] ) (documentation: /.this! @@ -42,8 +41,7 @@ (documentation: <check> (format "Checks for a specific local " <desc> " (a " <desc> " that has no module prefix)."))] - [/.local_identifier /.local_identifier! "local identifier"] - [ /.local_tag /.local_tag! "local tag"] + [/.local_symbol /.local_symbol! "local symbol"] ) (template [<name>] @@ -97,17 +95,13 @@ ..frac! ..text ..text! - ..identifier - ..identifier! - ..tag - ..tag! + ..symbol + ..symbol! ..this! - ..local_identifier - ..local_identifier! - ..local_tag - ..local_tag! + ..local_symbol + ..local_symbol! ..form ..tuple diff --git a/stdlib/source/documentation/lux/data/color.lux b/stdlib/source/documentation/lux/data/color.lux index d0ee1440b..37b10911f 100644 --- a/stdlib/source/documentation/lux/data/color.lux +++ b/stdlib/source/documentation/lux/data/color.lux @@ -40,7 +40,7 @@ "" [(interpolated ratio end start)]) -(syntax: (palette_documentation [[_ name] <code>.identifier]) +(syntax: (palette_documentation [[_ name] <code>.symbol]) (in (list (code.text (format "A " (text.replaced "_" "-" name) " palette."))))) (documentation: /.analogous diff --git a/stdlib/source/documentation/lux/documentation.lux b/stdlib/source/documentation/lux/documentation.lux index ed64efe96..7ab64966f 100644 --- a/stdlib/source/documentation/lux/documentation.lux +++ b/stdlib/source/documentation/lux/documentation.lux @@ -29,7 +29,7 @@ [..default ..documentation: ..module - (/.default /.unqualified_identifier) + (/.default /.unqualified_symbol) (/.default /.Definition) (/.default /.Module) (/.default /.documentation)] @@ -42,7 +42,7 @@ [..default ..documentation: ..module - (/.default /.unqualified_identifier) + (/.default /.unqualified_symbol) (/.default /.Definition) (/.default /.Module) (/.default /.documentation)] diff --git a/stdlib/source/documentation/lux/macro.lux b/stdlib/source/documentation/lux/macro.lux index 660ad8e1c..bd7324743 100644 --- a/stdlib/source/documentation/lux/macro.lux +++ b/stdlib/source/documentation/lux/macro.lux @@ -29,19 +29,19 @@ "Expands all macro-calls everywhere recursively, until only primitive/base code remains." [(full_expansion syntax)]) -(documentation: /.identifier +(documentation: /.symbol (format "Generates a unique name as an Code node (ready to be used in code templates)." \n "A prefix can be given (or just be empty text) to better identify the code for debugging purposes.") - [(identifier prefix)]) + [(symbol prefix)]) (documentation: /.wrong_syntax_error "A generic error message for macro syntax failures.") -(documentation: /.with_identifiers - "Creates new identifiers and offers them to the body expression." +(documentation: /.with_symbols + "Creates new symbols and offers them to the body expression." [(syntax: (synchronized [lock any body any]) - (with_identifiers [g!lock g!body g!_] + (with_symbols [g!lock g!body g!_] (in (list (` (let [(~ g!lock) (~ lock) (~ g!_) ("jvm monitorenter" (~ g!lock)) (~ g!body) (~ body) @@ -98,9 +98,9 @@ [..single_expansion ..expansion ..full_expansion - ..identifier + ..symbol ..wrong_syntax_error - ..with_identifiers + ..with_symbols ..one_expansion ..log_single_expansion! ..log_expansion! diff --git a/stdlib/source/documentation/lux/macro/code.lux b/stdlib/source/documentation/lux/macro/code.lux index 3c1f4c999..85b2de284 100644 --- a/stdlib/source/documentation/lux/macro/code.lux +++ b/stdlib/source/documentation/lux/macro/code.lux @@ -10,11 +10,8 @@ [\\library ["[0]" /]]) -(documentation: /.local_identifier - "Produces a local identifier (an identifier with no module prefix).") - -(documentation: /.local_tag - "Produces a local tag (a tag with no module prefix).") +(documentation: /.local_symbol + "Produces a local symbol (an symbol with no module prefix).") (documentation: /.replaced "" @@ -24,8 +21,7 @@ (.List $.Module) ($.module /._ "" - [..local_identifier - ..local_tag + [..local_symbol ..replaced ($.default /.bit) ($.default /.nat) @@ -33,8 +29,7 @@ ($.default /.rev) ($.default /.frac) ($.default /.text) - ($.default /.identifier) - ($.default /.tag) + ($.default /.symbol) ($.default /.form) ($.default /.tuple) ($.default /.record) diff --git a/stdlib/source/documentation/lux/macro/template.lux b/stdlib/source/documentation/lux/macro/template.lux index 557446ad0..901497f21 100644 --- a/stdlib/source/documentation/lux/macro/template.lux +++ b/stdlib/source/documentation/lux/macro/template.lux @@ -39,13 +39,13 @@ "=>" "#0123+456+789.0abcdefghi"]) -(documentation: /.identifier - (format "An identifier made by concatenating pieces of code." +(documentation: /.symbol + (format "An symbol made by concatenating pieces of code." \n "The (optional) module part and the short part are specified independently.") - [(identifier ["abc" .def ..ghi]) + [(symbol ["abc" .def ..ghi]) "=>" abcdefghi] - [(identifier [.def] ["abc" .def ..ghi]) + [(symbol [.def] ["abc" .def ..ghi]) "=>" .abcdefghi]) @@ -65,7 +65,7 @@ ..amount ..with_locals ..text - ..identifier + ..symbol ..let ($.default /.irregular_arguments)] [])) diff --git a/stdlib/source/documentation/lux/tool/compiler/language/lux/generation.lux b/stdlib/source/documentation/lux/tool/compiler/language/lux/generation.lux index a44ba5e66..3d604b7dc 100644 --- a/stdlib/source/documentation/lux/tool/compiler/language/lux/generation.lux +++ b/stdlib/source/documentation/lux/tool/compiler/language/lux/generation.lux @@ -40,7 +40,7 @@ ($.default /.get_registry) ($.default /.set_registry) ($.default /.next) - ($.default /.identifier) + ($.default /.symbol) ($.default /.enter_module) ($.default /.module) ($.default /.evaluate!) diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index 862c84fff..c5d4a40f6 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -224,7 +224,7 @@ ... {#Rev Rev} ... {#Frac Frac} ... {#Text Text} -... {#Identifier Symbol} +... {#Symbol Symbol} ... {#Form (List (w (Code' w)))} ... {#Variant (List (w (Code' w)))} ... {#Tuple (List (w (Code' w)))}) @@ -252,7 +252,7 @@ ... Text Text {#Sum - ... Identifier + ... Symbol Symbol {#Sum ... Form @@ -268,7 +268,7 @@ ("lux type check type" {#Apply {#Apply {#Parameter 1} {#Parameter 0}} {#Parameter 1}}))} - {"#Bit" "#Nat" "#Int" "#Rev" "#Frac" "#Text" "#Identifier" "#Form" "#Variant" "#Tuple"} + {"#Bit" "#Nat" "#Int" "#Rev" "#Frac" "#Text" "#Symbol" "#Form" "#Variant" "#Tuple"} #1) ... (type: .public Code @@ -335,14 +335,14 @@ ([_ text] (_ann {#Text text}))) #0) -("lux def" identifier$ +("lux def" symbol$ ("lux type check" {#Function Symbol Code} - ([_ name] (_ann {#Identifier name}))) + ([_ name] (_ann {#Symbol name}))) #0) -("lux def" local_identifier$ +("lux def" local_symbol$ ("lux type check" {#Function Text Code} - ([_ name] (_ann {#Identifier ["" name]}))) + ([_ name] (_ann {#Symbol ["" name]}))) #0) ("lux def" form$ @@ -710,27 +710,27 @@ ("lux macro" ([_ tokens] ({{#Item [_ {#Tuple {#Item arg args'}}] {#Item body {#End}}} - (in_meta {#Item (_ann {#Form {#Item (_ann {#Tuple {#Item (_ann {#Identifier ["" ""]}) + (in_meta {#Item (_ann {#Form {#Item (_ann {#Tuple {#Item (_ann {#Symbol ["" ""]}) {#Item arg {#End}}}}) {#Item ({{#End} body _ - (_ann {#Form {#Item (_ann {#Identifier [..prelude_module "function''"]}) + (_ann {#Form {#Item (_ann {#Symbol [..prelude_module "function''"]}) {#Item (_ann {#Tuple args'}) {#Item body {#End}}}}})} args') {#End}}}}) {#End}}) - {#Item [_ {#Identifier ["" self]}] {#Item [_ {#Tuple {#Item arg args'}}] {#Item body {#End}}}} - (in_meta {#Item (_ann {#Form {#Item (_ann {#Tuple {#Item (_ann {#Identifier ["" self]}) + {#Item [_ {#Symbol ["" self]}] {#Item [_ {#Tuple {#Item arg args'}}] {#Item body {#End}}}} + (in_meta {#Item (_ann {#Form {#Item (_ann {#Tuple {#Item (_ann {#Symbol ["" self]}) {#Item arg {#End}}}}) {#Item ({{#End} body _ - (_ann {#Form {#Item (_ann {#Identifier [..prelude_module "function''"]}) + (_ann {#Form {#Item (_ann {#Symbol [..prelude_module "function''"]}) {#Item (_ann {#Tuple args'}) {#Item body {#End}}}}})} args') @@ -757,7 +757,7 @@ ("lux def" as_function ("lux type check" {#Function Code {#Function {#Apply Code List} {#Function Code Code}}} (function'' [self inputs output] - (form$ {#Item (identifier$ [..prelude_module "function''"]) + (form$ {#Item (symbol$ [..prelude_module "function''"]) {#Item self {#Item (tuple$ inputs) {#Item output {#End}}}}}))) @@ -813,8 +813,8 @@ (in_meta tokens) {#Item x {#Item y xs}} - (in_meta {#Item (form$ {#Item (identifier$ [..prelude_module "$'"]) - {#Item (variant$ {#Item (identifier$ [..prelude_module "#Apply"]) + (in_meta {#Item (form$ {#Item (symbol$ [..prelude_module "$'"]) + {#Item (variant$ {#Item (symbol$ [..prelude_module "#Apply"]) {#Item y {#Item x {#End}}}}) xs}}) {#End}}) @@ -869,7 +869,7 @@ (def:'' .private (with_replacements reps syntax) {#Function Replacement_Environment {#Function Code Code}} - ({[_ {#Identifier "" name}] + ({[_ {#Symbol "" name}] ({{#Some replacement} replacement @@ -924,22 +924,22 @@ (def:'' .private |#End| Code - (variant$ {#Item (identifier$ [..prelude_module "#End"]) {#End}})) + (variant$ {#Item (symbol$ [..prelude_module "#End"]) {#End}})) (def:'' .private (|#Item| head tail) {#Function Code {#Function Code Code}} - (variant$ {#Item (identifier$ [..prelude_module "#Item"]) + (variant$ {#Item (symbol$ [..prelude_module "#Item"]) {#Item head {#Item tail {#End}}}})) (def:'' .private (UnivQ$ body) {#Function Code Code} - (variant$ {#Item (identifier$ [..prelude_module "#UnivQ"]) {#Item ..|#End| {#Item body {#End}}}})) + (variant$ {#Item (symbol$ [..prelude_module "#UnivQ"]) {#Item ..|#End| {#Item body {#End}}}})) (def:'' .private (ExQ$ body) {#Function Code Code} - (variant$ {#Item (identifier$ [..prelude_module "#ExQ"]) {#Item ..|#End| {#Item body {#End}}}})) + (variant$ {#Item (symbol$ [..prelude_module "#ExQ"]) {#Item ..|#End| {#Item body {#End}}}})) (def:'' .private quantification_level Text @@ -949,13 +949,13 @@ (def:'' .private quantified {#Function Code Code} - (let$ (local_identifier$ ..quantification_level) (nat$ 0))) + (let$ (local_symbol$ ..quantification_level) (nat$ 0))) (def:'' .private (quantified_type_parameter idx) {#Function Nat Code} - (variant$ {#Item (identifier$ [..prelude_module "#Parameter"]) + (variant$ {#Item (symbol$ [..prelude_module "#Parameter"]) {#Item (form$ {#Item (text$ "lux i64 +") - {#Item (local_identifier$ ..quantification_level) + {#Item (local_symbol$ ..quantification_level) {#Item (nat$ idx) {#End}}}}) {#End}}})) @@ -1024,8 +1024,8 @@ (def:'' .private (with_correct_quantification body) {#Function Code Code} - (form$ {#Item (identifier$ [prelude_module "__adjusted_quantified_type__"]) - {#Item (local_identifier$ ..quantification_level) + (form$ {#Item (symbol$ [prelude_module "__adjusted_quantified_type__"]) + {#Item (local_symbol$ ..quantification_level) {#Item (nat$ 0) {#Item body {#End}}}}})) @@ -1042,7 +1042,7 @@ depth)))) {#End}}}}) body)} - (local_identifier$ ..quantification_level))) + (local_symbol$ ..quantification_level))) (def:'' .private (initialized_quantification? lux) {#Function Lux Bit} @@ -1144,7 +1144,7 @@ (macro:' .public (-> tokens) ({{#Item output inputs} (in_meta {#Item (list#mix ("lux type check" {#Function Code {#Function Code Code}} - (function'' [i o] (variant$ {#Item (identifier$ [..prelude_module "#Function"]) {#Item i {#Item o {#End}}}}))) + (function'' [i o] (variant$ {#Item (symbol$ [..prelude_module "#Function"]) {#Item i {#Item o {#End}}}}))) output inputs) {#End}}) @@ -1167,26 +1167,26 @@ (macro:' .public (Union tokens) ({{#End} - (in_meta (list (identifier$ [..prelude_module "Nothing"]))) + (in_meta (list (symbol$ [..prelude_module "Nothing"]))) {#Item last prevs} - (in_meta (list (list#mix (function'' [left right] (variant$ (list (identifier$ [..prelude_module "#Sum"]) left right))) + (in_meta (list (list#mix (function'' [left right] (variant$ (list (symbol$ [..prelude_module "#Sum"]) left right))) last prevs)))} (list#reversed tokens))) (macro:' .public (Tuple tokens) ({{#End} - (in_meta (list (identifier$ [..prelude_module "Any"]))) + (in_meta (list (symbol$ [..prelude_module "Any"]))) {#Item last prevs} - (in_meta (list (list#mix (function'' [left right] (variant$ (list (identifier$ [..prelude_module "#Product"]) left right))) + (in_meta (list (list#mix (function'' [left right] (variant$ (list (symbol$ [..prelude_module "#Product"]) left right))) last prevs)))} (list#reversed tokens))) (macro:' .private (function' tokens) - (let'' [name tokens'] ({{#Item [[_ {#Identifier ["" name]}] tokens']} + (let'' [name tokens'] ({{#Item [[_ {#Symbol ["" name]}] tokens']} [name tokens'] _ @@ -1197,10 +1197,10 @@ (failure "function' requires a non-empty arguments tuple.") {#Item [harg targs]} - (in_meta (list (form$ (list (tuple$ (list (local_identifier$ name) + (in_meta (list (form$ (list (tuple$ (list (local_symbol$ name) harg)) (list#mix (function'' [arg body'] - (form$ (list (tuple$ (list (local_identifier$ "") + (form$ (list (tuple$ (list (local_symbol$ "") arg)) body'))) body @@ -1219,7 +1219,7 @@ name (form$ (list (text$ "lux type check") type - (form$ (list (identifier$ [..prelude_module "function'"]) + (form$ (list (symbol$ [..prelude_module "function'"]) name (tuple$ args) body)))) @@ -1393,15 +1393,15 @@ (macro:' .private (do tokens) ({{#Item monad {#Item [_ {#Tuple bindings}] {#Item body {#End}}}} - (let' [g!in (local_identifier$ "in") - g!then (local_identifier$ " then ") + (let' [g!in (local_symbol$ "in") + g!then (local_symbol$ " then ") body' (list#mix ("lux type check" (-> (Tuple Code Code) Code Code) (function' [binding body'] (let' [[var value] binding] - ({[_ {#Identifier [module short]}] + ({[_ {#Symbol [module short]}] ({"" (form$ (list g!then - (form$ (list (tuple$ (list (local_identifier$ "") var)) body')) + (form$ (list (tuple$ (list (local_symbol$ "") var)) body')) value)) _ @@ -1411,13 +1411,13 @@ _ (form$ (list g!then - (form$ (list (tuple$ (list (local_identifier$ "") var)) body')) + (form$ (list (tuple$ (list (local_symbol$ "") var)) body')) value))} var)))) body (list#reversed (pairs bindings)))] - (in_meta (list (form$ (list (variant$ (list (tuple$ (list (identifier$ [..prelude_module "#in"]) g!in - (identifier$ [..prelude_module "#then"]) g!then)) + (in_meta (list (form$ (list (variant$ (list (tuple$ (list (symbol$ [..prelude_module "#in"]) g!in + (symbol$ [..prelude_module "#then"]) g!then)) body')) monad))))) @@ -1496,7 +1496,7 @@ _ ($_ text#composite module "." name)} module))) -(def:''' .private (global_identifier full_name state) +(def:''' .private (global_symbol full_name state) (-> Symbol ($' Meta Symbol)) (let' [[module name] full_name [#info info #source source #current_module _ #modules modules @@ -1524,9 +1524,9 @@ (def:''' .private (:List<Code> expression) (-> Code Code) - (let' [type (variant$ (list (identifier$ [..prelude_module "#Apply"]) - (identifier$ [..prelude_module "Code"]) - (identifier$ [..prelude_module "List"])))] + (let' [type (variant$ (list (symbol$ [..prelude_module "#Apply"]) + (symbol$ [..prelude_module "Code"]) + (symbol$ [..prelude_module "List"])))] (form$ (list (text$ "lux type check") type expression)))) (def:''' .private (spliced replace? untemplated elems) @@ -1537,7 +1537,7 @@ {#Item lastI inits} (do meta_monad - [lastO ({[_ {#Form {#Item [[_ {#Identifier ["" "~+"]}] {#Item [spliced {#End}]}]}}] + [lastO ({[_ {#Form {#Item [[_ {#Symbol ["" "~+"]}] {#Item [spliced {#End}]}]}}] (in (:List<Code> spliced)) _ @@ -1547,10 +1547,10 @@ lastI)] (monad#mix meta_monad (function' [leftI rightO] - ({[_ {#Form {#Item [[_ {#Identifier ["" "~+"]}] {#Item [spliced {#End}]}]}}] + ({[_ {#Form {#Item [[_ {#Symbol ["" "~+"]}] {#Item [spliced {#End}]}]}}] (let' [g!in-module (form$ (list (text$ "lux in-module") (text$ ..prelude_module) - (identifier$ [..prelude_module "list#composite"])))] + (symbol$ [..prelude_module "list#composite"])))] (in (form$ (list g!in-module (:List<Code> spliced) rightO)))) _ @@ -1569,85 +1569,85 @@ (def:''' .private (untemplated_text value) (-> Text Code) - (with_location (variant$ (list (identifier$ [..prelude_module "#Text"]) (text$ value))))) + (with_location (variant$ (list (symbol$ [..prelude_module "#Text"]) (text$ value))))) (def:''' .private (untemplated replace? subst token) (-> Bit Text Code ($' Meta Code)) ({[_ [_ {#Bit value}]] - (in_meta (with_location (variant$ (list (identifier$ [..prelude_module "#Bit"]) (bit$ value))))) + (in_meta (with_location (variant$ (list (symbol$ [..prelude_module "#Bit"]) (bit$ value))))) [_ [_ {#Nat value}]] - (in_meta (with_location (variant$ (list (identifier$ [..prelude_module "#Nat"]) (nat$ value))))) + (in_meta (with_location (variant$ (list (symbol$ [..prelude_module "#Nat"]) (nat$ value))))) [_ [_ {#Int value}]] - (in_meta (with_location (variant$ (list (identifier$ [..prelude_module "#Int"]) (int$ value))))) + (in_meta (with_location (variant$ (list (symbol$ [..prelude_module "#Int"]) (int$ value))))) [_ [_ {#Rev value}]] - (in_meta (with_location (variant$ (list (identifier$ [..prelude_module "#Rev"]) (rev$ value))))) + (in_meta (with_location (variant$ (list (symbol$ [..prelude_module "#Rev"]) (rev$ value))))) [_ [_ {#Frac value}]] - (in_meta (with_location (variant$ (list (identifier$ [..prelude_module "#Frac"]) (frac$ value))))) + (in_meta (with_location (variant$ (list (symbol$ [..prelude_module "#Frac"]) (frac$ value))))) [_ [_ {#Text value}]] (in_meta (untemplated_text value)) - [#1 [_ {#Identifier [module name]}]] + [#1 [_ {#Symbol [module name]}]] (do meta_monad [real_name ({"" (if (text#= "" subst) (in [module name]) - (global_identifier [subst name])) + (global_symbol [subst name])) _ (in [module name])} module) .let' [[module name] real_name]] - (in_meta (with_location (variant$ (list (identifier$ [..prelude_module "#Identifier"]) (tuple$ (list (text$ module) (text$ name)))))))) + (in_meta (with_location (variant$ (list (symbol$ [..prelude_module "#Symbol"]) (tuple$ (list (text$ module) (text$ name)))))))) - [#0 [_ {#Identifier [module name]}]] - (in_meta (with_location (variant$ (list (identifier$ [..prelude_module "#Identifier"]) (tuple$ (list (text$ module) (text$ name))))))) + [#0 [_ {#Symbol [module name]}]] + (in_meta (with_location (variant$ (list (symbol$ [..prelude_module "#Symbol"]) (tuple$ (list (text$ module) (text$ name))))))) - [#1 [_ {#Form {#Item [[_ {#Identifier ["" "~"]}] {#Item [unquoted {#End}]}]}}]] + [#1 [_ {#Form {#Item [[_ {#Symbol ["" "~"]}] {#Item [unquoted {#End}]}]}}]] (in_meta (form$ (list (text$ "lux type check") - (identifier$ [..prelude_module "Code"]) + (symbol$ [..prelude_module "Code"]) unquoted))) - [#1 [_ {#Form {#Item [[_ {#Identifier ["" "~!"]}] {#Item [dependent {#End}]}]}}]] + [#1 [_ {#Form {#Item [[_ {#Symbol ["" "~!"]}] {#Item [dependent {#End}]}]}}]] (do meta_monad [independent (untemplated replace? subst dependent)] - (in (with_location (variant$ (list (identifier$ [..prelude_module "#Form"]) + (in (with_location (variant$ (list (symbol$ [..prelude_module "#Form"]) (untemplated_list (list (untemplated_text "lux in-module") (untemplated_text subst) independent))))))) - [#1 [_ {#Form {#Item [[_ {#Identifier ["" "~'"]}] {#Item [keep_quoted {#End}]}]}}]] + [#1 [_ {#Form {#Item [[_ {#Symbol ["" "~'"]}] {#Item [keep_quoted {#End}]}]}}]] (untemplated #0 subst keep_quoted) [_ [meta {#Form elems}]] (do meta_monad [output (spliced replace? (untemplated replace? subst) elems) - .let' [[_ output'] (with_location (variant$ (list (identifier$ [..prelude_module "#Form"]) output)))]] + .let' [[_ output'] (with_location (variant$ (list (symbol$ [..prelude_module "#Form"]) output)))]] (in [meta output'])) [_ [meta {#Variant elems}]] (do meta_monad [output (spliced replace? (untemplated replace? subst) elems) - .let' [[_ output'] (with_location (variant$ (list (identifier$ [..prelude_module "#Variant"]) output)))]] + .let' [[_ output'] (with_location (variant$ (list (symbol$ [..prelude_module "#Variant"]) output)))]] (in [meta output'])) [_ [meta {#Tuple elems}]] (do meta_monad [output (spliced replace? (untemplated replace? subst) elems) - .let' [[_ output'] (with_location (variant$ (list (identifier$ [..prelude_module "#Tuple"]) output)))]] + .let' [[_ output'] (with_location (variant$ (list (symbol$ [..prelude_module "#Tuple"]) output)))]] (in [meta output']))} [replace? token])) (macro:' .public (Primitive tokens) ({{#Item [_ {#Text class_name}] {#End}} - (in_meta (list (variant$ (list (identifier$ [..prelude_module "#Primitive"]) (text$ class_name) |#End|)))) + (in_meta (list (variant$ (list (symbol$ [..prelude_module "#Primitive"]) (text$ class_name) |#End|)))) {#Item [_ {#Text class_name}] {#Item [_ {#Tuple params}] {#End}}} - (in_meta (list (variant$ (list (identifier$ [..prelude_module "#Primitive"]) (text$ class_name) (untemplated_list params))))) + (in_meta (list (variant$ (list (symbol$ [..prelude_module "#Primitive"]) (text$ class_name) (untemplated_list params))))) _ (failure "Wrong syntax for Primitive")} @@ -1673,7 +1673,7 @@ [current_module current_module_name =template (untemplated #1 current_module template)] (in (list (form$ (list (text$ "lux type check") - (identifier$ [..prelude_module "Code"]) + (symbol$ [..prelude_module "Code"]) =template))))) _ @@ -1684,7 +1684,7 @@ ({{#Item template {#End}} (do meta_monad [=template (untemplated #1 "" template)] - (in (list (form$ (list (text$ "lux type check") (identifier$ [..prelude_module "Code"]) =template))))) + (in (list (form$ (list (text$ "lux type check") (symbol$ [..prelude_module "Code"]) =template))))) _ (failure "Wrong syntax for `")} @@ -1694,7 +1694,7 @@ ({{#Item template {#End}} (do meta_monad [=template (untemplated #0 "" template)] - (in (list (form$ (list (text$ "lux type check") (identifier$ [..prelude_module "Code"]) =template))))) + (in (list (form$ (list (text$ "lux type check") (symbol$ [..prelude_module "Code"]) =template))))) _ (failure "Wrong syntax for '")} @@ -1751,18 +1751,18 @@ (-> (-> b c) (-> a b) (-> a c))) (function' [x] (f (g x)))) -(def:''' .private (identifier_name x) +(def:''' .private (symbol_name x) (-> Code ($' Maybe Symbol)) - ({[_ {#Identifier sname}] + ({[_ {#Symbol sname}] {#Some sname} _ {#None}} x)) -(def:''' .private (identifier_short x) +(def:''' .private (symbol_short x) (-> Code ($' Maybe Text)) - ({[_ {#Identifier "" sname}] + ({[_ {#Symbol "" sname}] {#Some sname} _ @@ -1780,7 +1780,7 @@ (def:''' .private (realized_template env template) (-> Replacement_Environment Code Code) - ({[_ {#Identifier "" sname}] + ({[_ {#Symbol "" sname}] ({{#Some subst} subst @@ -1851,7 +1851,7 @@ _ (failure "Wrong syntax for template")} - [(monad#each maybe_monad identifier_short bindings) + [(monad#each maybe_monad symbol_short bindings) (monad#each maybe_monad tuple_list data)]) _ @@ -2041,7 +2041,7 @@ (def:''' .private (single_expansion token) (-> Code ($' Meta ($' List Code))) - ({[_ {#Form {#Item [_ {#Identifier name}] args}}] + ({[_ {#Form {#Item [_ {#Symbol name}] args}}] (do meta_monad [name' (normal name) ?macro (macro' name')] @@ -2058,7 +2058,7 @@ (def:''' .private (expansion token) (-> Code ($' Meta ($' List Code))) - ({[_ {#Form {#Item [_ {#Identifier name}] args}}] + ({[_ {#Form {#Item [_ {#Symbol name}] args}}] (do meta_monad [name' (normal name) ?macro (macro' name')] @@ -2078,7 +2078,7 @@ (def:''' .private (full_expansion syntax) (-> Code ($' Meta ($' List Code))) - ({[_ {#Form {#Item [_ {#Identifier name}] args}}] + ({[_ {#Form {#Item [_ {#Symbol name}] args}}] (do meta_monad [name' (normal name) ?macro (macro' name')] @@ -2091,7 +2091,7 @@ {#None} (do meta_monad [args' (monad#each meta_monad full_expansion args)] - (in (list (form$ {#Item (identifier$ name) (list#conjoint args')}))))} + (in (list (form$ {#Item (symbol$ name) (list#conjoint args')}))))} ?macro)) [_ {#Form members}] @@ -2137,7 +2137,7 @@ [_ {#Text value}] (text#encoded value) - [_ {#Identifier [module name]}] + [_ {#Symbol [module name]}] (if (text#= "" module) name ($_ text#composite module "." name)) @@ -2166,8 +2166,8 @@ (def:''' .private (normal_type type) (-> Code Code) - ({[_ {#Variant {#Item [_ {#Identifier identifier}] parts}}] - (` {(~ (identifier$ identifier)) (~+ (list#each normal_type parts))}) + ({[_ {#Variant {#Item [_ {#Symbol symbol}] parts}}] + (` {(~ (symbol$ symbol)) (~+ (list#each normal_type parts))}) [_ {#Tuple members}] (` (Tuple (~+ (list#each normal_type members)))) @@ -2178,7 +2178,7 @@ {#End}}}}}] (` ("lux in-module" (~ (text$ module)) (~ (normal_type type')))) - [_ {#Form {#Item [_ {#Identifier ["" ":~"]}] {#Item expression {#End}}}}] + [_ {#Form {#Item [_ {#Symbol ["" ":~"]}] {#Item expression {#End}}}}] expression [_0 {#Form {#Item [_1 {#Variant {#Item binding {#Item body {#End}}}}] @@ -2188,12 +2188,12 @@ {#Item value {#End}}}}] - [_0 {#Form {#Item [_1 {#Identifier ["library/lux" "__adjusted_quantified_type__"]}] + [_0 {#Form {#Item [_1 {#Symbol ["library/lux" "__adjusted_quantified_type__"]}] {#Item _permission {#Item _level {#Item body {#End}}}}}}] - [_0 {#Form {#Item [_1 {#Identifier [..prelude_module "__adjusted_quantified_type__"]}] + [_0 {#Form {#Item [_1 {#Symbol [..prelude_module "__adjusted_quantified_type__"]}] {#Item _permission {#Item _level {#Item (normal_type body) @@ -2265,7 +2265,7 @@ [product#left a x] [product#right b y]) -(def:''' .private (identifier prefix state) +(def:''' .private (generated_symbol prefix state) (-> Text ($' Meta Code)) ({[#info info #source source #current_module _ #modules modules #scopes scopes #type_context types #host host @@ -2277,12 +2277,12 @@ #seed ("lux i64 +" 1 seed) #expected expected #location location #extensions extensions #scope_type_vars scope_type_vars #eval _eval] - (local_identifier$ ($_ text#composite "__gensym__" prefix (nat#encoded seed)))}} + (local_symbol$ ($_ text#composite "__gensym__" prefix (nat#encoded seed)))}} state)) (macro:' .public (exec tokens) ({{#Item value actions} - (let' [dummy (local_identifier$ "")] + (let' [dummy (local_symbol$ "")] (in_meta (list (list#mix ("lux type check" (-> Code Code Code) (function' [pre post] (` ({(~ dummy) (~ post)} (~ pre))))) @@ -2333,18 +2333,18 @@ (def:' .private (expander branches) (-> (List Code) (Meta (List Code))) - ({{#Item [_ {#Form {#Item [_ {#Identifier name}] args}}] + ({{#Item [_ {#Form {#Item [_ {#Symbol name}] args}}] {#Item body branches'}} (do meta_monad [??? (macro? name)] (if ??? (do meta_monad - [init_expansion (single_expansion (form$ (list& (identifier$ name) (form$ args) body branches')))] + [init_expansion (single_expansion (form$ (list& (symbol$ name) (form$ args) body branches')))] (expander init_expansion)) (do meta_monad [sub_expansion (expander branches')] - (in (list& (form$ (list& (identifier$ name) args)) + (in (list& (form$ (list& (symbol$ name) args)) body sub_expansion))))) @@ -2404,10 +2404,10 @@ _ (failure "Wrong syntax for ^or"))) -(def:' .private (identifier? code) +(def:' .private (symbol? code) (-> Code Bit) (case code - [_ {#Identifier _}] + [_ {#Symbol _}] #1 _ @@ -2421,7 +2421,7 @@ (list#mix (: (-> [Code Code] Code Code) (function' [lr body'] (let' [[l r] lr] - (if (identifier? l) + (if (symbol? l) (` ({(~ l) (~ body')} (~ r))) (` (case (~ r) (~ l) (~ body'))))))) body) @@ -2435,21 +2435,21 @@ (macro:' .public (function tokens) (case (: (Maybe [Text Code (List Code) Code]) (case tokens - (^ (list [_ {#Form (list& [_ {#Identifier ["" name]}] head tail)}] body)) + (^ (list [_ {#Form (list& [_ {#Symbol ["" name]}] head tail)}] body)) {#Some name head tail body} _ {#None})) {#Some g!name head tail body} - (let [g!blank (local_identifier$ "") + (let [g!blank (local_symbol$ "") nest (: (-> Code (-> Code Code Code)) (function' [g!name] (function' [arg body'] - (if (identifier? arg) + (if (symbol? arg) (` ([(~ g!name) (~ arg)] (~ body'))) (` ([(~ g!name) (~ g!blank)] (.case (~ g!blank) (~ arg) (~ body'))))))))] - (in_meta (list (nest (..local_identifier$ g!name) head + (in_meta (list (nest (..local_symbol$ g!name) head (list#mix (nest g!blank) body (list#reversed tail)))))) {#None} @@ -2473,11 +2473,11 @@ _ {#None})) -(def:' .private (local_identifierP tokens) +(def:' .private (local_symbolP tokens) (-> (List Code) (Maybe [(List Code) Text])) (case tokens - (^ (list& [_ {#Identifier ["" local_identifier]}] tokens')) - {#Some [tokens' local_identifier]} + (^ (list& [_ {#Symbol ["" local_symbol]}] tokens')) + {#Some [tokens' local_symbol]} _ {#None})) @@ -2496,7 +2496,7 @@ tail (<parser> tokens)] (in {#Item head tail}))))] - [parametersP Text local_identifierP] + [parametersP Text local_symbolP] [enhanced_parametersP Code anyP] ) @@ -2506,14 +2506,14 @@ (case tokens (^ (list& [_ {#Form local_declaration}] tokens')) (do maybe_monad - [% (local_identifierP local_declaration) + [% (local_symbolP local_declaration) .let' [[local_declaration name] %] parameters (<parameters_parser> local_declaration)] (in [tokens' [name parameters]])) _ (do maybe_monad - [% (local_identifierP tokens) + [% (local_symbolP tokens) .let' [[tokens' name] %]] (in [tokens' [name {#End}]]))))] @@ -2529,10 +2529,10 @@ [_ {#Bit it}] [tokens' candidate] - [_ {#Identifier ["" _]}] + [_ {#Symbol ["" _]}] [tokens (` .private)] - [_ {#Identifier it}] + [_ {#Symbol it}] [tokens' candidate] _ @@ -2586,7 +2586,7 @@ body _ - (` (function ((~ (..local_identifier$ name)) (~+ parameters)) + (` (function ((~ (..local_symbol$ name)) (~+ parameters)) (~ body)))) body (case ?type {#Some type} @@ -2595,7 +2595,7 @@ {#None} body)] - (in_meta (list (` ("lux def" (~ (..local_identifier$ name)) + (in_meta (list (` ("lux def" (~ (..local_symbol$ name)) (~ body) (~ export_policy)))))) @@ -2615,14 +2615,14 @@ (macro:' .public (macro: tokens) (case (macroP tokens) {#Some [export_policy name args body]} - (let [name (local_identifier$ name) + (let [name (local_symbol$ name) body (case args {#End} body _ (` ("lux macro" - (function ((~ name) (~+ (list#each local_identifier$ args))) (~ body)))))] + (function ((~ name) (~+ (list#each local_symbol$ args))) (~ body)))))] (in_meta (list (` ("lux def" (~ name) (~ body) (~ export_policy)))))) @@ -2671,7 +2671,7 @@ (macro: (maybe#else tokens state) (case tokens (^ (list else maybe)) - (let [g!temp (: Code [dummy_location {#Identifier ["" ""]}]) + (let [g!temp (: Code [dummy_location {#Symbol ["" ""]}]) code (` (case (~ maybe) {.#Some (~ g!temp)} (~ g!temp) @@ -2969,13 +2969,13 @@ .let [tag_mappings (: (List [Text Code]) (list#each (function (_ tag) [(product#right tag) - (identifier$ tag)]) + (symbol$ tag)]) tags))] members (monad#each meta_monad (: (-> Code (Meta (List Code))) (function (_ token) (case token - (^ [_ {#Form (list [_ {#Text "lux def"}] [_ {#Identifier ["" slot_name]}] value export_policy)}]) + (^ [_ {#Form (list [_ {#Text "lux def"}] [_ {#Symbol ["" slot_name]}] value export_policy)}]) (case (plist#value slot_name tag_mappings) {#Some tag} (in (list tag value)) @@ -3024,10 +3024,10 @@ {#Some [export_policy name args type definitions]} (let [usage (case args {#End} - (local_identifier$ name) + (local_symbol$ name) _ - (` ((~ (local_identifier$ name)) (~+ args))))] + (` ((~ (local_symbol$ name)) (~+ args))))] (in_meta (list (` (..def: (~ export_policy) (~ usage) (~ type) (implementation @@ -3064,10 +3064,10 @@ (def: (caseP tokens) (-> (List Code) (Maybe [(List Code) [Text Code]])) (case tokens - (^ (list& [_ {#Variant (list [_ {#Identifier ["" niladic]}])}] tokens')) + (^ (list& [_ {#Variant (list [_ {#Symbol ["" niladic]}])}] tokens')) {#Some [tokens' [niladic (` .Any)]]} - (^ (list& [_ {#Variant (list& [_ {#Identifier ["" polyadic]}] caseT)}] tokens')) + (^ (list& [_ {#Variant (list& [_ {#Symbol ["" polyadic]}] caseT)}] tokens')) {#Some [tokens' [polyadic (` (..Tuple (~+ caseT)))]]} _ @@ -3087,7 +3087,7 @@ (def: (slotP tokens) (-> (List Code) (Maybe [(List Code) [Text Code]])) (case tokens - (^ (list& [_ {#Identifier ["" slot]}] type tokens')) + (^ (list& [_ {#Symbol ["" slot]}] type tokens')) {#Some [tokens' [slot type]]} _ @@ -3130,9 +3130,9 @@ (def: (type_declaration it) (-> Code (Meta (Tuple Code (Maybe (Either (List Text) (List Text)))))) - ({[_ {#Form {#Item [_ {#Identifier declarer}] parameters}}] + ({[_ {#Form {#Item [_ {#Symbol declarer}] parameters}}] (do meta_monad - [declaration (single_expansion (form$ (list& (identifier$ declarer) parameters)))] + [declaration (single_expansion (form$ (list& (symbol$ declarer) parameters)))] (case declaration (^ (list type [_ {#Variant tags}])) (case (everyP textP tags) @@ -3166,7 +3166,7 @@ (do meta_monad [type+labels?? (..type_declaration type_codes) module_name current_module_name - .let' [type_name (local_identifier$ name) + .let' [type_name (local_symbol$ name) [type labels??] type+labels?? type' (: (Maybe Code) (case args @@ -3174,7 +3174,7 @@ {#Some type} _ - {#Some (` (.All ((~ type_name) (~+ (list#each local_identifier$ args))) + {#Some (` (.All ((~ type_name) (~+ (list#each local_symbol$ args))) (~ type)))}))]] (case type' {#Some type''} @@ -3244,11 +3244,11 @@ (: (-> Code (Meta Text)) (function (_ def) (case def - [_ {#Identifier ["" name]}] + [_ {#Symbol ["" name]}] (in_meta name) _ - (failure "only/+ and exclude/- require identifiers.")))) + (failure "only/+ and exclude/- require symbols.")))) defs)) (def: (referrals_parser tokens) @@ -3288,11 +3288,11 @@ [structs' (monad#each meta_monad (function (_ struct) (case struct - [_ {#Identifier ["" struct_name]}] + [_ {#Symbol ["" struct_name]}] (in_meta struct_name) _ - (failure "Expected all implementations of opening form to be identifiers."))) + (failure "Expected all implementations of opening form to be symbols."))) structs) next+remainder (openings_parser parts')] (let [[next remainder] next+remainder] @@ -3423,7 +3423,7 @@ (function (_ token) (case token ... Simple - [_ {#Identifier ["" module_name]}] + [_ {#Symbol ["" module_name]}] (do meta_monad [absolute_module_name (..absolute_module_name nested? relative_root module_name)] (in (list [#import_name absolute_module_name @@ -3432,7 +3432,7 @@ #refer_open (list)]]))) ... Nested - (^ [_ {#Tuple (list& [_ {#Identifier ["" module_name]}] extra)}]) + (^ [_ {#Tuple (list& [_ {#Symbol ["" module_name]}] extra)}]) (do meta_monad [absolute_module_name (case (normal_parallel_path relative_root module_name) {#Some parallel_path} @@ -3456,7 +3456,7 @@ #refer_open openings]] sub_imports)))) - (^ [_ {#Tuple (list& [_ {#Text alias}] [_ {#Identifier ["" module_name]}] extra)}]) + (^ [_ {#Tuple (list& [_ {#Text alias}] [_ {#Symbol ["" module_name]}] extra)}]) (do meta_monad [absolute_module_name (case (normal_parallel_path relative_root module_name) {#Some parallel_path} @@ -3732,10 +3732,10 @@ (case tokens (^ (list& [_ {#Form (list [_ {#Text alias}])}] body branches)) (do meta_monad - [g!temp (..identifier "temp")] + [g!temp (..generated_symbol "temp")] (in (list& g!temp (` (..^open (~ g!temp) (~ (text$ alias)) (~ body))) branches))) - (^ (list [_ {#Identifier name}] [_ {#Text alias}] body)) + (^ (list [_ {#Symbol name}] [_ {#Text alias}] body)) (do meta_monad [init_type (type_definition name) struct_evidence (record_slots init_type)] @@ -3753,8 +3753,8 @@ tags) pattern (|> locals (list#each (function (_ [slot binding]) - (list (identifier$ slot) - (identifier$ binding)))) + (list (symbol$ slot) + (symbol$ binding)))) list#conjoint tuple$)] (do meta_monad @@ -3772,7 +3772,7 @@ (in enhanced_target)))) target (zipped/2 locals members))] - (in (` ({(~ pattern) (~ enhanced_target)} (~ (identifier$ source))))))))) + (in (` ({(~ pattern) (~ enhanced_target)} (~ (symbol$ source))))))))) name tags&members body)] (in (list full_body))))) @@ -3811,19 +3811,19 @@ (macro: .public (value@ tokens) (case tokens - (^ (list [_ {#Identifier slot'}] record)) + (^ (list [_ {#Symbol slot'}] record)) (do meta_monad [slot (normal slot') output (..type_slot slot) .let [[idx tags exported? type] output] - g!_ (..identifier "_") - g!output (..identifier "")] + g!_ (..generated_symbol "_") + g!output (..generated_symbol "")] (case (interface_methods type) {#Some members} (let [pattern (|> (zipped/2 tags (enumeration members)) (list#each (: (-> [Symbol [Nat Type]] (List Code)) (function (_ [[r_module r_name] [r_idx r_type]]) - (list (identifier$ [r_module r_name]) + (list (symbol$ [r_module r_name]) (if ("lux i64 =" idx r_idx) g!output g!_))))) @@ -3843,8 +3843,8 @@ (^ (list selector)) (do meta_monad - [g!_ (..identifier "_") - g!record (..identifier "record")] + [g!_ (..generated_symbol "_") + g!record (..generated_symbol "record")] (in (list (` (function ((~ g!_) (~ g!record)) (..value@ (~ selector) (~ g!record))))))) _ @@ -3854,8 +3854,8 @@ (-> Text (List Symbol) Nat Symbol Code Type (Meta (List Code))) (do meta_monad [output (record_slots type) - g!_ (..identifier "g!_") - .let [g!output (local_identifier$ short) + g!_ (..generated_symbol "g!_") + .let [g!output (local_symbol$ short) pattern (|> tags enumeration (list#each (function (_ [tag_idx tag]) @@ -3875,7 +3875,7 @@ (in_meta (list#conjoint decls'))) _ - (in_meta (list (` ("lux def" (~ (local_identifier$ (..module_alias (list short) alias))) + (in_meta (list (` ("lux def" (~ (local_symbol$ (..module_alias (list short) alias))) (~ source+) #0))))))) @@ -3883,11 +3883,11 @@ (case tokens (^ (list [_ {#Text alias}] struct)) (case struct - [_ {#Identifier struct_name}] + [_ {#Symbol struct_name}] (do meta_monad [struct_type (type_definition struct_name) output (record_slots struct_type) - .let [source (identifier$ struct_name)]] + .let [source (symbol$ struct_name)]] (case output {#Some [tags members]} (do meta_monad @@ -3902,7 +3902,7 @@ _ (do meta_monad - [g!struct (..identifier "struct")] + [g!struct (..generated_symbol "struct")] (in_meta (list (` ("lux def" (~ g!struct) (~ struct) #0)) (` (..open: (~ (text$ alias)) (~ g!struct))))))) @@ -3911,14 +3911,14 @@ (macro: .public (|>> tokens) (do meta_monad - [g!_ (..identifier "_") - g!arg (..identifier "arg")] + [g!_ (..generated_symbol "_") + g!arg (..generated_symbol "arg")] (in_meta (list (` (function ((~ g!_) (~ g!arg)) (|> (~ g!arg) (~+ tokens)))))))) (macro: .public (<<| tokens) (do meta_monad - [g!_ (..identifier "_") - g!arg (..identifier "arg")] + [g!_ (..generated_symbol "_") + g!arg (..generated_symbol "arg")] (in_meta (list (` (function ((~ g!_) (~ g!arg)) (<| (~+ tokens) (~ g!arg)))))))) (def: (imported_by? import_name module_name) @@ -3984,13 +3984,13 @@ (in (list))) .let [defs (list#each (: (-> Text Code) (function (_ def) - (` ("lux def alias" (~ (local_identifier$ def)) (~ (identifier$ [module_name def])))))) + (` ("lux def alias" (~ (local_symbol$ def)) (~ (symbol$ [module_name def])))))) defs') openings (|> r_opens (list#each (: (-> Openings (List Code)) (function (_ [alias structs]) (list#each (function (_ name) - (` (open: (~ (text$ alias)) (~ (identifier$ [module_name name]))))) + (` (open: (~ (text$ alias)) (~ (symbol$ [module_name name]))))) structs)))) list#conjoint)]] (in (list#composite defs openings)))) @@ -4014,10 +4014,10 @@ (list (' "*")) {#Only defs} - (list (variant$ (list& (' "+") (list#each local_identifier$ defs)))) + (list (variant$ (list& (' "+") (list#each local_symbol$ defs)))) {#Exclude defs} - (list (variant$ (list& (' "-") (list#each local_identifier$ defs)))) + (list (variant$ (list& (' "-") (list#each local_symbol$ defs)))) {#Ignore} (list) @@ -4026,7 +4026,7 @@ (list))) openings (list#each (function (_ [alias structs]) (form$ (list& (text$ (..module_alias (list (alias_stand_in 0) module_alias) alias)) - (list#each local_identifier$ structs)))) + (list#each local_symbol$ structs)))) r_opens)] (` ((~! ..refer) (~ (text$ module_name)) (~+ localizations) @@ -4050,9 +4050,9 @@ (macro: .public (# tokens) (case tokens - (^ (list struct [_ {#Identifier member}])) + (^ (list struct [_ {#Symbol member}])) (in_meta (list (` (let [(^open (~ (text$ (alias_stand_in 0)))) (~ struct)] - (~ (identifier$ member)))))) + (~ (symbol$ member)))))) (^ (list& struct member args)) (in_meta (list (` ((..# (~ struct) (~ member)) (~+ args))))) @@ -4062,7 +4062,7 @@ (macro: .public (with@ tokens) (case tokens - (^ (list [_ {#Identifier slot'}] value record)) + (^ (list [_ {#Symbol slot'}] value record)) (do meta_monad [slot (normal slot') output (..type_slot slot) @@ -4074,20 +4074,20 @@ (: (-> [Symbol [Nat Type]] (Meta [Symbol Nat Code])) (function (_ [r_slot_name [r_idx r_type]]) (do meta_monad - [g!slot (..identifier "")] + [g!slot (..generated_symbol "")] (in_meta [r_slot_name r_idx g!slot])))) (zipped/2 tags (enumeration members)))] (let [pattern (|> pattern' (list#each (: (-> [Symbol Nat Code] (List Code)) (function (_ [r_slot_name r_idx r_var]) - (list (identifier$ r_slot_name) + (list (symbol$ r_slot_name) r_var)))) list#conjoint tuple$) output (|> pattern' (list#each (: (-> [Symbol Nat Code] (List Code)) (function (_ [r_slot_name r_idx r_var]) - (list (identifier$ r_slot_name) + (list (symbol$ r_slot_name) (if ("lux i64 =" idx r_idx) value r_var))))) @@ -4107,7 +4107,7 @@ (do meta_monad [bindings (monad#each meta_monad (: (-> Code (Meta Code)) - (function (_ _) (..identifier "temp"))) + (function (_ _) (..generated_symbol "temp"))) slots) .let [pairs (zipped/2 slots bindings) update_expr (list#mix (: (-> [Code Code] Code Code) @@ -4127,16 +4127,16 @@ (^ (list selector value)) (do meta_monad - [g!_ (..identifier "_") - g!record (..identifier "record")] + [g!_ (..generated_symbol "_") + g!record (..generated_symbol "record")] (in (list (` (function ((~ g!_) (~ g!record)) (..with@ (~ selector) (~ value) (~ g!record))))))) (^ (list selector)) (do meta_monad - [g!_ (..identifier "_") - g!value (..identifier "value") - g!record (..identifier "record")] + [g!_ (..generated_symbol "_") + g!value (..generated_symbol "value") + g!record (..generated_symbol "record")] (in (list (` (function ((~ g!_) (~ g!value) (~ g!record)) (..with@ (~ selector) (~ g!value) (~ g!record))))))) @@ -4145,7 +4145,7 @@ (macro: .public (revised@ tokens) (case tokens - (^ (list [_ {#Identifier slot'}] fun record)) + (^ (list [_ {#Symbol slot'}] fun record)) (do meta_monad [slot (normal slot') output (..type_slot slot) @@ -4157,20 +4157,20 @@ (: (-> [Symbol [Nat Type]] (Meta [Symbol Nat Code])) (function (_ [r_slot_name [r_idx r_type]]) (do meta_monad - [g!slot (..identifier "")] + [g!slot (..generated_symbol "")] (in_meta [r_slot_name r_idx g!slot])))) (zipped/2 tags (enumeration members)))] (let [pattern (|> pattern' (list#each (: (-> [Symbol Nat Code] (List Code)) (function (_ [r_slot_name r_idx r_var]) - (list (identifier$ r_slot_name) + (list (symbol$ r_slot_name) r_var)))) list#conjoint tuple$) output (|> pattern' (list#each (: (-> [Symbol Nat Code] (List Code)) (function (_ [r_slot_name r_idx r_var]) - (list (identifier$ r_slot_name) + (list (symbol$ r_slot_name) (if ("lux i64 =" idx r_idx) (` ((~ fun) (~ r_var))) r_var))))) @@ -4188,24 +4188,24 @@ _ (do meta_monad - [g!record (..identifier "record") - g!temp (..identifier "temp")] + [g!record (..generated_symbol "record") + g!temp (..generated_symbol "temp")] (in (list (` (let [(~ g!record) (~ record) (~ g!temp) (value@ [(~+ slots)] (~ g!record))] (with@ [(~+ slots)] ((~ fun) (~ g!temp)) (~ g!record)))))))) (^ (list selector fun)) (do meta_monad - [g!_ (..identifier "_") - g!record (..identifier "record")] + [g!_ (..generated_symbol "_") + g!record (..generated_symbol "record")] (in (list (` (function ((~ g!_) (~ g!record)) (..revised@ (~ selector) (~ fun) (~ g!record))))))) (^ (list selector)) (do meta_monad - [g!_ (..identifier "_") - g!fun (..identifier "fun") - g!record (..identifier "record")] + [g!_ (..generated_symbol "_") + g!fun (..generated_symbol "fun") + g!record (..generated_symbol "record")] (in (list (` (function ((~ g!_) (~ g!fun) (~ g!record)) (..revised@ (~ selector) (~ g!fun) (~ g!record))))))) @@ -4220,7 +4220,7 @@ branches)) (case (: (Maybe (List Code)) (do maybe_monad - [bindings' (monad#each maybe_monad identifier_short bindings) + [bindings' (monad#each maybe_monad symbol_short bindings) data' (monad#each maybe_monad tuple_list data)] (let [num_bindings (list#size bindings')] (if (every? (|>> ("lux i64 =" num_bindings)) @@ -4292,10 +4292,10 @@ {#Named [module name] anonymous} ... TODO: Generate the explicit type definition instead of using - ... the "identifier$" shortcut below. + ... the "symbol$" shortcut below. ... (` {.#Named [(~ (text$ module)) (~ (text$ name))] ... (~ (type_code anonymous))}) - (identifier$ [module name]))) + (symbol$ [module name]))) (macro: .public (loop tokens) (let [?params (case tokens @@ -4303,7 +4303,7 @@ {#Some [name bindings body]} (^ (list [_ {#Tuple bindings}] body)) - {#Some [(local_identifier$ "recur") bindings body]} + {#Some [(local_symbol$ "recur") bindings body]} _ {#None})] @@ -4312,10 +4312,10 @@ (let [pairs (pairs bindings) vars (list#each product#left pairs) inits (list#each product#right pairs)] - (if (every? identifier? inits) + (if (every? symbol? inits) (do meta_monad [inits' (: (Meta (List Symbol)) - (case (monad#each maybe_monad identifier_name inits) + (case (monad#each maybe_monad symbol_name inits) {#Some inits'} (in_meta inits') {#None} (failure "Wrong syntax for loop"))) init_types (monad#each meta_monad type_definition inits') @@ -4329,7 +4329,7 @@ (do meta_monad [aliases (monad#each meta_monad (: (-> Code (Meta Code)) - (function (_ _) (..identifier ""))) + (function (_ _) (..generated_symbol ""))) inits)] (in_meta (list (` (let [(~+ (..interleaved aliases inits))] (.loop (~ name) @@ -4345,7 +4345,7 @@ (^or [_ {#Bit _}] [_ {#Nat _}] [_ {#Int _}] [_ {#Rev _}] [_ {#Frac _}] [_ {#Text _}]) (list target) - [_ {#Identifier [module name]}] + [_ {#Symbol [module name]}] (if (and (text#= "" module) (text#= label name)) tokens @@ -4362,7 +4362,7 @@ (case tokens (^ (list& [_ {#Tuple bindings}] bodies)) (case bindings - (^ (list& [_ {#Identifier ["" var_name]}] expr bindings')) + (^ (list& [_ {#Symbol ["" var_name]}] expr bindings')) (do meta_monad [expansion (single_expansion expr)] (in (with_expansions' var_name expansion @@ -4420,7 +4420,7 @@ (def: (static_literal token) (-> Code (Meta Code)) (case token - [_ {#Identifier [def_module def_name]}] + [_ {#Symbol [def_module def_name]}] (if (text#= "" def_module) (do meta_monad [current_module current_module_name] @@ -4480,7 +4480,7 @@ (-> Code [Multi_Level_Case Code] (List Code)) (let [inner_pattern_body (list#mix (function (_ [calculation pattern] success) (let [bind? (case pattern - [_ {#Identifier _}] + [_ {#Symbol _}] #1 _ @@ -4502,13 +4502,13 @@ (do meta_monad [mlc (multi_level_case^ levels) .let [initial_bind? (case mlc - [[_ {#Identifier _}] _] + [[_ {#Symbol _}] _] #1 _ #0)] expected ..expected_type - g!temp (..identifier "temp")] + g!temp (..generated_symbol "temp")] (let [output (list g!temp (` ({{.#Some (~ g!temp)} (~ g!temp) @@ -4538,7 +4538,7 @@ (macro: .public (symbol tokens) (case tokens - (^ (list [_ {#Identifier [module name]}])) + (^ (list [_ {#Symbol [module name]}])) (in_meta (list (` [(~ (text$ module)) (~ (text$ name))]))) _ @@ -4575,8 +4575,8 @@ (macro: .public (^@ tokens) (case tokens - (^ (list& [_meta {#Form (list [_ {#Identifier ["" name]}] pattern)}] body branches)) - (let [g!whole (local_identifier$ name)] + (^ (list& [_meta {#Form (list [_ {#Symbol ["" name]}] pattern)}] body branches)) + (let [g!whole (local_symbol$ name)] (in_meta (list& g!whole (` (case (~ g!whole) (~ pattern) (~ body))) branches))) @@ -4586,8 +4586,8 @@ (macro: .public (^|> tokens) (case tokens - (^ (list& [_meta {#Form (list [_ {#Identifier ["" name]}] [_ {#Tuple steps}])}] body branches)) - (let [g!name (local_identifier$ name)] + (^ (list& [_meta {#Form (list [_ {#Symbol ["" name]}] [_ {#Tuple steps}])}] body branches)) + (let [g!name (local_symbol$ name)] (in_meta (list& g!name (` (let [(~ g!name) (|> (~ g!name) (~+ steps))] (~ body))) @@ -4626,14 +4626,14 @@ (macro: .public (:of tokens) (case tokens - (^ (list [_ {#Identifier var_name}])) + (^ (list [_ {#Symbol var_name}])) (do meta_monad [var_type (type_definition var_name)] (in (list (type_code var_type)))) (^ (list expression)) (do meta_monad - [g!temp (..identifier "g!temp")] + [g!temp (..generated_symbol "g!temp")] (in (list (` (let [(~ g!temp) (~ expression)] (..:of (~ g!temp))))))) @@ -4663,17 +4663,17 @@ (case (templateP tokens) {#Some [export_policy name args input_templates]} (do meta_monad - [g!tokens (..identifier "tokens") - g!compiler (..identifier "compiler") - g!_ (..identifier "_") + [g!tokens (..generated_symbol "tokens") + g!compiler (..generated_symbol "compiler") + g!_ (..generated_symbol "_") .let [rep_env (list#each (function (_ arg) - [arg (` ((~' ~) (~ (local_identifier$ arg))))]) + [arg (` ((~' ~) (~ (local_symbol$ arg))))]) args)] this_module current_module_name] (in (list (` (macro: (~ export_policy) - ((~ (local_identifier$ name)) (~ g!tokens) (~ g!compiler)) + ((~ (local_symbol$ name)) (~ g!tokens) (~ g!compiler)) (case (~ g!tokens) - (^ (list (~+ (list#each local_identifier$ args)))) + (^ (list (~+ (list#each local_symbol$ args)))) {.#Right [(~ g!compiler) (list (~+ (list#each (function (_ template) (` (`' (~ (with_replacements rep_env @@ -4711,10 +4711,10 @@ [_ {#Text platform}] (..in_meta platform) - [_ {#Identifier identifier}] + [_ {#Symbol symbol}] (do meta_monad - [identifier (..global_identifier identifier) - type+value (..definition_value identifier) + [symbol (..global_symbol symbol) + type+value (..definition_value symbol) .let [[type value] type+value]] (case (..flat_alias type) (^or {#Primitive "#Text" {#End}} @@ -4723,13 +4723,13 @@ _ (failure ($_ text#composite - "Invalid target platform (must be a value of type Text): " (symbol#encoded identifier) + "Invalid target platform (must be a value of type Text): " (symbol#encoded symbol) " : " (..code#encoded (..type_code type)))))) _ (failure ($_ text#composite "Invalid target platform syntax: " (..code#encoded choice) - \n "Must be either a text literal or an identifier.")))) + \n "Must be either a text literal or a symbol.")))) (def: (target_pick target options default) (-> Text (List [Code Code]) (Maybe Code) (Meta (List Code))) @@ -4784,9 +4784,9 @@ (def: (embedded_expansions code) (-> Code (Meta [(List [Code Code]) Code])) (case code - (^ [ann {#Form (list [_ {#Identifier ["" "~~"]}] expansion)}]) + (^ [ann {#Form (list [_ {#Symbol ["" "~~"]}] expansion)}]) (do meta_monad - [g!expansion (..identifier "g!expansion")] + [g!expansion (..generated_symbol "g!expansion")] (in [(list [g!expansion expansion]) g!expansion])) (^template [<tag>] @@ -4834,7 +4834,7 @@ (-> Code (-> Code (Meta Code)) (-> (List Code) (Meta Code))) (case (list#reversed elems) - {#Item [_ {#Form {#Item [[_ {#Identifier ["" "~+"]}] {#Item [spliced {#End}]}]}}] + {#Item [_ {#Form {#Item [[_ {#Symbol ["" "~+"]}] {#Item [spliced {#End}]}]}}] inits} (do meta_monad [=inits (monad#each meta_monad untemplated_pattern (list#reversed inits))] @@ -4853,7 +4853,7 @@ (def: (untemplated_pattern pattern) (-> Code (Meta Code)) (do meta_monad - [g!meta (..identifier "g!meta")] + [g!meta (..generated_symbol "g!meta")] (case pattern (^template [<tag> <gen>] [[_ {<tag> value}] @@ -4864,12 +4864,12 @@ [.#Rev rev$] [.#Frac frac$] [.#Text text$] - [.#Identifier name$]) + [.#Symbol name$]) - [_ {#Form {#Item [[_ {#Identifier ["" "~"]}] {#Item [unquoted {#End}]}]}}] + [_ {#Form {#Item [[_ {#Symbol ["" "~"]}] {#Item [unquoted {#End}]}]}}] (in_meta unquoted) - [_ {#Form {#Item [[_ {#Identifier ["" "~+"]}] {#Item [spliced {#End}]}]}}] + [_ {#Form {#Item [[_ {#Symbol ["" "~+"]}] {#Item [spliced {#End}]}]}}] (failure "Cannot use (~+) inside of ^code unless it is the last element in a form or a tuple.") (^template [<tag> <untemplated>] @@ -4922,7 +4922,7 @@ (case tokens (^ (list expression)) (do meta_monad - [g!_ (..identifier "g!_")] + [g!_ (..generated_symbol "g!_")] (in (list (` ("lux try" (.function ((~ g!_) (~ g!_)) (~ expression))))))) @@ -4933,7 +4933,7 @@ (def: (methodP tokens) (-> (List Code) (Maybe [(List Code) [Text Code]])) (case tokens - (^ (list& [_ {#Form (list [_ {#Text "lux type check"}] type [_ {#Identifier ["" name]}])}] + (^ (list& [_ {#Form (list [_ {#Text "lux type check"}] type [_ {#Symbol ["" name]}])}] tokens')) {#Some [tokens' [name type]]} @@ -4954,17 +4954,17 @@ (def: (recursive_type g!self g!dummy name body) (-> Code Code Text Code Code) (` ((.All ((~ g!self) (~ g!dummy)) - (~ (let$ (local_identifier$ name) (` {.#Apply (..Primitive "") (~ g!self)}) + (~ (let$ (local_symbol$ name) (` {.#Apply (..Primitive "") (~ g!self)}) body))) (..Primitive "")))) (macro: .public (Rec tokens) (case tokens - (^ (list [_ {#Identifier "" name}] body)) + (^ (list [_ {#Symbol "" name}] body)) (do meta_monad [body' (expansion body) - g!self (identifier "g!self") - g!dummy (identifier "g!dummy")] + g!self (generated_symbol "g!self") + g!dummy (generated_symbol "g!dummy")] (case body' (^ (list body' labels)) (in (list (..recursive_type g!self g!dummy name body') labels)) diff --git a/stdlib/source/library/lux/abstract/comonad.lux b/stdlib/source/library/lux/abstract/comonad.lux index af96eb4e2..e3b0f9dbc 100644 --- a/stdlib/source/library/lux/abstract/comonad.lux +++ b/stdlib/source/library/lux/abstract/comonad.lux @@ -26,7 +26,7 @@ (macro: .public (be tokens state) (case (: (Maybe [(Maybe Text) Code (List Code) Code]) (case tokens - (^ (list [_ {.#Tuple (list [_ {.#Identifier ["" name]}] comonad)}] [_ {.#Tuple bindings}] body)) + (^ (list [_ {.#Tuple (list [_ {.#Symbol ["" name]}] comonad)}] [_ {.#Tuple bindings}] body)) {.#Some [{.#Some name} comonad bindings body]} (^ (list comonad [_ {.#Tuple bindings}] body)) @@ -37,20 +37,20 @@ {.#Some [?name comonad bindings body]} (if (|> bindings list.size (n.% 2) (n.= 0)) (let [[module short] (symbol ..be) - identifier (: (-> Text Code) - (|>> ($_ "lux text concat" module " " short " ") [""] {.#Identifier} [location.dummy])) - g!_ (identifier "_") - g!each (identifier "each") - g!disjoint (identifier "disjoint") + symbol (: (-> Text Code) + (|>> ($_ "lux text concat" module " " short " ") [""] {.#Symbol} [location.dummy])) + g!_ (symbol "_") + g!each (symbol "each") + g!disjoint (symbol "disjoint") body' (list#mix (: (-> [Code Code] Code Code) (function (_ binding body') (with_expansions [<default> (` (|> (~ value) (~ g!disjoint) ((~ g!each) (function ((~ g!_) (~ var)) (~ body')))))] (let [[var value] binding] (case var - [_ {.#Identifier ["" _]}] + [_ {.#Symbol ["" _]}] <default> - [_ {.#Identifier _}] + [_ {.#Symbol _}] (` ((~ var) (~ value) (~ body'))) _ @@ -59,7 +59,7 @@ (list.reversed (list.pairs bindings)))] {.#Right [state (list (case ?name {.#Some name} - (let [name [location.dummy {.#Identifier ["" name]}]] + (let [name [location.dummy {.#Symbol ["" name]}]] (` (.case (~ comonad) (~ name) (.case (~ name) diff --git a/stdlib/source/library/lux/abstract/monad.lux b/stdlib/source/library/lux/abstract/monad.lux index db53c915d..738654ef5 100644 --- a/stdlib/source/library/lux/abstract/monad.lux +++ b/stdlib/source/library/lux/abstract/monad.lux @@ -57,7 +57,7 @@ (macro: .public (do tokens state) (case (: (Maybe [(Maybe Text) Code (List Code) Code]) (case tokens - (^ (list [_ {.#Tuple (list [_ {.#Identifier ["" name]}] monad)}] [_ {.#Tuple bindings}] body)) + (^ (list [_ {.#Tuple (list [_ {.#Symbol ["" name]}] monad)}] [_ {.#Tuple bindings}] body)) {.#Some [{.#Some name} monad bindings body]} (^ (list monad [_ {.#Tuple bindings}] body)) @@ -68,20 +68,20 @@ {.#Some [?name monad bindings body]} (if (|> bindings list#size .int ("lux i64 %" +2) ("lux i64 =" +0)) (let [[module short] (symbol ..do) - identifier (: (-> Text Code) - (|>> ($_ "lux text concat" module " " short " ") [""] {.#Identifier} [location.dummy])) - g!_ (identifier "_") - g!each (identifier "each") - g!conjoint (identifier "conjoint") + symbol (: (-> Text Code) + (|>> ($_ "lux text concat" module " " short " ") [""] {.#Symbol} [location.dummy])) + g!_ (symbol "_") + g!each (symbol "each") + g!conjoint (symbol "conjoint") body' (list#mix (: (-> [Code Code] Code Code) (function (_ binding body') (with_expansions [<default> (` (|> (~ value) ((~ g!each) (function ((~ g!_) (~ var)) (~ body'))) (~ g!conjoint)))] (let [[var value] binding] (case var - [_ {.#Identifier ["" _]}] + [_ {.#Symbol ["" _]}] <default> - [_ {.#Identifier _}] + [_ {.#Symbol _}] (` ((~ var) (~ value) (~ body'))) _ @@ -90,7 +90,7 @@ (reversed (pairs bindings)))] {.#Right [state (list (case ?name {.#Some name} - (let [name [location.dummy {.#Identifier ["" name]}]] + (let [name [location.dummy {.#Symbol ["" name]}]] (` (.case (~ monad) (~ name) (.case (~ name) diff --git a/stdlib/source/library/lux/abstract/monad/indexed.lux b/stdlib/source/library/lux/abstract/monad/indexed.lux index 0d05fa951..0b0952bb4 100644 --- a/stdlib/source/library/lux/abstract/monad/indexed.lux +++ b/stdlib/source/library/lux/abstract/monad/indexed.lux @@ -36,16 +36,16 @@ {#Macro Symbol Code} {#Binding Binding})) -(def: global_identifier +(def: global_symbol (Parser Symbol) (//.do <>.monad - [[module short] <code>.identifier + [[module short] <code>.symbol _ (<>.assertion "" (case module "" false _ true))] (in [module short]))) (def: context (Parser Context) - (<>.or (<>.and ..global_identifier + (<>.or (<>.and ..global_symbol <code>.any) binding)) @@ -56,7 +56,7 @@ (def: named_monad (Parser [(Maybe Text) Code]) (<>.either (<code>.tuple (<>.and (# <>.monad each (|>> {.#Some}) - <code>.local_identifier) + <code>.local_symbol) <code>.any)) (# <>.monad each (|>> [{.#None}]) <code>.any))) @@ -64,11 +64,11 @@ (syntax: .public (do [[?name monad] ..named_monad context (<code>.tuple (<>.some context)) expression <code>.any]) - (macro.with_identifiers [g!_ g!then] + (macro.with_symbols [g!_ g!then] (let [body (list#mix (function (_ context next) (case context {#Macro macro parameter} - (` ((~ (code.identifier macro)) + (` ((~ (code.symbol macro)) (~ parameter) (~ next))) @@ -81,7 +81,7 @@ (list.reversed context))] (in (list (case ?name {.#Some name} - (let [name (code.local_identifier name)] + (let [name (code.local_symbol name)] (` (let [(~ name) (~ monad) [..in (~' in) ..then (~ g!then)] (~ name)] diff --git a/stdlib/source/library/lux/control/concatenative.lux b/stdlib/source/library/lux/control/concatenative.lux index f4170b94a..0eded28b3 100644 --- a/stdlib/source/library/lux/control/concatenative.lux +++ b/stdlib/source/library/lux/control/concatenative.lux @@ -11,7 +11,7 @@ ["%" format {"+" format}]] [collection ["[0]" list ("[1]#[0]" mix functor)]]] - ["[0]" macro {"+" with_identifiers} + ["[0]" macro {"+" with_symbols} ["[0]" code] ["[0]" template] [syntax {"+" syntax:} @@ -36,7 +36,7 @@ (def: aliases^ (Parser (List Alias)) - (|> (<>.and <code>.local_identifier <code>.any) + (|> (<>.and <code>.local_symbol <code>.any) <>.some <code>.tuple)) @@ -82,7 +82,7 @@ (syntax: .public (=> [[aliases inputs outputs] signature^]) (let [de_alias (function (_ aliased) (list#mix (function (_ [from to] pre) - (code.replaced (code.local_identifier from) to pre)) + (code.replaced (code.local_symbol from) to pre)) aliased aliases))] (case [(value@ #bottom inputs) @@ -95,11 +95,11 @@ (~ (de_alias outputC))))))) [?bottomI ?bottomO] - (with_identifiers [g!stack] + (with_symbols [g!stack] (monad.do meta.monad [inputC (singleton (macro.full_expansion (stack_mix (value@ #top inputs) (maybe.else g!stack ?bottomI)))) outputC (singleton (macro.full_expansion (stack_mix (value@ #top outputs) (maybe.else g!stack ?bottomO))))] - (with_identifiers [g!_] + (with_symbols [g!_] (in (list (` (All ((~ g!_) (~ g!stack)) (-> (~ (de_alias inputC)) (~ (de_alias outputC))))))))))))) @@ -120,19 +120,19 @@ (Parser [Code Text Code (List Code)]) (|export|.parser ($_ <>.and - <code>.local_identifier + <code>.local_symbol <code>.any (<>.many <code>.any)))) (syntax: .public (word: [[export_policy name type commands] ..word]) - (in (list (` (def: (~ export_policy) (~ (code.local_identifier name)) + (in (list (` (def: (~ export_policy) (~ (code.local_symbol name)) (~ type) (|>> (~+ commands))))))) (syntax: .public (apply [arity (<>.only (n.> 0) <code>.nat)]) - (with_identifiers [g!_ g!func g!stack g!output] + (with_symbols [g!_ g!func g!stack g!output] (monad.do [! meta.monad] - [g!inputs (|> (macro.identifier "input") (list.repeated arity) (monad.all !))] + [g!inputs (|> (macro.symbol "input") (list.repeated arity) (monad.all !))] (in (list (` (: (All ((~ g!_) (~+ g!inputs) (~ g!output)) (-> (-> (~+ g!inputs) (~ g!output)) (=> [(~+ g!inputs)] [(~ g!output)]))) @@ -141,7 +141,7 @@ [(~ g!stack) ((~ g!func) (~+ g!inputs))]))))))))) (template [<arity>] - [(`` (def: .public (~~ (template.identifier ["apply/" <arity>])) + [(`` (def: .public (~~ (template.symbol ["apply/" <arity>])) (..apply <arity>)))] [1] [2] [3] [4] diff --git a/stdlib/source/library/lux/control/concurrency/actor.lux b/stdlib/source/library/lux/control/concurrency/actor.lux index 7bbc5f158..b3f261d65 100644 --- a/stdlib/source/library/lux/control/concurrency/actor.lux +++ b/stdlib/source/library/lux/control/concurrency/actor.lux @@ -19,7 +19,7 @@ ["%" format {"+" format}]] [collection ["[0]" list ("[1]#[0]" monoid monad)]]] - ["[0]" macro {"+" with_identifiers} + ["[0]" macro {"+" with_symbols} ["[0]" code] [syntax {"+" syntax:} ["|[0]|" input] @@ -212,8 +212,8 @@ (def: actor_decl^ (Parser [Text (List Text)]) - (<>.either (<code>.form (<>.and <code>.local_identifier (<>.some <code>.local_identifier))) - (<>.and <code>.local_identifier (# <>.monad in (list))))) + (<>.either (<code>.form (<>.and <code>.local_symbol (<>.some <code>.local_symbol))) + (<>.and <code>.local_symbol (# <>.monad in (list))))) (type: On_MailC [[Text Text Text] Code]) @@ -223,7 +223,7 @@ (def: argument (Parser Text) - <code>.local_identifier) + <code>.local_symbol) (def: on_mail^ (Parser (Maybe On_MailC)) @@ -245,9 +245,9 @@ {.#Some [[mailN stateN selfN] bodyC]} (` (function ((~ g!_) - (~ (code.local_identifier mailN)) - (~ (code.local_identifier stateN)) - (~ (code.local_identifier selfN))) + (~ (code.local_symbol mailN)) + (~ (code.local_symbol stateN)) + (~ (code.local_symbol selfN))) (~ bodyC))))) (def: actorP @@ -259,11 +259,11 @@ behavior^))) (syntax: .public (actor: [[export_policy [name vars] state_type [?on_mail messages]] ..actorP]) - (with_identifiers [g!_] + (with_symbols [g!_] (do meta.monad - [g!type (macro.identifier (format name "_abstract_type")) - .let [g!actor (code.local_identifier name) - g!vars (list#each code.local_identifier vars)]] + [g!type (macro.symbol (format name "_abstract_type")) + .let [g!actor (code.local_symbol name) + g!vars (list#each code.local_symbol vars)]] (in (list (` ((~! abstract:) (~ export_policy) ((~ g!type) (~+ g!vars)) (~ state_type) @@ -277,7 +277,7 @@ (syntax: .public (actor [[state_type init] (<code>.tuple (<>.and <code>.any <code>.any)) ?on_mail on_mail^]) - (with_identifiers [g!_] + (with_symbols [g!_] (in (list (` (: ((~! io.IO) (..Actor (~ state_type))) (..spawn! (: (..Behavior (~ state_type) (~ state_type)) [..#on_init (|>>) @@ -296,16 +296,16 @@ (def: signature^ (Parser Signature) (<code>.form ($_ <>.and - (<>.else (list) (<code>.tuple (<>.some <code>.local_identifier))) - <code>.local_identifier + (<>.else (list) (<code>.tuple (<>.some <code>.local_symbol))) + <code>.local_symbol |input|.parser - <code>.local_identifier - <code>.local_identifier))) + <code>.local_symbol + <code>.local_symbol))) (def: reference^ (Parser [Symbol (List Text)]) - (<>.either (<code>.form (<>.and <code>.identifier (<>.some <code>.local_identifier))) - (<>.and <code>.identifier (# <>.monad in (list))))) + (<>.either (<code>.form (<>.and <code>.symbol (<>.some <code>.local_symbol))) + (<>.and <code>.symbol (# <>.monad in (list))))) (def: messageP (Parser [Code Signature Code Code]) @@ -316,17 +316,17 @@ <code>.any))) (syntax: .public (message: [[export_policy signature output_type body] ..messageP]) - (with_identifiers [g!_ g!return] + (with_symbols [g!_ g!return] (do meta.monad [actor_scope abstract.current - .let [g!type (code.local_identifier (value@ abstract.#name actor_scope)) - g!message (code.local_identifier (value@ #name signature)) + .let [g!type (code.local_symbol (value@ abstract.#name actor_scope)) + g!message (code.local_symbol (value@ #name signature)) g!actor_vars (value@ abstract.#type_vars actor_scope) - g!all_vars (|> signature (value@ #vars) (list#each code.local_identifier) (list#composite g!actor_vars)) + g!all_vars (|> signature (value@ #vars) (list#each code.local_symbol) (list#composite g!actor_vars)) g!inputsC (|> signature (value@ #inputs) (list#each product.left)) g!inputsT (|> signature (value@ #inputs) (list#each product.right)) - g!state (|> signature (value@ #state) code.local_identifier) - g!self (|> signature (value@ #self) code.local_identifier)]] + g!state (|> signature (value@ #state) code.local_symbol) + g!self (|> signature (value@ #self) code.local_symbol)]] (in (list (` (def: (~ export_policy) ((~ g!message) (~+ g!inputsC)) (All ((~ g!_) (~+ g!all_vars)) (-> (~+ g!inputsT) diff --git a/stdlib/source/library/lux/control/continuation.lux b/stdlib/source/library/lux/control/continuation.lux index 3be6645ff..97714878e 100644 --- a/stdlib/source/library/lux/control/continuation.lux +++ b/stdlib/source/library/lux/control/continuation.lux @@ -9,7 +9,7 @@ ["[0]" function] [parser ["<[0]>" code]]] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" code]]]]) @@ -34,7 +34,7 @@ k))) (syntax: .public (pending [expr <code>.any]) - (with_identifiers [g!_ g!k] + (with_symbols [g!_ g!k] (in (list (` (.function ((~ g!_) (~ g!k)) ((~ g!k) (~ expr)))))))) (def: .public (reset scope) diff --git a/stdlib/source/library/lux/control/exception.lux b/stdlib/source/library/lux/control/exception.lux index 7e92d15da..114c0c07f 100644 --- a/stdlib/source/library/lux/control/exception.lux +++ b/stdlib/source/library/lux/control/exception.lux @@ -81,8 +81,8 @@ (let [private (: (Parser [(List |type_variable|.Variable) [Text (List |input|.Input)] (Maybe Code)]) ($_ <>.and (<>.else (list) (<code>.tuple (<>.some |type_variable|.parser))) - (<>.either (<code>.form (<>.and <code>.local_identifier |input|.parser)) - (<>.and <code>.local_identifier (<>#in (list)))) + (<>.either (<code>.form (<>.and <code>.local_symbol |input|.parser)) + (<>.and <code>.local_symbol (<>#in (list)))) (<>.maybe <code>.any) ))] ($_ <>.either @@ -91,11 +91,11 @@ ))) (syntax: .public (exception: [[export_policy t_vars [name inputs] body] ..exception]) - (macro.with_identifiers [g!_ g!descriptor] + (macro.with_symbols [g!_ g!descriptor] (do meta.monad [current_module meta.current_module_name .let [descriptor ($_ text#composite "{" current_module "." name "}" text.new_line) - g!self (code.local_identifier name)]] + g!self (code.local_symbol name)]] (in (list (` (def: (~ export_policy) (~ g!self) (All ((~ g!_) (~+ (list#each |type_variable|.format t_vars))) diff --git a/stdlib/source/library/lux/control/function/contract.lux b/stdlib/source/library/lux/control/function/contract.lux index 3817a4bef..526b36e74 100644 --- a/stdlib/source/library/lux/control/function/contract.lux +++ b/stdlib/source/library/lux/control/function/contract.lux @@ -8,7 +8,7 @@ [data [text ["%" format {"+" format}]]] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" code]] [math @@ -39,7 +39,7 @@ (syntax: .public (post [test <code>.any expr <code>.any]) - (with_identifiers [g!output] + (with_symbols [g!output] (in (list (` (let [(~ g!output) (~ expr)] (exec ((~! ..assert!) (~ (code.text (exception.error ..post_condition_failed test))) diff --git a/stdlib/source/library/lux/control/function/mutual.lux b/stdlib/source/library/lux/control/function/mutual.lux index 493c36d80..999eea333 100644 --- a/stdlib/source/library/lux/control/function/mutual.lux +++ b/stdlib/source/library/lux/control/function/mutual.lux @@ -59,17 +59,17 @@ (in (list body)) {.#Item mutual {.#End}} - (.let [g!name (|> mutual (value@ [#declaration declaration.#name]) code.local_identifier)] + (.let [g!name (|> mutual (value@ [#declaration declaration.#name]) code.local_symbol)] (in (list (` (.let [(~ g!name) (: (~ (value@ #type mutual)) (function (~ (declaration.format (value@ #declaration mutual))) (~ (value@ #body mutual))))] (~ body)))))) _ - (macro.with_identifiers [g!context g!output] + (macro.with_symbols [g!context g!output] (do [! meta.monad] [here_name meta.current_module_name - hidden_names (monad.each ! (//.constant (macro.identifier "mutual_function#")) + hidden_names (monad.each ! (//.constant (macro.symbol "mutual_function#")) functions) .let [definitions (list#each (..mutual_definition hidden_names g!context) (list.zipped/2 hidden_names @@ -77,7 +77,7 @@ context_types (list#each (function (_ mutual) (` (-> (~ g!context) (~ (value@ #type mutual))))) functions) - user_names (list#each (|>> (value@ [#declaration declaration.#name]) code.local_identifier) + user_names (list#each (|>> (value@ [#declaration declaration.#name]) code.local_symbol) functions)] g!pop (local.push (list#each (function (_ [g!name mutual]) [[here_name (value@ [#declaration declaration.#name] mutual)] @@ -118,10 +118,10 @@ (~ _#body)))))) _ - (macro.with_identifiers [g!context g!output] + (macro.with_symbols [g!context g!output] (do [! meta.monad] [here_name meta.current_module_name - hidden_names (monad.each ! (//.constant (macro.identifier "mutual_function#")) + hidden_names (monad.each ! (//.constant (macro.symbol "mutual_function#")) functions) .let [definitions (list#each (..mutual_definition hidden_names g!context) (list.zipped/2 hidden_names @@ -129,7 +129,7 @@ context_types (list#each (function (_ mutual) (` (-> (~ g!context) (~ (value@ [#mutual #type] mutual))))) functions) - user_names (list#each (|>> (value@ [#mutual #declaration declaration.#name]) code.local_identifier) + user_names (list#each (|>> (value@ [#mutual #declaration declaration.#name]) code.local_symbol) functions)] g!pop (local.push (list#each (function (_ [g!name mutual]) [[here_name (value@ [#mutual #declaration declaration.#name] mutual)] @@ -147,7 +147,7 @@ user_names))]))) g!pop (list#each (function (_ mutual) - (.let [g!name (|> mutual (value@ [#mutual #declaration declaration.#name]) code.local_identifier)] + (.let [g!name (|> mutual (value@ [#mutual #declaration declaration.#name]) code.local_symbol)] (` (.def: (~ (value@ #export_policy mutual)) (~ g!name) diff --git a/stdlib/source/library/lux/control/io.lux b/stdlib/source/library/lux/control/io.lux index 23267c01d..21ec7bb8f 100644 --- a/stdlib/source/library/lux/control/io.lux +++ b/stdlib/source/library/lux/control/io.lux @@ -10,7 +10,7 @@ ["<[0]>" code]]] [type abstract] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" template]]]]) @@ -31,7 +31,7 @@ [((:representation io) [])]) (syntax: .public (io [computation <code>.any]) - (with_identifiers [g!func g!arg] + (with_symbols [g!func g!arg] (in (list (` ((~! ..label) (function ((~ g!func) (~ g!arg)) (~ computation)))))))) diff --git a/stdlib/source/library/lux/control/lazy.lux b/stdlib/source/library/lux/control/lazy.lux index 414f8bc37..76f7b49c9 100644 --- a/stdlib/source/library/lux/control/lazy.lux +++ b/stdlib/source/library/lux/control/lazy.lux @@ -12,7 +12,7 @@ ["<[0]>" code]] [concurrency ["[0]" atom]]] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}]] [type abstract]]]) @@ -39,7 +39,7 @@ ((:representation lazy) []))) (syntax: .public (lazy [expression <code>.any]) - (with_identifiers [g!_] + (with_symbols [g!_] (in (list (` ((~! ..lazy') (function ((~ g!_) (~ g!_)) (~ expression)))))))) (implementation: .public (equivalence (^open "_#[0]")) diff --git a/stdlib/source/library/lux/control/maybe.lux b/stdlib/source/library/lux/control/maybe.lux index ce7c40222..2988a6d42 100644 --- a/stdlib/source/library/lux/control/maybe.lux +++ b/stdlib/source/library/lux/control/maybe.lux @@ -122,7 +122,7 @@ (macro: .public (else tokens state) (case tokens (^ (.list else maybe)) - (let [g!temp (: Code [location.dummy {.#Identifier ["" ""]}])] + (let [g!temp (: Code [location.dummy {.#Symbol ["" ""]}])] {.#Right [state (.list (` (case (~ maybe) {.#Some (~ g!temp)} (~ g!temp) diff --git a/stdlib/source/library/lux/control/parser/binary.lux b/stdlib/source/library/lux/control/parser/binary.lux index 63ee6d36e..b76df036e 100644 --- a/stdlib/source/library/lux/control/parser/binary.lux +++ b/stdlib/source/library/lux/control/parser/binary.lux @@ -274,7 +274,7 @@ [3 [.#Rev] ..rev] [4 [.#Frac] ..frac] [5 [.#Text] ..text] - [6 [.#Identifier] ..symbol] + [6 [.#Symbol] ..symbol] [7 [.#Form] sequence] [8 [.#Variant] sequence] [9 [.#Tuple] sequence]])))))) diff --git a/stdlib/source/library/lux/control/parser/code.lux b/stdlib/source/library/lux/control/parser/code.lux index c2ee27afd..02c495986 100644 --- a/stdlib/source/library/lux/control/parser/code.lux +++ b/stdlib/source/library/lux/control/parser/code.lux @@ -1,6 +1,6 @@ (.module: [library - [lux {"-" nat int rev local not} + [lux {"-" nat int rev local not symbol} [abstract ["[0]" monad {"+" do}]] [control @@ -81,13 +81,13 @@ _ <failure>))))] - [bit bit! Bit .#Bit bit.equivalence "bit"] - [nat nat! Nat .#Nat nat.equivalence "nat"] - [int int! Int .#Int int.equivalence "int"] - [rev rev! Rev .#Rev rev.equivalence "rev"] - [frac frac! Frac .#Frac frac.equivalence "frac"] - [text text! Text .#Text text.equivalence "text"] - [identifier identifier! Symbol .#Identifier symbol.equivalence "identifier"] + [bit bit! Bit .#Bit bit.equivalence "bit"] + [nat nat! Nat .#Nat nat.equivalence "nat"] + [int int! Int .#Int int.equivalence "int"] + [rev rev! Rev .#Rev rev.equivalence "rev"] + [frac frac! Frac .#Frac frac.equivalence "frac"] + [text text! Text .#Text text.equivalence "text"] + [symbol symbol! Symbol .#Symbol symbol.equivalence "symbol"] ) (def: .public (this! code) @@ -127,7 +127,7 @@ _ <failure>))))] - [local_identifier local_identifier! .#Identifier text.equivalence "local identifier"] + [local_symbol local_symbol! .#Symbol text.equivalence "local symbol"] ) (template [<name> <tag> <desc>] diff --git a/stdlib/source/library/lux/control/parser/json.lux b/stdlib/source/library/lux/control/parser/json.lux index 80b52e147..22487ec8a 100644 --- a/stdlib/source/library/lux/control/parser/json.lux +++ b/stdlib/source/library/lux/control/parser/json.lux @@ -1,6 +1,6 @@ (.module: [library - [lux "*" + [lux {"-" symbol} [abstract ["[0]" monad {"+" do}]] [control diff --git a/stdlib/source/library/lux/control/parser/type.lux b/stdlib/source/library/lux/control/parser/type.lux index 11815338e..85e710ec2 100644 --- a/stdlib/source/library/lux/control/parser/type.lux +++ b/stdlib/source/library/lux/control/parser/type.lux @@ -136,7 +136,7 @@ (def: (label idx) (-> Nat Code) - (code.local_identifier ($_ text#composite "label" text.tab (n#encoded idx)))) + (code.local_symbol ($_ text#composite "label" text.tab (n#encoded idx)))) (def: .public (with_extension type poly) (All (_ a) (-> Type (Parser a) (Parser [Code a]))) diff --git a/stdlib/source/library/lux/control/pipe.lux b/stdlib/source/library/lux/control/pipe.lux index 2929ddc52..2d44a11fb 100644 --- a/stdlib/source/library/lux/control/pipe.lux +++ b/stdlib/source/library/lux/control/pipe.lux @@ -11,7 +11,7 @@ ["[0]" identity] [collection ["[0]" list ("[1]#[0]" monad)]]] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" code]] [math @@ -44,7 +44,7 @@ else body^ _ _reversed_ branches (<>.some (<>.and body^ body^))]) - (with_identifiers [g!temp] + (with_symbols [g!temp] (in (list (` (let [(~ g!temp) (~ prev)] (cond (~+ (do list.monad [[test then] branches] @@ -70,7 +70,7 @@ (syntax: .public (loop> [test body^ then body^ prev <code>.any]) - (with_identifiers [g!temp] + (with_symbols [g!temp] (in (list (` (loop [(~ g!temp) (~ prev)] (if (|> (~ g!temp) (~+ test)) ((~' recur) (|> (~ g!temp) (~+ then))) @@ -79,7 +79,7 @@ (syntax: .public (do> [monad <code>.any steps (<>.some body^) prev <code>.any]) - (with_identifiers [g!temp] + (with_symbols [g!temp] (case (list.reversed steps) (^ (list& last_step prev_steps)) (let [step_bindings (do list.monad @@ -95,14 +95,14 @@ (syntax: .public (exec> [body body^ prev <code>.any]) - (with_identifiers [g!temp] + (with_symbols [g!temp] (in (list (` (let [(~ g!temp) (~ prev)] (exec (|> (~ g!temp) (~+ body)) (~ g!temp)))))))) (syntax: .public (tuple> [paths (<>.many body^) prev <code>.any]) - (with_identifiers [g!temp] + (with_symbols [g!temp] (in (list (` (let [(~ g!temp) (~ prev)] [(~+ (list#each (function (_ body) (` (|> (~ g!temp) (~+ body)))) paths))])))))) diff --git a/stdlib/source/library/lux/control/security/capability.lux b/stdlib/source/library/lux/control/security/capability.lux index f92ae3a75..dd0fb1f35 100644 --- a/stdlib/source/library/lux/control/security/capability.lux +++ b/stdlib/source/library/lux/control/security/capability.lux @@ -43,19 +43,19 @@ (|export|.parser ($_ <>.and |declaration|.parser - (<c>.form ($_ <>.and <c>.local_identifier <c>.any <c>.any))))]) - (macro.with_identifiers [g!_] + (<c>.form ($_ <>.and <c>.local_symbol <c>.any <c>.any))))]) + (macro.with_symbols [g!_] (do [! meta.monad] [this_module meta.current_module_name .let [[name vars] declaration] g!brand (# ! each (|>> %.code code.text) - (macro.identifier (format (%.symbol [this_module name])))) + (macro.symbol (format (%.symbol [this_module name])))) .let [capability (` (..Capability (.Primitive (~ g!brand)) (~ input) (~ output)))]] (in (list (` (type: (~ export_policy) (~ (|declaration|.format declaration)) (~ capability))) - (` (def: (~ (code.local_identifier forger)) - (All ((~ g!_) (~+ (list#each code.local_identifier vars))) + (` (def: (~ (code.local_symbol forger)) + (All ((~ g!_) (~+ (list#each code.local_symbol vars))) (-> (-> (~ input) (~ output)) (~ capability))) (~! ..capability))) diff --git a/stdlib/source/library/lux/control/try.lux b/stdlib/source/library/lux/control/try.lux index fbe4b4e6a..40aa45562 100644 --- a/stdlib/source/library/lux/control/try.lux +++ b/stdlib/source/library/lux/control/try.lux @@ -138,7 +138,7 @@ {..#Success (~' g!temp)} (~' g!temp) - {..#Failure (~ [location.dummy {.#Identifier ["" ""]}])} + {..#Failure (~ [location.dummy {.#Symbol ["" ""]}])} (~ else))))]} _ diff --git a/stdlib/source/library/lux/data/collection/list.lux b/stdlib/source/library/lux/data/collection/list.lux index a0bf40821..b4fb8e4d6 100644 --- a/stdlib/source/library/lux/data/collection/list.lux +++ b/stdlib/source/library/lux/data/collection/list.lux @@ -417,9 +417,9 @@ 0 (list) _ (|> size -- (enum.range n.enum 0)))) -(def: (identifier$ name) +(def: (symbol$ name) (-> Text Code) - [["" 0 0] {.#Identifier "" name}]) + [["" 0 0] {.#Symbol "" name}]) (def: (nat#encoded value) (-> Nat Text) @@ -449,8 +449,8 @@ (if (n.> 0 num_lists) (let [(^open "[0]") ..functor indices (..indices num_lists) - type_vars (: (List Code) (each (|>> nat#encoded identifier$) indices)) - zipped_type (` (.All ((~ (identifier$ "0_")) (~+ type_vars)) + type_vars (: (List Code) (each (|>> nat#encoded symbol$) indices)) + zipped_type (` (.All ((~ (symbol$ "0_")) (~+ type_vars)) (-> (~+ (each (: (-> Code Code) (function (_ var) (` (List (~ var))))) type_vars)) (List [(~+ type_vars)])))) @@ -458,12 +458,12 @@ (each ++) (each (function (_ idx) (let [base (nat#encoded idx)] - [(identifier$ base) - (identifier$ ("lux text concat" base "'"))])))) + [(symbol$ base) + (symbol$ ("lux text concat" base "'"))])))) pattern (` [(~+ (each (function (_ [v vs]) (` {.#Item (~ v) (~ vs)})) vars+lists))]) - g!step (identifier$ "0step0") - g!blank (identifier$ "0,0") + g!step (symbol$ "0step0") + g!blank (symbol$ "0,0") list_vars (each product.right vars+lists) code (` (: (~ zipped_type) (function ((~ g!step) (~+ list_vars)) @@ -489,10 +489,10 @@ (if (n.> 0 num_lists) (let [(^open "[0]") ..functor indices (..indices num_lists) - g!return_type (identifier$ "0return_type0") - g!func (identifier$ "0func0") - type_vars (: (List Code) (each (|>> nat#encoded identifier$) indices)) - zipped_type (` (All ((~ (identifier$ "0_")) (~+ type_vars) (~ g!return_type)) + g!return_type (symbol$ "0return_type0") + g!func (symbol$ "0func0") + type_vars (: (List Code) (each (|>> nat#encoded symbol$) indices)) + zipped_type (` (All ((~ (symbol$ "0_")) (~+ type_vars) (~ g!return_type)) (-> (-> (~+ type_vars) (~ g!return_type)) (~+ (each (: (-> Code Code) (function (_ var) (` (List (~ var))))) type_vars)) @@ -501,12 +501,12 @@ (each ++) (each (function (_ idx) (let [base (nat#encoded idx)] - [(identifier$ base) - (identifier$ ("lux text concat" base "'"))])))) + [(symbol$ base) + (symbol$ ("lux text concat" base "'"))])))) pattern (` [(~+ (each (function (_ [v vs]) (` {.#Item (~ v) (~ vs)})) vars+lists))]) - g!step (identifier$ "0step0") - g!blank (identifier$ "0,0") + g!step (symbol$ "0step0") + g!blank (symbol$ "0,0") list_vars (each product.right vars+lists) code (` (: (~ zipped_type) (function ((~ g!step) (~ g!func) (~+ list_vars)) diff --git a/stdlib/source/library/lux/data/collection/sequence.lux b/stdlib/source/library/lux/data/collection/sequence.lux index d9724358a..fbd998ae2 100644 --- a/stdlib/source/library/lux/data/collection/sequence.lux +++ b/stdlib/source/library/lux/data/collection/sequence.lux @@ -8,7 +8,7 @@ ["//" continuation {"+" Cont}] ["<>" parser ["<[0]>" code {"+" Parser}]]] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" code]] [data @@ -130,7 +130,7 @@ (syntax: .public (^sequence& [patterns (<code>.form (<>.many <code>.any)) body <code>.any branches (<>.some <code>.any)]) - (with_identifiers [g!sequence] + (with_symbols [g!sequence] (let [body+ (` (let [(~+ (|> patterns (list#each (function (_ pattern) (list (` [(~ pattern) (~ g!sequence)]) diff --git a/stdlib/source/library/lux/data/format/binary.lux b/stdlib/source/library/lux/data/format/binary.lux index ec07e1002..94fdea2bc 100644 --- a/stdlib/source/library/lux/data/format/binary.lux +++ b/stdlib/source/library/lux/data/format/binary.lux @@ -283,7 +283,7 @@ [3 .#Rev ..rev] [4 .#Frac ..frac] [5 .#Text ..text] - [6 .#Identifier ..symbol] + [6 .#Symbol ..symbol] [7 .#Form sequence] [8 .#Variant sequence] [9 .#Tuple sequence]) diff --git a/stdlib/source/library/lux/data/format/css/property.lux b/stdlib/source/library/lux/data/format/css/property.lux index a2c5a6d50..ede7ae19a 100644 --- a/stdlib/source/library/lux/data/format/css/property.lux +++ b/stdlib/source/library/lux/data/format/css/property.lux @@ -52,8 +52,8 @@ White_Space Word_Break Word_Wrap Writing_Mode Z_Index}]]) -(syntax: (text_identifier [identifier s.text]) - (in (list (code.local_identifier (text.replaced "-" "_" identifier))))) +(syntax: (text_symbol [symbol s.text]) + (in (list (code.local_symbol (text.replaced "-" "_" symbol))))) (abstract: .public (Property brand) Text @@ -72,7 +72,7 @@ (with_expansions [<rows> (template.spliced <property>+)] (template [<property>] - [(`` (def: .public (~~ (text_identifier <property>)) + [(`` (def: .public (~~ (text_symbol <property>)) (Property <brand>) (:abstraction <property>)))] diff --git a/stdlib/source/library/lux/data/format/css/query.lux b/stdlib/source/library/lux/data/format/css/query.lux index 2af4d0f68..1dfc31505 100644 --- a/stdlib/source/library/lux/data/format/css/query.lux +++ b/stdlib/source/library/lux/data/format/css/query.lux @@ -21,8 +21,8 @@ Pointer Hover Light Scripting Motion Color_Scheme}]]) -(syntax: (text_identifier [identifier s.text]) - (in (list (code.local_identifier (text.replaced "-" "_" identifier))))) +(syntax: (text_symbol [symbol s.text]) + (in (list (code.local_symbol (text.replaced "-" "_" symbol))))) (abstract: .public Media Text @@ -32,7 +32,7 @@ (|>> :representation)) (template [<media>] - [(`` (def: .public (~~ (text_identifier <media>)) + [(`` (def: .public (~~ (text_symbol <media>)) Media (:abstraction <media>)))] @@ -50,7 +50,7 @@ (|>> :representation)) (template [<feature> <brand>] - [(`` (def: .public ((~~ (text_identifier <feature>)) input) + [(`` (def: .public ((~~ (text_symbol <feature>)) input) (-> (Value <brand>) Feature) (:abstraction (format "(" <feature> ": " (//value.value input) ")"))))] diff --git a/stdlib/source/library/lux/data/format/css/value.lux b/stdlib/source/library/lux/data/format/css/value.lux index b57294ade..1ede42fd9 100644 --- a/stdlib/source/library/lux/data/format/css/value.lux +++ b/stdlib/source/library/lux/data/format/css/value.lux @@ -28,8 +28,8 @@ [// [selector {"+" Label}]]) -(syntax: (text_identifier [identifier s.text]) - (in (list (code.local_identifier (text.replaced "-" "_" identifier))))) +(syntax: (text_symbol [symbol s.text]) + (in (list (code.local_symbol (text.replaced "-" "_" symbol))))) (template: (enumeration: <abstraction> <representation> <out> <sample>+ <definition>+) (abstract: .public <abstraction> @@ -88,7 +88,7 @@ (with_expansions [<rows> (template.spliced <value>+)] (template [<value>] - [(`` (def: .public (~~ (..text_identifier <value>)) + [(`` (def: .public (~~ (..text_symbol <value>)) (Value <brand>) (:abstraction <value>)))] diff --git a/stdlib/source/library/lux/data/format/xml.lux b/stdlib/source/library/lux/data/format/xml.lux index 1db81f6d7..ec9516eb5 100644 --- a/stdlib/source/library/lux/data/format/xml.lux +++ b/stdlib/source/library/lux/data/format/xml.lux @@ -1,6 +1,6 @@ (.module: [library - [lux "*" + [lux {"-" symbol} [abstract [monad {"+" do}] [equivalence {"+" Equivalence}] diff --git a/stdlib/source/library/lux/data/text/regex.lux b/stdlib/source/library/lux/data/text/regex.lux index 7a67e2a28..a32d21eb5 100644 --- a/stdlib/source/library/lux/data/text/regex.lux +++ b/stdlib/source/library/lux/data/text/regex.lux @@ -15,7 +15,7 @@ ["[0]" product] [collection ["[0]" list ("[1]#[0]" mix monad)]]] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" code]] [math @@ -80,7 +80,7 @@ (-> Text (Parser Code)) (do <>.monad [symbol (<text>.enclosed ["\@<" ">"] (symbol^ current_module))] - (in (` (: ((~! <text>.Parser) Text) (~ (code.identifier symbol))))))) + (in (` (: ((~! <text>.Parser) Text) (~ (code.symbol symbol))))))) (def: re_range^ (Parser Code) @@ -196,12 +196,12 @@ (<>.either (do <>.monad [_ (<text>.this "\") id number^] - (in (` ((~! ..copy) (~ (code.identifier ["" (n#encoded id)])))))) + (in (` ((~! ..copy) (~ (code.symbol ["" (n#encoded id)])))))) (do <>.monad [_ (<text>.this "\k<") captured_symbol symbol_part^ _ (<text>.this ">")] - (in (` ((~! ..copy) (~ (code.identifier ["" captured_symbol])))))))) + (in (` ((~! ..copy) (~ (code.symbol ["" captured_symbol])))))))) (def: (re_simple^ current_module) (-> Text (Parser Code)) @@ -283,8 +283,8 @@ (do <>.monad [parts (<>.many (<>.or (re_complex^ current_module) (re_scoped^ current_module))) - .let [g!total (code.identifier ["" "0total"]) - g!temp (code.identifier ["" "0temp"]) + .let [g!total (code.symbol ["" "0total"]) + g!temp (code.symbol ["" "0temp"]) [_ names steps] (list#mix (: (-> (Either Code [Re_Group Code]) [Nat (List Code) (List (List Code))] [Nat (List Code) (List (List Code))]) @@ -301,10 +301,10 @@ {.#Right [{#Capturing [?name num_captures]} scoped]} (let [[idx! name!] (case ?name {.#Some _name} - [idx (code.identifier ["" _name])] + [idx (code.symbol ["" _name])] {.#None} - [(++ idx) (code.identifier ["" (n#encoded idx)])]) + [(++ idx) (code.symbol ["" (n#encoded idx)])]) access (if (n.> 0 num_captures) (` ((~! product.left) (~ name!))) name!)] @@ -428,7 +428,7 @@ (syntax: .public (^regex [[pattern bindings] (<code>.form (<>.and <code>.text (<>.maybe <code>.any))) body <code>.any branches (<>.many <code>.any)]) - (with_identifiers [g!temp] + (with_symbols [g!temp] (in (list& (` (^multi (~ g!temp) [((~! <text>.result) (..regex (~ (code.text pattern))) (~ g!temp)) {try.#Success (~ (maybe.else g!temp bindings))}])) diff --git a/stdlib/source/library/lux/debug.lux b/stdlib/source/library/lux/debug.lux index 5a35e3c62..ed076d3ae 100644 --- a/stdlib/source/library/lux/debug.lux +++ b/stdlib/source/library/lux/debug.lux @@ -518,11 +518,11 @@ {try.#Failure _} (exception.except ..cannot_represent_value type))) -(syntax: .public (private [definition <code>.identifier]) +(syntax: .public (private [definition <code>.symbol]) (let [[module _] definition] (in (list (` ("lux in-module" (~ (code.text module)) - (~ (code.identifier definition)))))))) + (~ (code.symbol definition)))))))) (def: .public (log! message) (-> Text Any) @@ -545,9 +545,9 @@ (def: target (<code>.Parser Target) - (<>.either (<>.and <code>.local_identifier + (<>.either (<>.and <code>.local_symbol (# <>.monad in {.#None})) - (<code>.tuple (<>.and <code>.local_identifier + (<code>.tuple (<>.and <code>.local_symbol (# <>.monad each (|>> {.#Some}) <code>.any))))) (exception: .public (unknown_local_binding [name Text]) @@ -592,5 +592,5 @@ {.#Some format} format)] (` [(~ (code.text name)) - ((~ format) (~ (code.local_identifier name)))]))) + ((~ format) (~ (code.local_symbol name)))]))) targets)))))))))) diff --git a/stdlib/source/library/lux/documentation.lux b/stdlib/source/library/lux/documentation.lux index e37df17e9..5bd6f7f30 100644 --- a/stdlib/source/library/lux/documentation.lux +++ b/stdlib/source/library/lux/documentation.lux @@ -59,7 +59,7 @@ [.#Rev] [.#Frac] [.#Text] - [.#Identifier]) + [.#Symbol]) (^template [<tag>] [[[_ _ column] {<tag> members}] @@ -87,7 +87,7 @@ (def: (code_documentation expected_module old_location reference_column example) (-> Text Location Nat Code [Location Text]) (case example - [new_location {.#Identifier [module short]}] + [new_location {.#Symbol [module short]}] (let [documentation (cond (text#= expected_module module) short @@ -449,17 +449,17 @@ (<>.or (<code>.text! "") <code>.any)) -(exception: .public (unqualified_identifier [name Symbol]) +(exception: .public (unqualified_symbol [name Symbol]) (exception.report ["Name" (%.symbol name)])) -(def: qualified_identifier +(def: qualified_symbol (Parser Symbol) (do <>.monad - [name <code>.identifier] + [name <code>.symbol] (case name ["" _] - (<>.failure (exception.error ..unqualified_identifier [name])) + (<>.failure (exception.error ..unqualified_symbol [name])) _ (in name)))) @@ -493,9 +493,9 @@ (def: declaration (Parser Declaration) - (<>.either (<>.and ..qualified_identifier (<>#in (list))) - (<code>.form (<>.and ..qualified_identifier - (<>.some (<code>.local_identifier)))))) + (<>.either (<>.and ..qualified_symbol (<>#in (list))) + (<code>.form (<>.and ..qualified_symbol + (<>.some (<code>.local_symbol)))))) (syntax: (minimal_definition_documentation [[name parameters] ..declaration]) @@ -504,24 +504,24 @@ [[_ def_type def_value]] (meta.export name) tags (meta.tags_of name)] (with_expansions [<\n> (~! text.\n)] - (macro.with_identifiers [g!type] + (macro.with_symbols [g!type] (in (list (` ($_ ((~! md.then)) ... Name (<| ((~! md.heading/3)) - (~ (code.text (%.code (let [g!name (|> name product.right code.local_identifier)] + (~ (code.text (%.code (let [g!name (|> name product.right code.local_symbol)] (case parameters {.#End} g!name _ - (` ((~ g!name) (~+ (list#each code.local_identifier parameters)))))))))) + (` ((~ g!name) (~+ (list#each code.local_symbol parameters)))))))))) ... Type (let [(~ g!type) ("lux in-module" (~ g!module) - (.:of (~ (code.identifier name))))] + (.:of (~ (code.symbol name))))] ((~! md.code) "clojure" (~ (if (type#= .Type def_type) - (` (|> (~ (code.identifier name)) + (` (|> (~ (code.symbol name)) (:as .Type) ((~! type.anonymous)) ((~! ..type_definition) @@ -543,8 +543,8 @@ (with_expansions [<\n> (~! text.\n)] (in (list (` ($_ ((~! md.then)) ((~! ..minimal_definition_documentation) - ((~ (code.identifier name)) - (~+ (list#each code.local_identifier parameters)))) + ((~ (code.symbol name)) + (~+ (list#each code.local_symbol parameters)))) ... Description (~+ (case description {.#Some description} @@ -584,18 +584,18 @@ (in (list (` (: (.List ..Definition) (list [..#definition (~ (code.text short)) ..#documentation ((~! ..minimal_definition_documentation) - ((~ (code.identifier name)) - (~+ (list#each code.local_identifier parameters))))]))))))) + ((~ (code.symbol name)) + (~+ (list#each code.local_symbol parameters))))]))))))) (syntax: .public (documentation: [[name parameters] ..declaration extra (<>.some <code>.any)]) (let [[_ short] name] - (in (list (` (.def: .public (~ (code.local_identifier short)) + (in (list (` (.def: .public (~ (code.local_symbol short)) (.List ..Definition) (.list [..#definition (~ (code.text short)) ..#documentation ((~! ..definition_documentation) - ((~ (code.identifier name)) - (~+ (list#each code.local_identifier parameters))) + ((~ (code.symbol name)) + (~+ (list#each code.local_symbol parameters))) (~+ extra))]))))))) (def: definitions_documentation @@ -623,7 +623,7 @@ (|>> (text.all_split_by ..expected_separator) (set.of_list text.hash))) -(syntax: .public (module [[name _] ..qualified_identifier +(syntax: .public (module [[name _] ..qualified_symbol description <code>.any definitions (<code>.tuple (<>.some <code>.any)) subs (<code>.tuple (<>.some <code>.any))]) diff --git a/stdlib/source/library/lux/extension.lux b/stdlib/source/library/lux/extension.lux index 87812cb08..91c86641e 100644 --- a/stdlib/source/library/lux/extension.lux +++ b/stdlib/source/library/lux/extension.lux @@ -12,7 +12,7 @@ ["[0]" product] [collection ["[0]" list ("[1]#[0]" functor)]]] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} ["[0]" code] [syntax {"+" syntax:}]] [tool @@ -31,18 +31,18 @@ (-> Code (Parser Declaration)) (<c>.form ($_ <>.and <c>.any - <c>.local_identifier - <c>.local_identifier - <c>.local_identifier + <c>.local_symbol + <c>.local_symbol + <c>.local_symbol (<c>.tuple (<>.some <c>.any))))) (template [<any> <end> <and> <result> <extension> <name>] [(syntax: .public (<name> [[name extension phase archive inputs] (..declaration (` <any>)) body <c>.any]) - (let [g!name (code.local_identifier extension) - g!phase (code.local_identifier phase) - g!archive (code.local_identifier archive)] - (with_identifiers [g!handler g!inputs g!error g!_] + (let [g!name (code.local_symbol extension) + g!phase (code.local_symbol phase) + g!archive (code.local_symbol archive)] + (with_symbols [g!handler g!inputs g!error g!_] (in (list (` (<extension> (~ name) (.function ((~ g!handler) (~ g!name) (~ g!phase) (~ g!archive) (~ g!inputs)) (.case ((~! <result>) diff --git a/stdlib/source/library/lux/ffi.js.lux b/stdlib/source/library/lux/ffi.js.lux index b6bffd6ad..03a98b0cd 100644 --- a/stdlib/source/library/lux/ffi.js.lux +++ b/stdlib/source/library/lux/ffi.js.lux @@ -17,7 +17,7 @@ ["[0]" list ("[1]#[0]" functor)]]] [type abstract] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" code] ["[0]" template]]]]) @@ -25,7 +25,7 @@ (abstract: .public (Object brand) Any) (template [<name>] - [(with_expansions [<brand> (template.identifier [<name> "'"])] + [(with_expansions [<brand> (template.symbol [<name> "'"])] (abstract: <brand> Any @@ -76,7 +76,7 @@ (Parser Field) (<code>.form ($_ <>.and (<>.parses? ..static!) - <code>.local_identifier + <code>.local_symbol ..nullable))) (type: Common_Method @@ -99,8 +99,8 @@ (def: common_method (Parser Common_Method) ($_ <>.and - <code>.local_identifier - (<>.maybe (<>.after (<code>.this! (' "as")) <code>.local_identifier)) + <code>.local_symbol + (<>.maybe (<>.after (<code>.this! (' "as")) <code>.local_symbol)) (<code>.tuple (<>.some ..nullable)) (<>.parses? (<code>.this! (' "io"))) (<>.parses? (<code>.this! (' "try"))) @@ -132,7 +132,7 @@ (-> (List Nullable) (List [Bit Code])) (|>> list.enumeration (list#each (function (_ [idx [nullable? type]]) - [nullable? (|> idx %.nat code.local_identifier)])))) + [nullable? (|> idx %.nat code.local_symbol)])))) (def: (nullable_type [nullable? type]) (-> Nullable Code) @@ -181,10 +181,10 @@ (def: class_declaration (Parser Class_Declaration) - (<>.either (<>.and <code>.local_identifier + (<>.either (<>.and <code>.local_symbol (<>#in (list))) - (<code>.form (<>.and <code>.local_identifier - (<>.some <code>.local_identifier))))) + (<code>.form (<>.and <code>.local_symbol + (<>.some <code>.local_symbol))))) (def: import (Parser Import) @@ -236,18 +236,18 @@ (~+ (list#each (with_null g!temp) g!inputs))))))))))) (syntax: .public (import: [import ..import]) - (with_identifiers [g!temp g!_] + (with_symbols [g!temp g!_] (case import {#Class [[class_name class_parameters] format members]} - (with_identifiers [g!object] + (with_symbols [g!object] (let [qualify (: (-> Text Code) (function (_ member_name) (|> format (text.replaced "[1]" class_name) (text.replaced "." member_name) - code.local_identifier))) - class_parameters (list#each code.local_identifier class_parameters) - declaration (` ((~ (code.local_identifier class_name)) + code.local_symbol))) + class_parameters (list#each code.local_symbol class_parameters) + declaration (` ((~ (code.local_symbol class_name)) (~+ class_parameters))) real_class (text.replaced "/" "." class_name)] (in (list& (` (type: (~ declaration) @@ -313,7 +313,7 @@ members))))) {#Function [name alias inputsT io? try? outputT]} - (in (list (..make_function (code.local_identifier (maybe.else name alias)) + (in (list (..make_function (code.local_symbol (maybe.else name alias)) g!temp name inputsT @@ -326,8 +326,8 @@ [("js type-of" object)]) (syntax: .public (constant [type <code>.any - [head tail] (<code>.tuple (<>.and <code>.local_identifier (<>.some <code>.local_identifier)))]) - (with_identifiers [g!_] + [head tail] (<code>.tuple (<>.and <code>.local_symbol (<>.some <code>.local_symbol)))]) + (with_symbols [g!_] (let [constant (` ("js constant" (~ (code.text head))))] (case tail {.#End} @@ -347,8 +347,8 @@ {.#None} (~ g!_) - (..constant (~ type) [(~ (code.local_identifier (%.format head "." next))) - (~+ (list#each code.local_identifier tail))]))))))))))) + (..constant (~ type) [(~ (code.local_symbol (%.format head "." next))) + (~+ (list#each code.local_symbol tail))]))))))))))) (template: (!defined? <constant>) [(.case (..constant Any <constant>) diff --git a/stdlib/source/library/lux/ffi.jvm.lux b/stdlib/source/library/lux/ffi.jvm.lux index f739e2ff2..7e8a46ce3 100644 --- a/stdlib/source/library/lux/ffi.jvm.lux +++ b/stdlib/source/library/lux/ffi.jvm.lux @@ -21,7 +21,7 @@ ["[0]" array] ["[0]" list ("[1]#[0]" monad mix monoid)] ["[0]" dictionary {"+" Dictionary}]]] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" code] ["[0]" template]] @@ -367,7 +367,7 @@ {.#None})] - [parser.var? name (code.identifier ["" name])] + [parser.var? name (code.symbol ["" name])] [parser.wildcard? _ (` .Any)] [parser.lower? _ (` .Any)] [parser.upper? limit (parameter_type limit)] @@ -407,27 +407,27 @@ (-> Text Text (Parser Code)) (do <>.monad [.let [dotted_name (format "::" field_name)] - _ (<code>.this! (code.identifier ["" dotted_name]))] + _ (<code>.this! (code.symbol ["" dotted_name]))] (in (get_static_field class_name field_name)))) (def: (get_var_parser class_name field_name self_name) (-> Text Text Text (Parser Code)) (do <>.monad [.let [dotted_name (format "::" field_name)] - _ (<code>.this! (code.identifier ["" dotted_name]))] - (in (get_virtual_field class_name field_name (code.local_identifier self_name))))) + _ (<code>.this! (code.symbol ["" dotted_name]))] + (in (get_virtual_field class_name field_name (code.local_symbol self_name))))) (def: (put_var_parser class_name field_name self_name) (-> Text Text Text (Parser Code)) (do <>.monad [.let [dotted_name (format "::" field_name)] [_ _ value] (: (Parser [Any Any Code]) - (<code>.form ($_ <>.and (<code>.this! (' :=)) (<code>.this! (code.identifier ["" dotted_name])) <code>.any)))] + (<code>.form ($_ <>.and (<code>.this! (' :=)) (<code>.this! (code.symbol ["" dotted_name])) <code>.any)))] (in (`' ("jvm member put virtual" (~ (code.text class_name)) (~ (code.text field_name)) (~ value) - (~ (code.local_identifier self_name))))))) + (~ (code.local_symbol self_name))))))) (def: (replaced f input) (-> (-> Code Code) Code Code) @@ -482,7 +482,7 @@ (do <>.monad [.let [dotted_name (format "::" method_name "!")] args (: (Parser (List Code)) - (<code>.form (<>.after (<code>.this! (code.identifier ["" dotted_name])) + (<code>.form (<>.after (<code>.this! (code.symbol ["" dotted_name])) (<code>.tuple (<>.exactly (list.size arguments) <code>.any)))))] (in (` ("jvm member invoke static" (~ (code.text class_name)) (~ (code.text method_name)) (~+ (|> args @@ -495,10 +495,10 @@ (do <>.monad [.let [dotted_name (format "::" method_name "!")] args (: (Parser (List Code)) - (<code>.form (<>.after (<code>.this! (code.identifier ["" dotted_name])) + (<code>.form (<>.after (<code>.this! (code.symbol ["" dotted_name])) (<code>.tuple (<>.exactly (list.size arguments) <code>.any)))))] (in (` (<jvm_op> (~ (code.text class_name)) (~ (code.text method_name)) - (~ (code.local_identifier self_name)) + (~ (code.local_symbol self_name)) (~+ (|> args (list.zipped/2 (list#each product.right arguments)) (list#each ..decorate_input))))))))] @@ -563,7 +563,7 @@ (def: (valid_class_name type_vars) (-> (List (Type Var)) (Parser External)) (do <>.monad - [name <code>.local_identifier + [name <code>.local_symbol _ (..assertion ..class_names_cannot_contain_periods [name] (not (text.contains? name.external_separator name))) _ (..assertion ..class_name_cannot_be_a_type_variable [name type_vars] @@ -592,7 +592,7 @@ (def: (variable^ type_vars) (-> (List (Type Var)) (Parser (Type Parameter))) (do <>.monad - [name <code>.local_identifier + [name <code>.local_symbol _ (..assertion ..unexpected_type_variable [name type_vars] (list.member? text.equivalence (list#each parser.name type_vars) name))] (in (type.var name)))) @@ -633,7 +633,7 @@ (-> (Type (<| Return' Value' category)) (Parser (Type (<| Return' Value' category))))) (do <>.monad - [_ (<code>.identifier! ["" (..reflection type)])] + [_ (<code>.symbol! ["" (..reflection type)])] (in type))) (def: primitive^ @@ -667,7 +667,7 @@ (def: void^ (Parser (Type Void)) (do <>.monad - [_ (<code>.identifier! ["" (reflection.reflection reflection.void)])] + [_ (<code>.symbol! ["" (reflection.reflection reflection.void)])] (in type.void))) (def: (return^ type_vars) @@ -677,7 +677,7 @@ (def: var^ (Parser (Type Var)) - (# <>.monad each type.var <code>.local_identifier)) + (# <>.monad each type.var <code>.local_symbol)) (def: vars^ (Parser (List (Type Var))) @@ -705,9 +705,9 @@ (def: annotation^ (Parser Annotation) (<>.either (do <>.monad - [ann_name <code>.local_identifier] + [ann_name <code>.local_symbol] (in [ann_name (list)])) - (<code>.form (<>.and <code>.local_identifier + (<code>.form (<>.and <code>.local_symbol annotation_parameters^)))) (def: annotations^ @@ -729,7 +729,7 @@ (<code>.form (do <>.monad [tvars (<>.else (list) ..vars^) .let [total_vars (list#composite tvars type_vars)] - name <code>.local_identifier + name <code>.local_symbol anns ..annotations^ inputs (<code>.tuple (<>.some (..type^ total_vars))) output (..return^ total_vars) @@ -750,7 +750,7 @@ (-> (List (Type Var)) (Parser [Member_Declaration FieldDecl])) (<>.either (<code>.form (do <>.monad [_ (<code>.this! (' "const")) - name <code>.local_identifier + name <code>.local_symbol anns ..annotations^ type (..type^ type_vars) body <code>.any] @@ -758,14 +758,14 @@ (<code>.form (do <>.monad [pm privacy_modifier^ sm state_modifier^ - name <code>.local_identifier + name <code>.local_symbol anns ..annotations^ type (..type^ type_vars)] (in [[name pm anns] {#VariableField [sm type]}]))))) (def: (argument^ type_vars) (-> (List (Type Var)) (Parser Argument)) - (<>.and <code>.local_identifier + (<>.and <code>.local_symbol (..type^ type_vars))) (def: (arguments^ type_vars) @@ -789,7 +789,7 @@ .let [total_vars (list#composite class_vars method_vars)] [_ self_name arguments] (<code>.form ($_ <>.and (<code>.this! (' new)) - <code>.local_identifier + <code>.local_symbol (..arguments^ total_vars))) constructor_args (..constructor_args^ total_vars) exs (throws_decl^ total_vars) @@ -809,8 +809,8 @@ method_vars (<>.else (list) ..vars^) .let [total_vars (list#composite class_vars method_vars)] [name self_name arguments] (<code>.form ($_ <>.and - <code>.local_identifier - <code>.local_identifier + <code>.local_symbol + <code>.local_symbol (..arguments^ total_vars))) return_type (..return^ total_vars) exs (throws_decl^ total_vars) @@ -830,8 +830,8 @@ .let [total_vars (list#composite (product.right (parser.declaration owner_class)) method_vars)] [name self_name arguments] (<code>.form ($_ <>.and - <code>.local_identifier - <code>.local_identifier + <code>.local_symbol + <code>.local_symbol (..arguments^ total_vars))) return_type (..return^ total_vars) exs (throws_decl^ total_vars) @@ -850,7 +850,7 @@ _ (<code>.this! (' "static")) method_vars (<>.else (list) ..vars^) .let [total_vars method_vars] - [name arguments] (<code>.form (<>.and <code>.local_identifier + [name arguments] (<code>.form (<>.and <code>.local_symbol (..arguments^ total_vars))) return_type (..return^ total_vars) exs (throws_decl^ total_vars) @@ -868,7 +868,7 @@ _ (<code>.this! (' "abstract")) method_vars (<>.else (list) ..vars^) .let [total_vars method_vars] - [name arguments] (<code>.form (<>.and <code>.local_identifier + [name arguments] (<code>.form (<>.and <code>.local_symbol (..arguments^ total_vars))) return_type (..return^ total_vars) exs (throws_decl^ total_vars) @@ -885,7 +885,7 @@ _ (<code>.this! (' "native")) method_vars (<>.else (list) ..vars^) .let [total_vars method_vars] - [name arguments] (<code>.form (<>.and <code>.local_identifier + [name arguments] (<code>.form (<>.and <code>.local_symbol (..arguments^ total_vars))) return_type (..return^ total_vars) exs (throws_decl^ total_vars) @@ -907,13 +907,13 @@ (def: partial_call^ (Parser Partial_Call) - (<code>.form (<>.and <code>.identifier (<>.some <code>.any)))) + (<code>.form (<>.and <code>.symbol (<>.some <code>.any)))) (def: import_member_alias^ (Parser (Maybe Text)) (<>.maybe (do <>.monad [_ (<code>.this! (' "as"))] - <code>.local_identifier))) + <code>.local_symbol))) (def: (import_member_args^ type_vars) (-> (List (Type Var)) (Parser (List [Bit (Type Value)]))) @@ -937,11 +937,11 @@ ($_ <>.either (<code>.form (do <>.monad [_ (<code>.this! (' "enum")) - enum_members (<>.some <code>.local_identifier)] + enum_members (<>.some <code>.local_symbol)] (in {#EnumDecl enum_members}))) (<code>.form (do <>.monad [tvars (<>.else (list) ..vars^) - _ (<code>.identifier! ["" "new"]) + _ (<code>.symbol! ["" "new"]) ?alias import_member_alias^ .let [total_vars (list#composite owner_vars tvars)] ?prim_mode (<>.maybe primitive_mode^) @@ -962,7 +962,7 @@ (<>.or (<code>.this! (' "static")) (in []))) tvars (<>.else (list) ..vars^) - name <code>.local_identifier + name <code>.local_symbol ?alias import_member_alias^ .let [total_vars (list#composite owner_vars tvars)] ?prim_mode (<>.maybe primitive_mode^) @@ -981,7 +981,7 @@ #import_method_return return]]}))) (<code>.form (do <>.monad [static? (<>.parses? (<code>.this! (' "static"))) - name <code>.local_identifier + name <code>.local_symbol ?prim_mode (<>.maybe primitive_mode^) gtype (..type^ owner_vars) maybe? (<>.parses? (<code>.this! (' "?"))) @@ -1039,7 +1039,7 @@ (def: var$' (-> (Type Var) Code) - (|>> ..signature code.local_identifier)) + (|>> ..signature code.local_symbol)) (def: (method_decl$ [[name pm anns] method_decl]) (-> [Member_Declaration MethodDecl] Code) @@ -1131,7 +1131,7 @@ (in (` ("jvm member invoke special" (~ (code.text (product.left (parser.read_class super_class)))) (~ (code.text name)) - (~ (code.local_identifier self_name)) + (~ (code.local_symbol self_name)) (~+ (|> args (list.zipped/2 (list#each product.right arguments)) (list#each ..decorate_input)))))))))] @@ -1186,7 +1186,7 @@ (def: (complete_call$ g!obj [method args]) (-> Code Partial_Call Code) - (` ((~ (code.identifier method)) (~+ args) (~ g!obj)))) + (` ((~ (code.symbol method)) (~+ args) (~ g!obj)))) (def: $Object (Type Class) @@ -1251,14 +1251,14 @@ ("jvm object null?" obj)) (syntax: .public (??? [expr <code>.any]) - (with_identifiers [g!temp] + (with_symbols [g!temp] (in (list (` (let [(~ g!temp) (~ expr)] (if ("jvm object null?" (~ g!temp)) {.#None} {.#Some (~ g!temp)}))))))) (syntax: .public (!!! [expr <code>.any]) - (with_identifiers [g!value] + (with_symbols [g!value] (in (list (` (.case (~ expr) {.#Some (~ g!value)} (~ g!value) @@ -1268,7 +1268,7 @@ (syntax: .public (check [class (..type^ (list)) unchecked (<>.maybe <code>.any)]) - (with_identifiers [g!_ g!unchecked] + (with_symbols [g!_ g!unchecked] (let [class_name (..reflection class) class_type (` (.Primitive (~ (code.text class_name)))) check_type (` (.Maybe (~ class_type))) @@ -1294,7 +1294,7 @@ (syntax: .public (do_to [obj <code>.any methods (<>.some partial_call^)]) - (with_identifiers [g!obj] + (with_symbols [g!obj] (in (list (` (let [(~ g!obj) (~ obj)] (exec (~+ (list#each (complete_call$ g!obj) methods)) (~ g!obj)))))))) @@ -1305,7 +1305,7 @@ def_name (..internal full_name) params' (list#each ..var$' params)] (template.with_locals [g!_] - (` (def: (~ (code.identifier ["" def_name])) + (` (def: (~ (code.symbol ["" def_name])) .Type (All ((~ (' g!_)) (~+ params')) (.Primitive (~ (code.text full_name)) @@ -1337,7 +1337,7 @@ [arg_inputs (monad.each ! (: (-> [Bit (Type Value)] (Meta [Bit Code])) (function (_ [maybe? _]) - (with_identifiers [arg_name] + (with_symbols [arg_name] (in [maybe? arg_name])))) #import_member_args) .let [input_jvm_types (list#each product.right #import_member_args) @@ -1365,7 +1365,7 @@ (` (??? (~ return_term))) ... else - (let [g!temp (` ((~' ~') (~ (code.identifier ["" " Ω "]))))] + (let [g!temp (` ((~' ~') (~ (code.symbol ["" " Ω "]))))] (` (let [(~ g!temp) (~ return_term)] (if (not (..null? (.:as (.Primitive "java.lang.Object") (~ g!temp)))) @@ -1491,7 +1491,7 @@ (let [[full_name class_tvars] (parser.declaration class)] (case member {#EnumDecl enum_members} - (with_identifiers [g!_] + (with_symbols [g!_] (do meta.monad [.let [enum_type (: Code (case class_tvars @@ -1504,7 +1504,7 @@ (.Primitive (~ (code.text full_name)) [(~+ =class_tvars)])))))) getter_interop (: (-> Text Code) (function (_ name) - (let [getter_name (code.identifier ["" (..import_name import_format method_prefix name)])] + (let [getter_name (code.symbol ["" (..import_name import_format method_prefix name)])] (` (def: (~ getter_name) (~ enum_type) (~ (get_static_field full_name name)))))))]] @@ -1513,7 +1513,7 @@ {#ConstructorDecl [commons _]} (do meta.monad [.let [classT (type.class full_name (list)) - def_name (code.identifier ["" (..import_name import_format method_prefix (value@ #import_member_alias commons))]) + def_name (code.symbol ["" (..import_name import_format method_prefix (value@ #import_member_alias commons))]) jvm_interop (|> [classT (` ("jvm member invoke constructor" [(~+ (list#each ..var$ class_tvars))] @@ -1530,9 +1530,9 @@ ((~' in) (.list (.` (~ jvm_interop))))))))) {#MethodDecl [commons method]} - (with_identifiers [g!obj] + (with_symbols [g!obj] (do meta.monad - [.let [def_name (code.identifier ["" (..import_name import_format method_prefix (value@ #import_member_alias commons))]) + [.let [def_name (code.symbol ["" (..import_name import_format method_prefix (value@ #import_member_alias commons))]) (^open "[0]") commons (^open "[0]") method [jvm_op object_ast] (: [Text (List Code)] @@ -1587,9 +1587,9 @@ {#FieldAccessDecl fad} (do meta.monad [.let [(^open "_[0]") fad - getter_name (code.identifier ["" (..import_name import_format method_prefix _#import_field_name)]) - setter_name (code.identifier ["" (..import_name import_format method_prefix (format _#import_field_name "!"))])] - getter_interop (with_identifiers [g!obj] + getter_name (code.symbol ["" (..import_name import_format method_prefix _#import_field_name)]) + setter_name (code.symbol ["" (..import_name import_format method_prefix (format _#import_field_name "!"))])] + getter_interop (with_symbols [g!obj] (let [getter_call (if _#import_field_static? (` ((~ getter_name) [])) (` ((~ getter_name) [(~ g!obj) (~! <code>.any)]))) @@ -1608,7 +1608,7 @@ ((~' in) (.list (.` (~ getter_body))))))))) setter_interop (: (Meta (List Code)) (if _#import_field_setter? - (with_identifiers [g!obj g!value] + (with_symbols [g!obj g!value] (let [setter_call (if _#import_field_static? (` ((~ setter_name) [(~ g!value) (~! <code>.any)])) (` ((~ setter_name) [(~ g!value) (~! <code>.any) @@ -1796,7 +1796,7 @@ (syntax: .public (length [array <code>.any]) (case array - [_ {.#Identifier array_name}] + [_ {.#Symbol array_name}] (do meta.monad [array_type (meta.type array_name) array_jvm_type (lux_type->jvm_type array_type) @@ -1824,14 +1824,14 @@ (.:as .Nat)))))) _ - (with_identifiers [g!array] + (with_symbols [g!array] (in (list (` (let [(~ g!array) (~ array)] (..length (~ g!array))))))))) (syntax: .public (read! [idx <code>.any array <code>.any]) (case array - [_ {.#Identifier array_name}] + [_ {.#Symbol array_name}] (do meta.monad [array_type (meta.type array_name) array_jvm_type (lux_type->jvm_type array_type) @@ -1861,7 +1861,7 @@ (in (list (` ("jvm array read object" (~ g!idx) (~ array)))))))) _ - (with_identifiers [g!array] + (with_symbols [g!array] (in (list (` (let [(~ g!array) (~ array)] (..read! (~ idx) (~ g!array))))))))) @@ -1869,7 +1869,7 @@ value <code>.any array <code>.any]) (case array - [_ {.#Identifier array_name}] + [_ {.#Symbol array_name}] (do meta.monad [array_type (meta.type array_name) array_jvm_type (lux_type->jvm_type array_type) @@ -1900,7 +1900,7 @@ (in (list (` ("jvm array write object" (~ g!idx) (~ value) (~ array)))))))) _ - (with_identifiers [g!array] + (with_symbols [g!array] (in (list (` (let [(~ g!array) (~ array)] (..write! (~ idx) (~ value) (~ g!array))))))))) diff --git a/stdlib/source/library/lux/ffi.lua.lux b/stdlib/source/library/lux/ffi.lua.lux index b8a203ddd..a06e0ccef 100644 --- a/stdlib/source/library/lux/ffi.lua.lux +++ b/stdlib/source/library/lux/ffi.lua.lux @@ -18,7 +18,7 @@ ["[0]" list ("[1]#[0]" functor mix)]]] [type abstract] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" code] ["[0]" template]]]]) @@ -26,7 +26,7 @@ (abstract: .public (Object brand) Any) (template [<name>] - [(with_expansions [<brand> (template.identifier [<name> "'"])] + [(with_expansions [<brand> (template.symbol [<name> "'"])] (abstract: <brand> Any) (type: .public <name> (..Object <brand>)))] @@ -67,14 +67,14 @@ (Parser Field) (<code>.form ($_ <>.and (<>.parses? ..static!) - <code>.local_identifier + <code>.local_symbol ..nilable))) (def: constant (Parser Field) (<code>.form ($_ <>.and (<>#in true) - <code>.local_identifier + <code>.local_symbol ..nilable))) (type: Common_Method @@ -97,8 +97,8 @@ (def: common_method (Parser Common_Method) ($_ <>.and - <code>.local_identifier - (<>.maybe (<>.after (<code>.this! (' "as")) <code>.local_identifier)) + <code>.local_symbol + (<>.maybe (<>.after (<code>.this! (' "as")) <code>.local_symbol)) (<code>.tuple (<>.some ..nilable)) (<>.parses? (<code>.this! (' "io"))) (<>.parses? (<code>.this! (' "try"))) @@ -128,7 +128,7 @@ (-> (List Nilable) (List [Bit Code])) (|>> list.enumeration (list#each (function (_ [idx [nilable? type]]) - [nilable? (|> idx %.nat code.local_identifier)])))) + [nilable? (|> idx %.nat code.local_symbol)])))) (def: (nilable_type [nilable? type]) (-> Nilable Code) @@ -167,7 +167,7 @@ (def: import ($_ <>.or - (<>.and <code>.local_identifier + (<>.and <code>.local_symbol (<>.else ["" (list)] (<code>.tuple (<>.and <code>.text (<>.some member))))) @@ -219,17 +219,17 @@ (syntax: .public (import: [import ..import]) ... {.#doc (example "Easily import types, methods, functions and constants." ... (import: (os/getenv [..String] "io" "?" ..String)))} - (with_identifiers [g!temp] + (with_symbols [g!temp] (case import {#Class [class format members]} - (with_identifiers [g!object] + (with_symbols [g!object] (let [qualify (: (-> Text Code) (function (_ member_name) (|> format (text.replaced "[1]" class) (text.replaced "[0]" member_name) - code.local_identifier))) - g!type (code.local_identifier class) + code.local_symbol))) + g!type (code.local_symbol class) real_class (text.replaced "/" "." class) imported (case (text.all_split_by "/" class) {.#Item head tail} @@ -293,7 +293,7 @@ members))))) {#Function [name alias inputsT io? try? outputT]} - (in (list (..make_function (code.local_identifier (maybe.else name alias)) + (in (list (..make_function (code.local_symbol (maybe.else name alias)) g!temp (` ("lua constant" (~ (code.text (text.replaced "/" "." name))))) inputsT @@ -302,7 +302,7 @@ outputT))) {#Constant [_ name fieldT]} - (in (list (` ((~! syntax:) ((~ (code.local_identifier name)) []) + (in (list (` ((~! syntax:) ((~ (code.local_symbol name)) []) (# (~! meta.monad) (~' in) (list (` (.:as (~ (nilable_type fieldT)) ("lua constant" (~ (code.text (text.replaced "/" "." name)))))))))))) diff --git a/stdlib/source/library/lux/ffi.old.lux b/stdlib/source/library/lux/ffi.old.lux index d27658372..e40d2302c 100644 --- a/stdlib/source/library/lux/ffi.old.lux +++ b/stdlib/source/library/lux/ffi.old.lux @@ -20,7 +20,7 @@ [collection ["[0]" array {"+" Array}] ["[0]" list ("[1]#[0]" monad mix monoid)]]] - ["[0]" macro {"+" with_identifiers} + ["[0]" macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" code] ["[0]" template]] @@ -322,7 +322,7 @@ (not (list.empty? pbounds)))) type_params) {.#None} - (code.identifier ["" name]) + (code.symbol ["" name]) {.#Some [pname pbounds]} (class_type' mode type_params in_array? (maybe.trusted (list.head pbounds)))) @@ -349,7 +349,7 @@ (def: (type_param_type$ [name bounds]) (-> Type_Parameter Code) - (code.identifier ["" name])) + (code.symbol ["" name])) (def: (class_decl_type$ (^open "[0]")) (-> Class_Declaration Code) @@ -357,7 +357,7 @@ (function (_ [pname pbounds]) (case pbounds {.#End} - (code.identifier ["" pname]) + (code.symbol ["" pname]) {.#Item bound1 _} (class_type {#ManualPrM} #class_params bound1)))) @@ -416,14 +416,14 @@ (-> Text Text (Parser Code)) (do <>.monad [.let [dotted_name (format "::" field_name)] - _ (<code>.this! (code.identifier ["" dotted_name]))] + _ (<code>.this! (code.symbol ["" dotted_name]))] (in (`' ((~ (code.text (format "jvm getstatic" ":" class_name ":" field_name)))))))) (def: (get_var_parser class_name field_name) (-> Text Text (Parser Code)) (do <>.monad [.let [dotted_name (format "::" field_name)] - _ (<code>.this! (code.identifier ["" dotted_name]))] + _ (<code>.this! (code.symbol ["" dotted_name]))] (in (`' ((~ (code.text (format "jvm getfield" ":" class_name ":" field_name))) _jvm_this))))) (def: (put_var_parser class_name field_name) @@ -431,7 +431,7 @@ (do <>.monad [.let [dotted_name (format "::" field_name)] [_ _ value] (: (Parser [Any Any Code]) - (<code>.form ($_ <>.and (<code>.this! (' :=)) (<code>.this! (code.identifier ["" dotted_name])) <code>.any)))] + (<code>.form ($_ <>.and (<code>.this! (' :=)) (<code>.this! (code.symbol ["" dotted_name])) <code>.any)))] (in (`' ((~ (code.text (format "jvm putfield" ":" class_name ":" field_name))) _jvm_this (~ value)))))) (def: (pre_walk_replace f input) @@ -482,7 +482,7 @@ (do <>.monad [.let [dotted_name (format "::" method_name "!")] args (: (Parser (List Code)) - (<code>.form (<>.after (<code>.this! (code.identifier ["" dotted_name])) + (<code>.form (<>.after (<code>.this! (code.symbol ["" dotted_name])) (<code>.tuple (<>.exactly (list.size arg_decls) <code>.any))))) .let [arg_decls' (: (List Text) (list#each (|>> product.right (simple_class$ params)) arg_decls))]] (in (`' ((~ (code.text (format "jvm invokestatic" ":" class_name ":" method_name ":" (text.interposed "," arg_decls')))) @@ -494,7 +494,7 @@ (do <>.monad [.let [dotted_name (format "::" method_name "!")] args (: (Parser (List Code)) - (<code>.form (<>.after (<code>.this! (code.identifier ["" dotted_name])) + (<code>.form (<>.after (<code>.this! (code.symbol ["" dotted_name])) (<code>.tuple (<>.exactly (list.size arg_decls) <code>.any))))) .let [arg_decls' (: (List Text) (list#each (|>> product.right (simple_class$ params)) arg_decls))]] (in (`' ((~ (code.text (format <jvm_op> ":" class_name ":" method_name ":" (text.interposed "," arg_decls')))) @@ -565,7 +565,7 @@ bound recur^] (in {#GenericWildcard {.#Some [bound_kind bound]}}))) (do <>.monad - [name <code>.local_identifier + [name <code>.local_symbol _ (no_periods_assertion name)] (if (list.member? text.equivalence (list#each product.left type_vars) name) (in {#GenericTypeVar name}) @@ -588,7 +588,7 @@ _ (in {#GenericArray component})))) (<code>.form (do <>.monad - [name <code>.local_identifier + [name <code>.local_symbol _ (no_periods_assertion name) params (<>.some recur^) _ (<>.assertion (format name " cannot be a type-parameter!") @@ -599,10 +599,10 @@ (def: type_param^ (Parser Type_Parameter) (<>.either (do <>.monad - [param_name <code>.local_identifier] + [param_name <code>.local_symbol] (in [param_name (list)])) (<code>.tuple (do <>.monad - [param_name <code>.local_identifier + [param_name <code>.local_symbol _ (<code>.this! (' <)) bounds (<>.many (..generic_type^ (list)))] (in [param_name bounds]))))) @@ -617,11 +617,11 @@ (def: class_decl^ (Parser Class_Declaration) (<>.either (do <>.monad - [name <code>.local_identifier + [name <code>.local_symbol _ (no_periods_assertion name)] (in [name (list)])) (<code>.form (do <>.monad - [name <code>.local_identifier + [name <code>.local_symbol _ (no_periods_assertion name) params (<>.some ..type_param^)] (in [name params]))) @@ -630,11 +630,11 @@ (def: (super_class_decl^ type_vars) (-> (List Type_Parameter) (Parser Super_Class_Decl)) (<>.either (do <>.monad - [name <code>.local_identifier + [name <code>.local_symbol _ (no_periods_assertion name)] (in [name (list)])) (<code>.form (do <>.monad - [name <code>.local_identifier + [name <code>.local_symbol _ (no_periods_assertion name) params (<>.some (..generic_type^ type_vars))] (in [name params]))))) @@ -646,9 +646,9 @@ (def: annotation^ (Parser Annotation) (<>.either (do <>.monad - [ann_name <code>.local_identifier] + [ann_name <code>.local_symbol] (in [ann_name (list)])) - (<code>.form (<>.and <code>.local_identifier + (<code>.form (<>.and <code>.local_symbol annotation_params^)))) (def: annotations^' @@ -679,7 +679,7 @@ (-> (List Type_Parameter) (Parser [Member_Declaration MethodDecl])) (<code>.form (do <>.monad [tvars ..type_params^ - name <code>.local_identifier + name <code>.local_symbol anns ..annotations^ inputs (<code>.tuple (<>.some (..generic_type^ type_vars))) output (..generic_type^ type_vars) @@ -700,7 +700,7 @@ (-> (List Type_Parameter) (Parser [Member_Declaration FieldDecl])) (<>.either (<code>.form (do <>.monad [_ (<code>.this! (' "const")) - name <code>.local_identifier + name <code>.local_symbol anns ..annotations^ type (..generic_type^ type_vars) body <code>.any] @@ -708,14 +708,14 @@ (<code>.form (do <>.monad [pm privacy_modifier^ sm state_modifier^ - name <code>.local_identifier + name <code>.local_symbol anns ..annotations^ type (..generic_type^ type_vars)] (in [[name pm anns] {#VariableField [sm type]}]))))) (def: (arg_decl^ type_vars) (-> (List Type_Parameter) (Parser ArgDecl)) - (<>.and <code>.local_identifier + (<>.and <code>.local_symbol (..generic_type^ type_vars))) (def: (arg_decls^ type_vars) @@ -757,8 +757,8 @@ method_vars ..type_params^ .let [total_vars (list#composite class_vars method_vars)] [name this_name arg_decls] (<code>.form ($_ <>.and - <code>.local_identifier - <code>.local_identifier + <code>.local_symbol + <code>.local_symbol (..arg_decls^ total_vars))) return_type (..generic_type^ total_vars) exs (..throws_decl^ total_vars) @@ -780,8 +780,8 @@ method_vars ..type_params^ .let [total_vars (list#composite (product.right owner_class) method_vars)] [name this_name arg_decls] (<code>.form ($_ <>.and - <code>.local_identifier - <code>.local_identifier + <code>.local_symbol + <code>.local_symbol (..arg_decls^ total_vars))) return_type (..generic_type^ total_vars) exs (..throws_decl^ total_vars) @@ -803,7 +803,7 @@ _ (<code>.this! (' "static")) method_vars ..type_params^ .let [total_vars method_vars] - [name arg_decls] (<code>.form (<>.and <code>.local_identifier + [name arg_decls] (<code>.form (<>.and <code>.local_symbol (..arg_decls^ total_vars))) return_type (..generic_type^ total_vars) exs (..throws_decl^ total_vars) @@ -821,7 +821,7 @@ _ (<code>.this! (' "abstract")) method_vars ..type_params^ .let [total_vars method_vars] - [name arg_decls] (<code>.form (<>.and <code>.local_identifier + [name arg_decls] (<code>.form (<>.and <code>.local_symbol (..arg_decls^ total_vars))) return_type (..generic_type^ total_vars) exs (..throws_decl^ total_vars) @@ -838,7 +838,7 @@ _ (<code>.this! (' "native")) method_vars ..type_params^ .let [total_vars method_vars] - [name arg_decls] (<code>.form (<>.and <code>.local_identifier + [name arg_decls] (<code>.form (<>.and <code>.local_symbol (..arg_decls^ total_vars))) return_type (..generic_type^ total_vars) exs (..throws_decl^ total_vars) @@ -860,13 +860,13 @@ (def: partial_call^ (Parser Partial_Call) - (<code>.form (<>.and <code>.identifier (<>.some <code>.any)))) + (<code>.form (<>.and <code>.symbol (<>.some <code>.any)))) (def: import_member_alias^ (Parser (Maybe Text)) (<>.maybe (do <>.monad [_ (<code>.this! (' "as"))] - <code>.local_identifier))) + <code>.local_symbol))) (def: (import_member_args^ type_vars) (-> (List Type_Parameter) (Parser (List [Bit GenericType]))) @@ -886,7 +886,7 @@ ($_ <>.either (<code>.form (do <>.monad [_ (<code>.this! (' "enum")) - enum_members (<>.some <code>.local_identifier)] + enum_members (<>.some <code>.local_symbol)] (in {#EnumDecl enum_members}))) (<code>.form (do <>.monad [tvars ..type_params^ @@ -910,7 +910,7 @@ (<>.or (<code>.this! (' "static")) (in []))) tvars ..type_params^ - name <code>.local_identifier + name <code>.local_symbol ?alias import_member_alias^ .let [total_vars (list#composite owner_vars tvars)] ?prim_mode (<>.maybe primitive_mode^) @@ -929,7 +929,7 @@ #import_method_return return]]}))) (<code>.form (do <>.monad [static? (<>.parses? (<code>.this! (' "static"))) - name <code>.local_identifier + name <code>.local_symbol ?prim_mode (<>.maybe primitive_mode^) gtype (..generic_type^ owner_vars) maybe? (<>.parses? (<code>.this! (' "?"))) @@ -1101,7 +1101,7 @@ (with_brackets (spaced (list#each generic_type$ exs))) (with_brackets (spaced (list#each arg_decl$ arg_decls))) (generic_type$ return_type) - (code.format (pre_walk_replace replacer (` (let [(~ (code.local_identifier this_name)) (~' _jvm_this)] + (code.format (pre_walk_replace replacer (` (let [(~ (code.local_symbol this_name)) (~' _jvm_this)] (~ body)))))))) {#OverridenMethod strict_fp? class_decl type_vars this_name arg_decls return_type body exs} @@ -1125,7 +1125,7 @@ (with_brackets (spaced (list#each generic_type$ exs))) (with_brackets (spaced (list#each arg_decl$ arg_decls))) (generic_type$ return_type) - (|> (` (let [(~ (code.local_identifier this_name)) (~' _jvm_this)] + (|> (` (let [(~ (code.local_symbol this_name)) (~' _jvm_this)] (~ body))) (pre_walk_replace replacer) (pre_walk_replace super_replacer) @@ -1170,7 +1170,7 @@ (def: (complete_call$ g!obj [method args]) (-> Code Partial_Call Code) - (` ((~ (code.identifier method)) (~+ args) (~ g!obj)))) + (` ((~ (code.symbol method)) (~+ args) (~ g!obj)))) ... [Syntax] (def: object_super_class @@ -1242,14 +1242,14 @@ ("jvm object null?" obj)) (syntax: .public (??? [expr <code>.any]) - (with_identifiers [g!temp] + (with_symbols [g!temp] (in (list (` (let [(~ g!temp) (~ expr)] (if ("jvm object null?" (~ g!temp)) {.#None} {.#Some (~ g!temp)}))))))) (syntax: .public (!!! [expr <code>.any]) - (with_identifiers [g!value] + (with_symbols [g!value] (in (list (` (.case (~ expr) {.#Some (~ g!value)} (~ g!value) @@ -1259,7 +1259,7 @@ (syntax: .public (check [class (..generic_type^ (list)) unchecked (<>.maybe <code>.any)]) - (with_identifiers [g!_ g!unchecked] + (with_symbols [g!_ g!unchecked] (let [class_name (simple_class$ (list) class) class_type (` (.Primitive (~ (code.text class_name)))) check_type (` (.Maybe (~ class_type))) @@ -1285,16 +1285,16 @@ (syntax: .public (do_to [obj <code>.any methods (<>.some partial_call^)]) - (with_identifiers [g!obj] + (with_symbols [g!obj] (in (list (` (let [(~ g!obj) (~ obj)] (exec (~+ (list#each (complete_call$ g!obj) methods)) (~ g!obj)))))))) (def: (class_import$ [full_name params]) (-> Class_Declaration Code) - (let [params' (list#each (|>> product.left code.local_identifier) params)] + (let [params' (list#each (|>> product.left code.local_symbol) params)] (template.with_locals [g!_] - (` (def: (~ (code.identifier ["" full_name])) + (` (def: (~ (code.symbol ["" full_name])) Type (All ((~ (' g!_)) (~+ params')) (Primitive (~ (code.text (safe full_name))) @@ -1326,7 +1326,7 @@ [arg_inputs (monad.each ! (: (-> [Bit GenericType] (Meta [Bit Code])) (function (_ [maybe? _]) - (with_identifiers [arg_name] + (with_symbols [arg_name] (in [maybe? arg_name])))) #import_member_args) .let [arg_classes (: (List Text) @@ -1350,7 +1350,7 @@ (^or {#ConstructorDecl [commons _]} {#MethodDecl [commons _]}) (if (value@ #import_member_maybe? commons) (` (??? (~ return_term))) - (let [g!temp (` ((~' ~') (~ (code.identifier ["" " Ω "]))))] + (let [g!temp (` ((~' ~') (~ (code.symbol ["" " Ω "]))))] (` (let [(~ g!temp) (~ return_term)] (if (not (..null? (:as (Primitive "java.lang.Object") (~ g!temp)))) @@ -1386,7 +1386,7 @@ (def: (lux_type_parameter [name _]) (-> Type_Parameter Code) - (code.identifier ["" name])) + (code.symbol ["" name])) (template [<name> <byte> <short> <int> <float>] [(def: (<name> mode [class expression]) @@ -1442,7 +1442,7 @@ (list#each lux_type_parameter))] (case member {#EnumDecl enum_members} - (macro.with_identifiers [g!_] + (macro.with_symbols [g!_] (do [! meta.monad] [.let [enum_type (: Code (case class_tvars @@ -1456,7 +1456,7 @@ (` (All ((~ g!_) (~+ =class_tvars)) (Primitive (~ (code.text full_name)) [(~+ =class_tvars)])))))) getter_interop (: (-> Text Code) (function (_ name) - (let [getter_name (code.identifier ["" (..import_name import_format method_prefix name)])] + (let [getter_name (code.symbol ["" (..import_name import_format method_prefix name)])] (` (def: (~ getter_name) (~ enum_type) ((~ (code.text (format "jvm getstatic" ":" full_name ":" name)))))))))]] @@ -1464,7 +1464,7 @@ {#ConstructorDecl [commons _]} (do meta.monad - [.let [def_name (code.identifier ["" (..import_name import_format method_prefix (value@ #import_member_alias commons))]) + [.let [def_name (code.symbol ["" (..import_name import_format method_prefix (value@ #import_member_alias commons))]) jvm_extension (code.text (format "jvm new" ":" full_name ":" (text.interposed "," arg_classes))) jvm_interop (|> (` ((~ jvm_extension) (~+ (jvm_extension_inputs (value@ #import_member_mode commons) arg_classes arg_function_inputs)))) @@ -1475,9 +1475,9 @@ ((~' in) (.list (.` (~ jvm_interop))))))))) {#MethodDecl [commons method]} - (with_identifiers [g!obj] + (with_symbols [g!obj] (do meta.monad - [.let [def_name (code.identifier ["" (..import_name import_format method_prefix (value@ #import_member_alias commons))]) + [.let [def_name (code.symbol ["" (..import_name import_format method_prefix (value@ #import_member_alias commons))]) (^open "[0]") commons (^open "[0]") method [jvm_op object_ast] (: [Text (List Code)] @@ -1520,9 +1520,9 @@ (|> class_tvars (list.only free_type_param?) (list#each lux_type_parameter))) - getter_name (code.identifier ["" (..import_name import_format method_prefix #import_field_name)]) - setter_name (code.identifier ["" (..import_name import_format method_prefix (format #import_field_name "!"))])] - getter_interop (with_identifiers [g!obj] + getter_name (code.symbol ["" (..import_name import_format method_prefix #import_field_name)]) + setter_name (code.symbol ["" (..import_name import_format method_prefix (format #import_field_name "!"))])] + getter_interop (with_symbols [g!obj] (let [getter_call (if #import_field_static? (` ((~ getter_name) [])) (` ((~ getter_name) [(~ g!obj) (~! <code>.any)]))) @@ -1543,7 +1543,7 @@ ((~' in) (.list (.` (~ getter_body))))))))) setter_interop (: (Meta (List Code)) (if #import_field_setter? - (with_identifiers [g!obj g!value] + (with_symbols [g!obj g!value] (let [setter_call (if #import_field_static? (` ((~ setter_name) [(~ g!value) (~! <code>.any)])) (` ((~ setter_name) [(~ g!value) (~! <code>.any) @@ -1653,7 +1653,7 @@ (syntax: .public (read! [idx <code>.any array <code>.any]) (case array - [_ {.#Identifier array_name}] + [_ {.#Symbol array_name}] (do meta.monad [array_type (meta.type array_name) array_jvm_type (type_class_name array_type)] @@ -1674,7 +1674,7 @@ (in (list (` ("jvm aaload" (~ array) (~ idx))))))) _ - (with_identifiers [g!array] + (with_symbols [g!array] (in (list (` (let [(~ g!array) (~ array)] (..read! (~ idx) (~ g!array))))))))) @@ -1682,7 +1682,7 @@ value <code>.any array <code>.any]) (case array - [_ {.#Identifier array_name}] + [_ {.#Symbol array_name}] (do meta.monad [array_type (meta.type array_name) array_jvm_type (type_class_name array_type)] @@ -1703,7 +1703,7 @@ (in (list (` ("jvm aastore" (~ array) (~ idx) (~ value))))))) _ - (with_identifiers [g!array] + (with_symbols [g!array] (in (list (` (let [(~ g!array) (~ array)] (..write! (~ idx) (~ value) (~ g!array))))))))) diff --git a/stdlib/source/library/lux/ffi.php.lux b/stdlib/source/library/lux/ffi.php.lux index 08cbcf46b..e37ef1595 100644 --- a/stdlib/source/library/lux/ffi.php.lux +++ b/stdlib/source/library/lux/ffi.php.lux @@ -18,7 +18,7 @@ ["[0]" list ("[1]#[0]" functor)]]] [type abstract] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" code] ["[0]" template]]]]) @@ -26,7 +26,7 @@ (abstract: .public (Object brand) Any) (template [<name>] - [(with_expansions [<brand> (template.identifier [<name> "'"])] + [(with_expansions [<brand> (template.symbol [<name> "'"])] (abstract: .public <brand> Any) (type: .public <name> (..Object <brand>)))] @@ -60,7 +60,7 @@ (def: alias (Parser Alias) - (<>.after (<code>.this! (' "as")) <code>.local_identifier)) + (<>.after (<code>.this! (' "as")) <code>.local_symbol)) (type: Field [Bit Text (Maybe Alias) Nullable]) @@ -73,7 +73,7 @@ (Parser Field) (<code>.form ($_ <>.and (<>.parses? ..static!) - <code>.local_identifier + <code>.local_symbol (<>.maybe ..alias) ..nullable))) @@ -81,7 +81,7 @@ (Parser Field) (<code>.form ($_ <>.and (<>#in true) - <code>.local_identifier + <code>.local_symbol (<>.maybe ..alias) ..nullable))) @@ -105,7 +105,7 @@ (def: common_method (Parser Common_Method) ($_ <>.and - <code>.local_identifier + <code>.local_symbol (<>.maybe ..alias) (<code>.tuple (<>.some ..nullable)) (<>.parses? (<code>.this! (' "io"))) @@ -136,7 +136,7 @@ (-> (List Nullable) (List [Bit Code])) (|>> list.enumeration (list#each (function (_ [idx [nullable? type]]) - [nullable? (|> idx %.nat code.local_identifier)])))) + [nullable? (|> idx %.nat code.local_symbol)])))) (def: (nullable_type [nullable? type]) (-> Nullable Code) @@ -177,7 +177,7 @@ (Parser Import) ($_ <>.or ($_ <>.and - <code>.local_identifier + <code>.local_symbol (<>.maybe ..alias) (<>.else ["" (list)] (<code>.tuple (<>.and <code>.text @@ -237,17 +237,17 @@ (~+ (list#each (with_null g!temp) g!inputs))))))))))) (syntax: .public (import: [import ..import]) - (with_identifiers [g!temp] + (with_symbols [g!temp] (case import {#Class [class alias format members]} - (with_identifiers [g!object] + (with_symbols [g!object] (let [qualify (: (-> Text Code) (function (_ member_name) (|> format (text.replaced "[1]" (maybe.else class alias)) (text.replaced "[0]" member_name) - code.local_identifier))) - g!type (code.local_identifier (maybe.else class alias)) + code.local_symbol))) + g!type (code.local_symbol (maybe.else class alias)) class_import (` ("php constant" (~ (code.text class))))] (in (list& (` (type: (~ g!type) (..Object (Primitive (~ (code.text class)))))) @@ -302,7 +302,7 @@ {#Function [name alias inputsT io? try? outputT]} (let [imported (` ("php constant" (~ (code.text name))))] - (in (list (..make_function (code.local_identifier (maybe.else name alias)) + (in (list (..make_function (code.local_symbol (maybe.else name alias)) g!temp imported inputsT @@ -312,7 +312,7 @@ {#Constant [_ name alias fieldT]} (let [imported (` ("php constant" (~ (code.text name))))] - (in (list (` ((~! syntax:) ((~ (code.local_identifier (maybe.else name alias))) []) + (in (list (` ((~! syntax:) ((~ (code.local_symbol (maybe.else name alias))) []) (# (~! meta.monad) (~' in) (list (` (.:as (~ (nullable_type fieldT)) (~ imported)))))))))) ))) diff --git a/stdlib/source/library/lux/ffi.py.lux b/stdlib/source/library/lux/ffi.py.lux index c05d1039f..d19d9aefb 100644 --- a/stdlib/source/library/lux/ffi.py.lux +++ b/stdlib/source/library/lux/ffi.py.lux @@ -18,7 +18,7 @@ ["[0]" list ("[1]#[0]" functor mix)]]] [type abstract] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" code] ["[0]" template]]]]) @@ -26,7 +26,7 @@ (abstract: .public (Object brand) Any) (template [<name>] - [(with_expansions [<brand> (template.identifier [<name> "'"])] + [(with_expansions [<brand> (template.symbol [<name> "'"])] (abstract: <brand> Any) (type: .public <name> (..Object <brand>)))] @@ -75,7 +75,7 @@ (Parser Field) (<code>.form ($_ <>.and (<>.parses? ..static!) - <code>.local_identifier + <code>.local_symbol ..noneable))) (type: Common_Method @@ -98,8 +98,8 @@ (def: common_method (Parser Common_Method) ($_ <>.and - <code>.local_identifier - (<>.maybe (<>.after (<code>.this! (' "as")) <code>.local_identifier)) + <code>.local_symbol + (<>.maybe (<>.after (<code>.this! (' "as")) <code>.local_symbol)) (<code>.tuple (<>.some ..noneable)) (<>.parses? (<code>.this! (' "io"))) (<>.parses? (<code>.this! (' "try"))) @@ -131,7 +131,7 @@ (-> (List Noneable) (List [Bit Code])) (|>> list.enumeration (list#each (function (_ [idx [noneable? type]]) - [noneable? (|> idx %.nat code.local_identifier)])))) + [noneable? (|> idx %.nat code.local_symbol)])))) (def: (noneable_type [noneable? type]) (-> Noneable Code) @@ -169,7 +169,7 @@ (def: import (Parser Import) - (<>.or (<>.and <code>.local_identifier + (<>.or (<>.and <code>.local_symbol (<>.else ["" (list)] (<code>.tuple (<>.and <code>.text (<>.some member))))) @@ -239,17 +239,17 @@ ... ("static" sep ..String) ... ("static" getsize [..String] "io" "try" ..Integer) ... ("static" getmtime [..String] "io" "try" ..Float)]))} - (with_identifiers [g!temp] + (with_symbols [g!temp] (case import {#Class [class format members]} - (with_identifiers [g!object] + (with_symbols [g!object] (let [qualify (: (-> Text Code) (function (_ member_name) (|> format (text.replaced "[1]" class) (text.replaced "[0]" member_name) - code.local_identifier))) - g!type (code.local_identifier class) + code.local_symbol))) + g!type (code.local_symbol class) real_class (text.replaced "/" "." class) imported (case (text.all_split_by "/" class) {.#Item head tail} @@ -324,7 +324,7 @@ members))))) {#Function [name alias inputsT io? try? outputT]} - (in (list (..make_function (code.local_identifier (maybe.else name alias)) + (in (list (..make_function (code.local_symbol (maybe.else name alias)) g!temp (` ("python constant" (~ (code.text name)))) inputsT diff --git a/stdlib/source/library/lux/ffi.rb.lux b/stdlib/source/library/lux/ffi.rb.lux index 41e21b197..e80f0a782 100644 --- a/stdlib/source/library/lux/ffi.rb.lux +++ b/stdlib/source/library/lux/ffi.rb.lux @@ -18,7 +18,7 @@ ["[0]" list ("[1]#[0]" functor)]]] [type abstract] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" code] ["[0]" template]]]]) @@ -26,7 +26,7 @@ (abstract: .public (Object brand) Any) (template [<name>] - [(with_expansions [<brand> (template.identifier [<name> "'"])] + [(with_expansions [<brand> (template.symbol [<name> "'"])] (abstract: <brand> Any) (type: .public <name> (..Object <brand>)))] @@ -60,7 +60,7 @@ (def: alias (Parser Alias) - (<>.after (<code>.this! (' "as")) <code>.local_identifier)) + (<>.after (<code>.this! (' "as")) <code>.local_symbol)) (type: Field [Bit Text (Maybe Alias) Nilable]) @@ -73,7 +73,7 @@ (Parser Field) (<code>.form ($_ <>.and (<>.parses? ..static!) - <code>.local_identifier + <code>.local_symbol (<>.maybe ..alias) ..nilable))) @@ -81,7 +81,7 @@ (Parser Field) (<code>.form ($_ <>.and (<>#in true) - <code>.local_identifier + <code>.local_symbol (<>.maybe ..alias) ..nilable))) @@ -105,7 +105,7 @@ (def: common_method (Parser Common_Method) ($_ <>.and - <code>.local_identifier + <code>.local_symbol (<>.maybe ..alias) (<code>.tuple (<>.some ..nilable)) (<>.parses? (<code>.this! (' "io"))) @@ -136,7 +136,7 @@ (-> (List Nilable) (List [Bit Code])) (|>> list.enumeration (list#each (function (_ [idx [nilable? type]]) - [nilable? (|> idx %.nat code.local_identifier)])))) + [nilable? (|> idx %.nat code.local_symbol)])))) (def: (nilable_type [nilable? type]) (-> Nilable Code) @@ -179,7 +179,7 @@ (<>.maybe <code>.text) ($_ <>.or ($_ <>.and - <code>.local_identifier + <code>.local_symbol (<>.maybe ..alias) (<>.else ["" (list)] (<code>.tuple (<>.and <code>.text @@ -230,17 +230,17 @@ (~+ (list#each (with_nil g!temp) g!inputs))))))))))) (syntax: .public (import: [[?module import] ..import]) - (with_identifiers [g!temp] + (with_symbols [g!temp] (case import {#Class [class alias format members]} - (with_identifiers [g!object] + (with_symbols [g!object] (let [qualify (: (-> Text Code) (function (_ member_name) (|> format (text.replaced "[1]" (maybe.else class alias)) (text.replaced "[0]" member_name) - code.local_identifier))) - g!type (code.local_identifier (maybe.else class alias)) + code.local_symbol))) + g!type (code.local_symbol (maybe.else class alias)) module_import (: (List Code) (case ?module {.#Some module} @@ -313,7 +313,7 @@ {.#None} (list))) ("ruby constant" (~ (code.text name)))))] - (in (list (..make_function (code.local_identifier (maybe.else name alias)) + (in (list (..make_function (code.local_symbol (maybe.else name alias)) g!temp imported inputsT @@ -330,7 +330,7 @@ {.#None} (list))) ("ruby constant" (~ (code.text name)))))] - (in (list (` ((~! syntax:) ((~ (code.local_identifier (maybe.else name alias))) []) + (in (list (` ((~! syntax:) ((~ (code.local_symbol (maybe.else name alias))) []) (# (~! meta.monad) (~' in) (list (` (.:as (~ (nilable_type fieldT)) (~ imported)))))))))) ))) diff --git a/stdlib/source/library/lux/ffi.scm.lux b/stdlib/source/library/lux/ffi.scm.lux index 32d964fbc..ae9bdeb89 100644 --- a/stdlib/source/library/lux/ffi.scm.lux +++ b/stdlib/source/library/lux/ffi.scm.lux @@ -18,7 +18,7 @@ ["[0]" list ("[1]#[0]" functor)]]] [type abstract] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" code] ["[0]" template]]]]) @@ -26,7 +26,7 @@ (abstract: .public (Object brand) Any) (template [<name>] - [(with_expansions [<brand> (template.identifier [<name> "'"])] + [(with_expansions [<brand> (template.symbol [<name> "'"])] (abstract: .public <brand> Any) (type: .public <name> (..Object <brand>)))] @@ -60,7 +60,7 @@ (def: alias (Parser Alias) - (<>.after (<code>.this! (' "as")) <code>.local_identifier)) + (<>.after (<code>.this! (' "as")) <code>.local_symbol)) (type: Field [Bit Text (Maybe Alias) Nilable]) @@ -73,7 +73,7 @@ (Parser Field) (<code>.form ($_ <>.and (<>.parses? ..static!) - <code>.local_identifier + <code>.local_symbol (<>.maybe ..alias) ..nilable))) @@ -81,7 +81,7 @@ (Parser Field) (<code>.form ($_ <>.and (<>#in true) - <code>.local_identifier + <code>.local_symbol (<>.maybe ..alias) ..nilable))) @@ -97,7 +97,7 @@ (def: common_method (Parser Common_Method) ($_ <>.and - <code>.local_identifier + <code>.local_symbol (<>.maybe ..alias) (<code>.tuple (<>.some ..nilable)) (<>.parses? (<code>.this! (' "io"))) @@ -108,7 +108,7 @@ (-> (List Nilable) (List [Bit Code])) (|>> list.enumeration (list#each (function (_ [idx [nilable? type]]) - [nilable? (|> idx %.nat code.local_identifier)])))) + [nilable? (|> idx %.nat code.local_symbol)])))) (def: (nilable_type [nilable? type]) (-> Nilable Code) @@ -202,11 +202,11 @@ (~+ (list#each (with_nil g!temp) g!inputs))))))))))) (syntax: .public (import: [import ..import]) - (with_identifiers [g!temp] + (with_symbols [g!temp] (case import {#Function [name alias inputsT io? try? outputT]} (let [imported (` ("scheme constant" (~ (code.text name))))] - (in (list (..make_function (code.local_identifier (maybe.else name alias)) + (in (list (..make_function (code.local_symbol (maybe.else name alias)) g!temp imported inputsT @@ -216,7 +216,7 @@ {#Constant [_ name alias fieldT]} (let [imported (` ("scheme constant" (~ (code.text name))))] - (in (list (` ((~! syntax:) ((~ (code.local_identifier (maybe.else name alias)))) + (in (list (` ((~! syntax:) ((~ (code.local_symbol (maybe.else name alias)))) (# (~! meta.monad) (~' in) (list (` (.:as (~ (nilable_type fieldT)) (~ imported)))))))))) ))) diff --git a/stdlib/source/library/lux/macro.lux b/stdlib/source/library/lux/macro.lux index 3f1d04553..1fa269e8c 100644 --- a/stdlib/source/library/lux/macro.lux +++ b/stdlib/source/library/lux/macro.lux @@ -1,6 +1,6 @@ (.module: [library - [lux "*" + [lux {"-" symbol} [abstract ["[0]" monad {"+" do}]] [data @@ -21,7 +21,7 @@ (def: .public (single_expansion syntax) (-> Code (Meta (List Code))) (case syntax - [_ {.#Form {.#Item [[_ {.#Identifier name}] args]}}] + [_ {.#Form {.#Item [[_ {.#Symbol name}] args]}}] (do //.monad [?macro (//.macro name)] (case ?macro @@ -37,7 +37,7 @@ (def: .public (expansion syntax) (-> Code (Meta (List Code))) (case syntax - [_ {.#Form {.#Item [[_ {.#Identifier name}] args]}}] + [_ {.#Form {.#Item [[_ {.#Symbol name}] args]}}] (do //.monad [?macro (//.macro name)] (case ?macro @@ -57,7 +57,7 @@ (def: .public (full_expansion syntax) (-> Code (Meta (List Code))) (case syntax - [_ {.#Form {.#Item [[_ {.#Identifier name}] args]}}] + [_ {.#Form {.#Item [[_ {.#Symbol name}] args]}}] (do //.monad [?macro (//.macro name)] (case ?macro @@ -69,7 +69,7 @@ {.#None} (do //.monad - [parts' (monad.each //.monad full_expansion (list& (code.identifier name) args))] + [parts' (monad.each //.monad full_expansion (list& (code.symbol name) args))] (in (list (code.form (list#conjoint parts'))))))) [_ {.#Form {.#Item [harg targs]}}] @@ -91,23 +91,23 @@ _ (# //.monad in (list syntax)))) -(def: .public (identifier prefix) +(def: .public (symbol prefix) (-> Text (Meta Code)) (do //.monad [id //.seed] (in (|> id (# nat.decimal encoded) ($_ text#composite "__gensym__" prefix) - [""] code.identifier)))) + [""] code.symbol)))) -(def: (local_identifier ast) +(def: (local_symbol ast) (-> Code (Meta Text)) (case ast - [_ {.#Identifier [_ name]}] + [_ {.#Symbol [_ name]}] (# //.monad in name) _ - (//.failure (text#composite "Code is not a local identifier: " (code.format ast))))) + (//.failure (text#composite "Code is not a local symbol: " (code.format ast))))) (def: .public wrong_syntax_error (-> Symbol Text) @@ -115,20 +115,20 @@ (text.prefix (text#composite "Wrong syntax for " text.\'')) (text.suffix (text#composite text.\'' ".")))) -(macro: .public (with_identifiers tokens) +(macro: .public (with_symbols tokens) (case tokens - (^ (list [_ {.#Tuple identifiers}] body)) + (^ (list [_ {.#Tuple symbols}] body)) (do [! //.monad] - [identifier_names (monad.each ! ..local_identifier identifiers) - .let [identifier_defs (list#conjoint (list#each (: (-> Text (List Code)) - (function (_ name) (list (code.identifier ["" name]) (` (..identifier (~ (code.text name))))))) - identifier_names))]] + [symbol_names (monad.each ! ..local_symbol symbols) + .let [symbol_defs (list#conjoint (list#each (: (-> Text (List Code)) + (function (_ name) (list (code.symbol ["" name]) (` (..symbol (~ (code.text name))))))) + symbol_names))]] (in (list (` ((~! do) (~! //.monad) - [(~+ identifier_defs)] + [(~+ symbol_defs)] (~ body)))))) _ - (//.failure (..wrong_syntax_error (symbol ..with_identifiers))))) + (//.failure (..wrong_syntax_error (.symbol ..with_symbols))))) (def: .public (one_expansion token) (-> Code (Meta Code)) @@ -143,8 +143,8 @@ (template [<macro> <func>] [(macro: .public (<macro> tokens) - (let [[module _] (symbol .._) - [_ short] (symbol <macro>) + (let [[module _] (.symbol .._) + [_ short] (.symbol <macro>) macro_name [module short]] (case (: (Maybe [Bit Code]) (case tokens diff --git a/stdlib/source/library/lux/macro/code.lux b/stdlib/source/library/lux/macro/code.lux index 60a3ee79c..7621c06ff 100644 --- a/stdlib/source/library/lux/macro/code.lux +++ b/stdlib/source/library/lux/macro/code.lux @@ -1,6 +1,6 @@ (.module: [library - [lux {"-" nat int rev} + [lux {"-" nat int rev symbol} [abstract [equivalence {"+" Equivalence}]] [data @@ -26,7 +26,7 @@ ... {.#Rev Rev} ... {.#Frac Frac} ... {.#Text Text} -... {.#Identifier Symbol} +... {.#Symbol Symbol} ... {.#Form (List (w (Code' w)))} ... {.#Variant (List (w (Code' w)))} ... {.#Tuple (List (w (Code' w)))}) @@ -39,16 +39,16 @@ (-> <type> Code) [location.dummy {<tag> x}])] - [bit Bit .#Bit] - [nat Nat .#Nat] - [int Int .#Int] - [rev Rev .#Rev] - [frac Frac .#Frac] - [text Text .#Text] - [identifier Symbol .#Identifier] - [form (List Code) .#Form] - [variant (List Code) .#Variant] - [tuple (List Code) .#Tuple] + [bit Bit .#Bit] + [nat Nat .#Nat] + [int Int .#Int] + [rev Rev .#Rev] + [frac Frac .#Frac] + [text Text .#Text] + [symbol Symbol .#Symbol] + [form (List Code) .#Form] + [variant (List Code) .#Variant] + [tuple (List Code) .#Tuple] ) (template [<name> <tag>] @@ -56,7 +56,7 @@ (-> Text Code) [location.dummy {<tag> ["" name]}])] - [local_identifier .#Identifier]) + [local_symbol .#Symbol]) (implementation: .public equivalence (Equivalence Code) @@ -66,13 +66,13 @@ (^template [<tag> <eq>] [[[_ {<tag> x'}] [_ {<tag> y'}]] (# <eq> = x' y')]) - ([.#Bit bit.equivalence] - [.#Nat nat.equivalence] - [.#Int int.equivalence] - [.#Rev rev.equivalence] - [.#Frac frac.equivalence] - [.#Text text.equivalence] - [.#Identifier symbol.equivalence]) + ([.#Bit bit.equivalence] + [.#Nat nat.equivalence] + [.#Int int.equivalence] + [.#Rev rev.equivalence] + [.#Frac frac.equivalence] + [.#Text text.equivalence] + [.#Symbol symbol.equivalence]) (^template [<tag>] [[[_ {<tag> xs'}] [_ {<tag> ys'}]] @@ -90,12 +90,12 @@ (^template [<tag> <struct>] [[_ {<tag> value}] (# <struct> encoded value)]) - ([.#Bit bit.codec] - [.#Nat nat.decimal] - [.#Int int.decimal] - [.#Rev rev.decimal] - [.#Frac frac.decimal] - [.#Identifier symbol.codec]) + ([.#Bit bit.codec] + [.#Nat nat.decimal] + [.#Int int.decimal] + [.#Rev rev.decimal] + [.#Frac frac.decimal] + [.#Symbol symbol.codec]) [_ {.#Text value}] (text.format value) diff --git a/stdlib/source/library/lux/macro/local.lux b/stdlib/source/library/lux/macro/local.lux index 69b15e99b..498cebc08 100644 --- a/stdlib/source/library/lux/macro/local.lux +++ b/stdlib/source/library/lux/macro/local.lux @@ -101,7 +101,7 @@ (do meta.monad [_ (monad.each meta.monad ..push_one macros) seed meta.seed - g!pop (//.identifier "pop") + g!pop (//.symbol "pop") _ (let [g!pop (: Symbol ["" (//code.format g!pop)])] (..push_one [g!pop (..pop_all (list#each product.left macros) g!pop)]))] diff --git a/stdlib/source/library/lux/macro/syntax.lux b/stdlib/source/library/lux/macro/syntax.lux index e1107fa4e..1f61650f1 100644 --- a/stdlib/source/library/lux/macro/syntax.lux +++ b/stdlib/source/library/lux/macro/syntax.lux @@ -1,7 +1,7 @@ (.module: [library [lux "*" - ["[0]" macro {"+" with_identifiers}] + ["[0]" macro {"+" with_symbols}] ["[0]" meta] [abstract ["[0]" monad {"+" do}]] @@ -48,14 +48,14 @@ (/export.parser ($_ <>.and (</>.form ($_ <>.and - </>.local_identifier + </>.local_symbol (</>.tuple (<>.some </>.any)))) </>.any))) (macro: .public (syntax: tokens) (case (</>.result ..syntax tokens) {try.#Success [export_policy [name args] body]} - (with_identifiers [g!tokens g!body g!error] + (with_symbols [g!tokens g!body g!error] (do [! meta.monad] [_ (if (|> args list.size nat.even?) (in []) @@ -67,19 +67,19 @@ (` ((~! ..self_documenting) (' (~ var)) (~ parser)))])] (case var - [_ {.#Identifier ["" _]}] + [_ {.#Symbol ["" _]}] <default> - [_ {.#Identifier _}] + [_ {.#Symbol _}] (in [var parser]) _ <default>)))) (list.pairs args)) this_module meta.current_module_name - .let [g!state (code.identifier ["" "*lux*"]) + .let [g!state (code.symbol ["" "*lux*"]) error_msg (code.text (macro.wrong_syntax_error [this_module name]))]] - (in (list (` (.macro: (~ export_policy) ((~ (code.identifier ["" name])) (~ g!tokens) (~ g!state)) + (in (list (` (.macro: (~ export_policy) ((~ (code.symbol ["" name])) (~ g!tokens) (~ g!state)) (.case ((~! </>.result) (: ((~! </>.Parser) (Meta (List Code))) ((~! do) (~! <>.monad) diff --git a/stdlib/source/library/lux/macro/syntax/declaration.lux b/stdlib/source/library/lux/macro/syntax/declaration.lux index 1e218f48b..012d5130c 100644 --- a/stdlib/source/library/lux/macro/syntax/declaration.lux +++ b/stdlib/source/library/lux/macro/syntax/declaration.lux @@ -28,17 +28,17 @@ (def: .public parser (Parser Declaration) - (<>.either (<>.and <code>.local_identifier + (<>.either (<>.and <code>.local_symbol (<>#in (list))) - (<code>.form (<>.and <code>.local_identifier - (<>.some <code>.local_identifier))))) + (<code>.form (<>.and <code>.local_symbol + (<>.some <code>.local_symbol))))) (def: .public (format value) (-> Declaration Code) - (let [g!name (code.local_identifier (value@ #name value))] + (let [g!name (code.local_symbol (value@ #name value))] (case (value@ #arguments value) {.#End} g!name arguments - (` ((~ g!name) (~+ (list#each code.local_identifier arguments))))))) + (` ((~ g!name) (~+ (list#each code.local_symbol arguments))))))) diff --git a/stdlib/source/library/lux/macro/syntax/definition.lux b/stdlib/source/library/lux/macro/syntax/definition.lux index d9d83ebd4..be3bb1f8a 100644 --- a/stdlib/source/library/lux/macro/syntax/definition.lux +++ b/stdlib/source/library/lux/macro/syntax/definition.lux @@ -53,7 +53,7 @@ (def: .public (format (^open "_[0]")) (-> Definition Code) (` ((~ (code.text ..extension)) - (~ (code.local_identifier _#name)) + (~ (code.local_symbol _#name)) (~ (case _#value {.#Left check} (//check.format check) @@ -74,7 +74,7 @@ <code>.form (<>.after (<code>.text! ..extension)) ($_ <>.and - <code>.local_identifier + <code>.local_symbol (<>.or //check.parser <code>.any) <code>.bit diff --git a/stdlib/source/library/lux/macro/syntax/export.lux b/stdlib/source/library/lux/macro/syntax/export.lux index 27c74dceb..86b04be16 100644 --- a/stdlib/source/library/lux/macro/syntax/export.lux +++ b/stdlib/source/library/lux/macro/syntax/export.lux @@ -16,11 +16,11 @@ (do [! <>.monad] [candiate <code>.next] (case candiate - [_ {.#Identifier ["" _]}] + [_ {.#Symbol ["" _]}] (in default_policy) (^or [_ {.#Bit _}] - [_ {.#Identifier _}]) + [_ {.#Symbol _}]) (do ! [_ <code>.any] (in candiate)) diff --git a/stdlib/source/library/lux/macro/syntax/type/variable.lux b/stdlib/source/library/lux/macro/syntax/type/variable.lux index 60edd0fcb..d40442b40 100644 --- a/stdlib/source/library/lux/macro/syntax/type/variable.lux +++ b/stdlib/source/library/lux/macro/syntax/type/variable.lux @@ -20,8 +20,8 @@ (def: .public format (-> Variable Code) - code.local_identifier) + code.local_symbol) (def: .public parser (Parser Variable) - <code>.local_identifier) + <code>.local_symbol) diff --git a/stdlib/source/library/lux/macro/template.lux b/stdlib/source/library/lux/macro/template.lux index b6a67cadd..68b57a71d 100644 --- a/stdlib/source/library/lux/macro/template.lux +++ b/stdlib/source/library/lux/macro/template.lux @@ -1,6 +1,6 @@ (.module: [library - [lux {"-" let local macro} + [lux {"-" let local macro symbol} ["[0]" meta] [abstract ["[0]" monad {"+" do}]] @@ -32,15 +32,15 @@ (syntax: .public (amount [parts (<code>.tuple (<>.some <code>.any))]) (in (list (code.nat (list.size parts))))) -(syntax: .public (with_locals [locals (<code>.tuple (<>.some <code>.local_identifier)) +(syntax: .public (with_locals [locals (<code>.tuple (<>.some <code>.local_symbol)) body <code>.any]) (do [! meta.monad] [g!locals (|> locals - (list#each //.identifier) + (list#each //.symbol) (monad.all !))] (in (list (` (.with_expansions [(~+ (|> (list.zipped/2 locals g!locals) - (list#each (function (_ [name identifier]) - (list (code.local_identifier name) (as_is identifier)))) + (list#each (function (_ [name symbol]) + (list (code.local_symbol name) (as_is symbol)))) list#conjoint))] (~ body))))))) @@ -56,13 +56,13 @@ (def: (snippet module_side?) (-> Bit (Parser Text)) - (.let [full_identifier (..symbol_side module_side? <code>.identifier)] + (.let [full_symbol (..symbol_side module_side? <code>.symbol)] ($_ <>.either <code>.text (if module_side? - full_identifier - (<>.either <code>.local_identifier - full_identifier)) + full_symbol + (<>.either <code>.local_symbol + full_symbol)) (<>#each bit#encoded <code>.bit) (<>#each nat#encoded <code>.nat) (<>#each int#encoded <code>.int) @@ -88,7 +88,7 @@ {.#Right simple} (in (list (|> simple (text.interposed "") <simple>)))))] - [identifier code.local_identifier code.identifier] + [symbol code.local_symbol code.symbol] ) (type: Environment @@ -97,7 +97,7 @@ (def: (applied env template) (-> Environment Code Code) (case template - [_ {.#Identifier "" name}] + [_ {.#Symbol "" name}] (case (dictionary.value name env) {.#Some substitute} substitute @@ -143,8 +143,8 @@ (def: local (Parser Local) (do <>.monad - [[name parameters] (<code>.form (<>.and <code>.local_identifier - (<>.many <code>.local_identifier))) + [[name parameters] (<code>.form (<>.and <code>.local_symbol + (<>.many <code>.local_symbol))) template (<code>.tuple (<>.some <code>.any))] (in [#name name #parameters parameters @@ -167,7 +167,7 @@ (..macro local)]) locals))] (if expression? - (//.with_identifiers [g!body] + (//.with_symbols [g!body] (in (list (` (.let [(~ g!body) (~ body)] (exec (~ g!pop) (~ g!body))))))) diff --git a/stdlib/source/library/lux/math/infix.lux b/stdlib/source/library/lux/math/infix.lux index 25a37563a..92c2d1e98 100644 --- a/stdlib/source/library/lux/math/infix.lux +++ b/stdlib/source/library/lux/math/infix.lux @@ -35,7 +35,7 @@ (<>#each code.rev <code>.rev) (<>#each code.frac <code>.frac) (<>#each code.text <code>.text) - (<>#each code.identifier <code>.identifier))) + (<>#each code.symbol <code>.symbol))) (def: expression (Parser Infix) diff --git a/stdlib/source/library/lux/program.lux b/stdlib/source/library/lux/program.lux index b2690af76..0815a2e26 100644 --- a/stdlib/source/library/lux/program.lux +++ b/stdlib/source/library/lux/program.lux @@ -11,7 +11,7 @@ ["<>" parser ["<[0]>" code] ["<[0]>" cli]]] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" code]]]]) @@ -22,12 +22,12 @@ (def: arguments^ (<code>.Parser Arguments) - (<>.or <code>.local_identifier + (<>.or <code>.local_symbol (<code>.tuple (<>.some <code>.any)))) (syntax: .public (program: [args ..arguments^ body <code>.any]) - (with_identifiers [g!program g!args g!_ g!output g!message] + (with_symbols [g!program g!args g!_ g!output g!message] (let [initialization+event_loop (` ((~! do) (~! io.monad) [(~ g!output) (~ body) @@ -40,7 +40,7 @@ (in (list (` ("lux def program" (~ (case args {#Raw args} - (` (.function ((~ g!program) (~ (code.identifier ["" args]))) + (` (.function ((~ g!program) (~ (code.symbol ["" args]))) (~ initialization+event_loop))) {#Parsed args} diff --git a/stdlib/source/library/lux/target/common_lisp.lux b/stdlib/source/library/lux/target/common_lisp.lux index 04e8c791f..b8005d561 100644 --- a/stdlib/source/library/lux/target/common_lisp.lux +++ b/stdlib/source/library/lux/target/common_lisp.lux @@ -32,7 +32,7 @@ (|>> :representation)) (template [<type> <super>] - [(with_expansions [<brand> (template.identifier [<type> "'"])] + [(with_expansions [<brand> (template.symbol [<type> "'"])] (`` (abstract: .public (<brand> brand) Any)) (`` (type: .public (<type> brand) (<super> (<brand> brand)))))] @@ -46,7 +46,7 @@ ) (template [<type> <super>] - [(with_expansions [<brand> (template.identifier [<type> "'"])] + [(with_expansions [<brand> (template.symbol [<type> "'"])] (`` (abstract: .public <brand> Any)) (`` (type: .public <type> (<super> <brand>))))] diff --git a/stdlib/source/library/lux/target/js.lux b/stdlib/source/library/lux/target/js.lux index dc1a4d71b..b6f649c95 100644 --- a/stdlib/source/library/lux/target/js.lux +++ b/stdlib/source/library/lux/target/js.lux @@ -36,7 +36,7 @@ (|>> :representation)) (template [<type> <super>+] - [(with_expansions [<brand> (template.identifier [<type> "'"])] + [(with_expansions [<brand> (template.symbol [<type> "'"])] (abstract: (<brand> brand) Any) (`` (type: .public <type> (|> Any <brand> (~~ (template.spliced <super>+))))))] @@ -47,7 +47,7 @@ ) (template [<type> <super>+] - [(with_expansions [<brand> (template.identifier [<type> "'"])] + [(with_expansions [<brand> (template.symbol [<type> "'"])] (abstract: <brand> Any) (`` (type: .public <type> (|> <brand> (~~ (template.spliced <super>+))))))] diff --git a/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux b/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux index b47e4d4ba..61bb956bd 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux @@ -100,7 +100,7 @@ ) (template [<shift> <name> <inputT> <writer> <unwrap>] - [(with_expansions [<private> (template.identifier ["'" <name>])] + [(with_expansions [<private> (template.symbol ["'" <name>])] (def: (<private> opcode input0) (-> Opcode <inputT> Mutation) (function (_ [offset binary]) @@ -126,7 +126,7 @@ ) (template [<shift> <name> <inputT> <writer>] - [(with_expansions [<private> (template.identifier ["'" <name>])] + [(with_expansions [<private> (template.symbol ["'" <name>])] (def: (<private> opcode input0) (-> Opcode <inputT> Mutation) (function (_ [offset binary]) diff --git a/stdlib/source/library/lux/target/jvm/encoding/signed.lux b/stdlib/source/library/lux/target/jvm/encoding/signed.lux index d07406031..415c7f504 100644 --- a/stdlib/source/library/lux/target/jvm/encoding/signed.lux +++ b/stdlib/source/library/lux/target/jvm/encoding/signed.lux @@ -48,7 +48,7 @@ ["Scope (in bytes)" (%.nat scope)])) (template [<bytes> <name> <size> <constructor> <maximum> <+> <->] - [(with_expansions [<raw> (template.identifier [<name> "'"])] + [(with_expansions [<raw> (template.symbol [<name> "'"])] (abstract: <raw> Any) (type: .public <name> (Signed <raw>))) diff --git a/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux b/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux index 9549340c3..9df045d18 100644 --- a/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux +++ b/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux @@ -60,7 +60,7 @@ ["Subject" (%.nat (:representation subject))])) (template [<bytes> <name> <size> <constructor> <maximum> <+> <-> <max>] - [(with_expansions [<raw> (template.identifier [<name> "'"])] + [(with_expansions [<raw> (template.symbol [<name> "'"])] (abstract: .public <raw> Any) (type: .public <name> (Unsigned <raw>))) diff --git a/stdlib/source/library/lux/target/jvm/modifier.lux b/stdlib/source/library/lux/target/jvm/modifier.lux index 3ab952378..400b341e7 100644 --- a/stdlib/source/library/lux/target/jvm/modifier.lux +++ b/stdlib/source/library/lux/target/jvm/modifier.lux @@ -11,7 +11,7 @@ [data [format ["[0]F" binary {"+" Writer}]]] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" code]] [math @@ -80,7 +80,7 @@ (syntax: .public (modifiers: [ofT <code>.any options (<>.many <code>.any)]) - (with_identifiers [g!modifier g!code] + (with_symbols [g!modifier g!code] (in (list (` (template [(~ g!code) (~ g!modifier)] [(def: (~' .public) (~ g!modifier) (..Modifier (~ ofT)) diff --git a/stdlib/source/library/lux/target/jvm/type/category.lux b/stdlib/source/library/lux/target/jvm/type/category.lux index 177da5322..e3bbface9 100644 --- a/stdlib/source/library/lux/target/jvm/type/category.lux +++ b/stdlib/source/library/lux/target/jvm/type/category.lux @@ -22,7 +22,7 @@ (type: .public Parameter (<| Return' Value' Object' Parameter' Any)) (template [<parents> <child>] - [(with_expansions [<raw> (template.identifier [<child> "'"])] + [(with_expansions [<raw> (template.symbol [<child> "'"])] (abstract: <raw> Any) (type: .public <child> (`` (<| Return' Value' (~~ (template.spliced <parents>)) <raw>))))] diff --git a/stdlib/source/library/lux/target/lua.lux b/stdlib/source/library/lux/target/lua.lux index f06c47ee4..02fe49a51 100644 --- a/stdlib/source/library/lux/target/lua.lux +++ b/stdlib/source/library/lux/target/lua.lux @@ -59,7 +59,7 @@ (|>> :representation)) (template [<type> <super>+] - [(with_expansions [<brand> (template.identifier [<type> "'"])] + [(with_expansions [<brand> (template.symbol [<type> "'"])] (abstract: (<brand> brand) Any) (`` (type: .public <type> (|> Any <brand> (~~ (template.spliced <super>+))))))] @@ -70,7 +70,7 @@ ) (template [<type> <super>+] - [(with_expansions [<brand> (template.identifier [<type> "'"])] + [(with_expansions [<brand> (template.symbol [<type> "'"])] (abstract: <brand> Any) (`` (type: .public <type> (|> <brand> (~~ (template.spliced <super>+))))))] @@ -374,13 +374,13 @@ 0 (.list) _ (|> (-- arity) (enum.range n.enum 0) - (list#each (|>> %.nat code.local_identifier)))))) + (list#each (|>> %.nat code.local_symbol)))))) (syntax: (arity_types [arity <code>.nat]) (in (list.repeated arity (` ..Expression)))) (template [<arity> <function>+] - [(with_expansions [<apply> (template.identifier ["apply/" <arity>]) + [(with_expansions [<apply> (template.symbol ["apply/" <arity>]) <inputs> (arity_inputs <arity>) <types> (arity_types <arity>) <definitions> (template.spliced <function>+)] @@ -389,7 +389,7 @@ (..apply/* (.list <inputs>) function)) (template [<function>] - [(`` (def: .public (~~ (template.identifier [<function> "/" <arity>])) + [(`` (def: .public (~~ (template.symbol [<function> "/" <arity>])) (<apply> (..var <function>))))] <definitions>))] diff --git a/stdlib/source/library/lux/target/php.lux b/stdlib/source/library/lux/target/php.lux index f2b459958..3d477cf34 100644 --- a/stdlib/source/library/lux/target/php.lux +++ b/stdlib/source/library/lux/target/php.lux @@ -67,7 +67,7 @@ (|>> :representation)) (template [<type> <super>+] - [(with_expansions [<brand> (template.identifier [<type> "'"])] + [(with_expansions [<brand> (template.symbol [<type> "'"])] (abstract: (<brand> brand) Any) (`` (type: .public <type> (|> Any <brand> (~~ (template.spliced <super>+))))))] @@ -78,7 +78,7 @@ ) (template [<type> <super>+] - [(with_expansions [<brand> (template.identifier [<type> "'"])] + [(with_expansions [<brand> (template.symbol [<type> "'"])] (abstract: .public <brand> Any) (`` (type: .public <type> (|> <brand> (~~ (template.spliced <super>+))))))] @@ -231,13 +231,13 @@ 0 (.list) _ (|> (-- arity) (enum.range n.enum 0) - (list#each (|>> %.nat code.local_identifier)))))) + (list#each (|>> %.nat code.local_symbol)))))) (syntax: (arity_types [arity <code>.nat]) (in (list.repeated arity (` ..Expression)))) (template [<arity> <function>+] - [(with_expansions [<apply> (template.identifier ["apply/" <arity>]) + [(with_expansions [<apply> (template.symbol ["apply/" <arity>]) <inputs> (arity_inputs <arity>) <types> (arity_types <arity>) <definitions> (template.spliced <function>+)] @@ -246,7 +246,7 @@ (..apply/* (.list <inputs>) function)) (template [<function>] - [(`` (def: .public (~~ (template.identifier [<function> "/" <arity>])) + [(`` (def: .public (~~ (template.symbol [<function> "/" <arity>])) (<apply> (..constant <function>))))] <definitions>))] diff --git a/stdlib/source/library/lux/target/python.lux b/stdlib/source/library/lux/target/python.lux index 17ddfcb4d..064c39bfc 100644 --- a/stdlib/source/library/lux/target/python.lux +++ b/stdlib/source/library/lux/target/python.lux @@ -71,7 +71,7 @@ (|>> :representation)) (template [<type> <super>] - [(with_expansions [<brand> (template.identifier [<type> "'"])] + [(with_expansions [<brand> (template.symbol [<type> "'"])] (`` (abstract: (<brand> brand) Any)) (`` (type: .public (<type> brand) (<super> (<brand> brand)))))] @@ -84,7 +84,7 @@ ) (template [<type> <super>] - [(with_expansions [<brand> (template.identifier [<type> "'"])] + [(with_expansions [<brand> (template.symbol [<type> "'"])] (`` (abstract: <brand> Any)) (`` (type: .public <type> (<super> <brand>))))] @@ -461,13 +461,13 @@ 0 (.list) _ (|> (-- arity) (enum.range n.enum 0) - (list#each (|>> %.nat code.local_identifier)))))) + (list#each (|>> %.nat code.local_symbol)))))) (syntax: (arity_types [arity <code>.nat]) (in (list.repeated arity (` (Expression Any))))) (template [<arity> <function>+] - [(with_expansions [<apply> (template.identifier ["apply/" <arity>]) + [(with_expansions [<apply> (template.symbol ["apply/" <arity>]) <inputs> (arity_inputs <arity>) <types> (arity_types <arity>) <definitions> (template.spliced <function>+)] @@ -476,7 +476,7 @@ (..apply/* function (.list <inputs>))) (template [<function>] - [(`` (def: .public (~~ (template.identifier [<function> "/" <arity>])) + [(`` (def: .public (~~ (template.symbol [<function> "/" <arity>])) (<apply> (..var <function>))))] <definitions>))] diff --git a/stdlib/source/library/lux/target/r.lux b/stdlib/source/library/lux/target/r.lux index 2499ce6c2..6e0b19d2a 100644 --- a/stdlib/source/library/lux/target/r.lux +++ b/stdlib/source/library/lux/target/r.lux @@ -26,7 +26,7 @@ Text (template [<type> <super>+] - [(with_expansions [<kind> (template.identifier [<type> "'"])] + [(with_expansions [<kind> (template.symbol [<type> "'"])] (abstract: .public (<kind> kind) Any) (`` (type: .public <type> (|> Any <kind> (~~ (template.spliced <super>+))))))] @@ -34,7 +34,7 @@ ) (template [<type> <super>+] - [(with_expansions [<kind> (template.identifier [<type> "'"])] + [(with_expansions [<kind> (template.symbol [<type> "'"])] (abstract: .public (<kind> kind) Any) (`` (type: .public (<type> <brand>) (|> <brand> <kind> (~~ (template.spliced <super>+))))))] @@ -208,13 +208,13 @@ 0 (.list) _ (|> arity list.indices - (list#each (|>> %.nat code.local_identifier)))))) + (list#each (|>> %.nat code.local_symbol)))))) (syntax: (arity_types [arity <code>.nat]) (in (list.repeated arity (` ..Expression)))) (template [<arity> <function>+] - [(with_expansions [<apply> (template.identifier ["apply/" <arity>]) + [(with_expansions [<apply> (template.symbol ["apply/" <arity>]) <inputs> (arity_inputs <arity>) <types> (arity_types <arity>) <definitions> (template.spliced <function>+)] @@ -223,7 +223,7 @@ (..apply (.list <inputs>) function)) (template [<function>] - [(`` (def: .public (~~ (template.identifier [<function> "/" <arity>])) + [(`` (def: .public (~~ (template.symbol [<function> "/" <arity>])) (-> [<types>] Expression) (<apply> (..var <function>))))] diff --git a/stdlib/source/library/lux/target/ruby.lux b/stdlib/source/library/lux/target/ruby.lux index 1824a139f..fe641d5da 100644 --- a/stdlib/source/library/lux/target/ruby.lux +++ b/stdlib/source/library/lux/target/ruby.lux @@ -59,7 +59,7 @@ (|>> :representation)) (template [<type> <super>+] - [(with_expansions [<brand> (template.identifier [<type> "'"])] + [(with_expansions [<brand> (template.symbol [<type> "'"])] (abstract: (<brand> brand) Any) (`` (type: .public <type> (|> Any <brand> (~~ (template.spliced <super>+))))))] @@ -72,7 +72,7 @@ ) (template [<type> <super>+] - [(with_expansions [<brand> (template.identifier [<type> "'"])] + [(with_expansions [<brand> (template.symbol [<type> "'"])] (abstract: <brand> Any) (`` (type: .public <type> (|> <brand> (~~ (template.spliced <super>+))))))] @@ -437,13 +437,13 @@ 0 (.list) _ (|> (-- arity) (enum.range n.enum 0) - (list#each (|>> %.nat code.local_identifier)))))) + (list#each (|>> %.nat code.local_symbol)))))) (syntax: (arity_types [arity <code>.nat]) (in (list.repeated arity (` ..Expression)))) (template [<arity> <function>+] - [(with_expansions [<apply> (template.identifier ["apply/" <arity>]) + [(with_expansions [<apply> (template.symbol ["apply/" <arity>]) <inputs> (arity_inputs <arity>) <types> (arity_types <arity>) <definitions> (template.spliced <function>+)] @@ -452,7 +452,7 @@ (..apply/* (.list <inputs>) function)) (template [<function>] - [(`` (def: .public (~~ (template.identifier [<function> "/" <arity>])) + [(`` (def: .public (~~ (template.symbol [<function> "/" <arity>])) (<apply> (..local <function>))))] <definitions>))] diff --git a/stdlib/source/library/lux/test.lux b/stdlib/source/library/lux/test.lux index 92b90dcbb..802320de4 100644 --- a/stdlib/source/library/lux/test.lux +++ b/stdlib/source/library/lux/test.lux @@ -284,7 +284,7 @@ (code.tuple (list (code.text (symbol.module symbol)) (code.text (symbol.short symbol))))) -(syntax: (reference [name <code>.identifier]) +(syntax: (reference [name <code>.symbol]) (do meta.monad [_ (meta.export name)] (in (list (symbol_code name))))) @@ -345,7 +345,7 @@ [(revised@ #expected_coverage (set.union coverage) tally) documentation])))))) -(syntax: .public (covering [module <code>.identifier +(syntax: .public (covering [module <code>.symbol test <code>.any]) (do meta.monad [.let [module (symbol.module module)] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux b/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux index 8133275b1..108e94a40 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux @@ -1,6 +1,6 @@ (.module: [library - [lux {"-" Module} + [lux {"-" Module symbol} [abstract [monad {"+" do}]] [control @@ -178,7 +178,7 @@ _ (extension.update (revised@ #counter ++))] (in count))) -(def: .public (identifier prefix) +(def: .public (symbol prefix) (All (_ anchor expression directive) (-> Text (Operation anchor expression directive Text))) (# phase.monad each (|>> %.nat (format prefix)) ..next)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux index ace3fcee8..7f0b63249 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux @@ -56,7 +56,7 @@ [.#Frac /primitive.frac] [.#Text /primitive.text]) - (^ {.#Variant (list& [_ {.#Identifier tag}] + (^ {.#Variant (list& [_ {.#Symbol tag}] values)}) (case values {.#Item value {.#End}} @@ -83,7 +83,7 @@ (def: (compile|others expander archive compile code') (-> Expander Archive Phase (-> (Code' (Ann Location)) (Operation Analysis))) (case code' - {.#Identifier reference} + {.#Symbol reference} (/reference.reference reference) (^ {.#Form (list [_ {.#Variant branches}] input)}) @@ -94,8 +94,8 @@ (^ {.#Form (list& [_ {.#Text extension_name}] extension_args)}) (//extension.apply archive compile [extension_name extension_args]) - (^ {.#Form (list [_ {.#Tuple (list [_ {.#Identifier ["" function_name]}] - [_ {.#Identifier ["" arg_name]}])}] + (^ {.#Form (list [_ {.#Tuple (list [_ {.#Symbol ["" function_name]}] + [_ {.#Symbol ["" arg_name]}])}] body)}) (/function.function compile function_name arg_name archive body) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux index 146ea09cf..c0cd0f8c2 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux @@ -222,7 +222,7 @@ (def: (analyse_pattern num_tags inputT pattern next) (All (_ a) (-> (Maybe Nat) Type Code (Operation a) (Operation [Pattern a]))) (.case pattern - [location {.#Identifier ["" name]}] + [location {.#Symbol ["" name]}] (/.with_location location (do ///.monad [outputA (//scope.with_local [name inputT] @@ -314,7 +314,7 @@ _ (/.except ..cannot_match_with_pattern [inputT' pattern])))) - (^ [location {.#Variant (list& [_ {.#Identifier tag}] values)}]) + (^ [location {.#Variant (list& [_ {.#Symbol tag}] values)}]) (/.with_location location (do ///.monad [tag (///extension.lifted (meta.normal tag)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux index 8de445db6..f8101daf3 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux @@ -77,10 +77,10 @@ [(exception: .public (<name> [key Symbol record (List [Symbol Code])]) (exception.report - ["Tag" (%.code (code.identifier key))] + ["Tag" (%.code (code.symbol key))] ["Record" (%.code (code.tuple (|> record (list#each (function (_ [keyI valC]) - (list (code.identifier keyI) valC))) + (list (code.symbol keyI) valC))) list#conjoint)))]))] [cannot_repeat_slot] @@ -89,7 +89,7 @@ (exception: .public (slot_does_not_belong_to_record [key Symbol type Type]) (exception.report - ["Tag" (%.code (code.identifier key))] + ["Tag" (%.code (code.symbol key))] ["Type" (%.type type)])) (exception: .public (record_size_mismatch [expected Nat @@ -102,7 +102,7 @@ ["Type" (%.type type)] ["Expression" (%.code (|> record (list#each (function (_ [keyI valueC]) - (list (code.identifier keyI) valueC))) + (list (code.symbol keyI) valueC))) list#conjoint code.tuple))])) @@ -311,7 +311,7 @@ output (: (List [Symbol Code]) {.#End})] (case input - (^ (list& [_ {.#Identifier slotH}] valueH tail)) + (^ (list& [_ {.#Symbol slotH}] valueH tail)) (do ///.monad [slotH (///extension.lifted (meta.normal slotH))] (recur tail {.#Item [slotH valueH] output})) @@ -381,7 +381,7 @@ (^ (list singletonC)) (analyse archive singletonC) - (^ (list [_ {.#Identifier pseudo_slot}] singletonC)) + (^ (list [_ {.#Symbol pseudo_slot}] singletonC)) (do [! ///.monad] [head_k (///extension.lifted (meta.normal pseudo_slot)) slot (///extension.lifted (meta.try (meta.slot head_k)))] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux index 5a0abb14d..bc21d4cab 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux @@ -219,7 +219,7 @@ (-> Expander /////analysis.Bundle Handler) (function (_ extension_name phase archive inputsC+) (case inputsC+ - (^ (list [_ {.#Identifier ["" short_name]}] valueC exported?C)) + (^ (list [_ {.#Symbol ["" short_name]}] valueC exported?C)) (do phase.monad [current_module (/////directive.lifted_analysis (///.lifted meta.current_module_name)) @@ -247,7 +247,7 @@ (def: (def::type_tagged expander host_analysis) (-> Expander /////analysis.Bundle Handler) (..custom - [($_ <>.and <code>.local_identifier <code>.any + [($_ <>.and <code>.local_symbol <code>.any (<>.or (<code>.variant (<>.some <code>.text)) (<code>.tuple (<>.some <code>.text))) <code>.any) @@ -339,7 +339,7 @@ (def: def::alias Handler (..custom - [($_ <>.and <code>.local_identifier <code>.identifier) + [($_ <>.and <code>.local_symbol <code>.symbol) (function (_ extension_name phase archive [alias def_name]) (do phase.monad [_ (///.lifted diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux index bdc1114ac..482033355 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux @@ -64,7 +64,7 @@ ... <s>.any)))) ... (function (_ extension_name phase archive [input else conditionals]) ... (do [! /////.monad] -... [@input (# ! each _.var (generation.identifier "input")) +... [@input (# ! each _.var (generation.symbol "input")) ... inputG (phase archive input) ... elseG (phase archive else) ... conditionalsG (: (Operation (List [Expression Expression])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/host.lux index 8a83d334d..69281ea06 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/host.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/host.lux @@ -133,7 +133,7 @@ (do [! ////////phase.monad] [abstractionG (phase archive abstractionS) .let [variable (: (-> Text (Operation Var)) - (|>> generation.identifier + (|>> generation.symbol (# ! each _.var)))] g!inputs (monad.each ! (function (_ _) (variable "input")) (list.repeated (.nat arity) [])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux index 7d7e431c1..637ade6fb 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux @@ -117,7 +117,7 @@ (do [! /////.monad] [inputG (phase archive input) else! (..statement phase archive else) - @input (# ! each _.var (generation.identifier "input")) + @input (# ! each _.var (generation.symbol "input")) conditionals! (: (Operation (List [Expression Statement])) (monad.each ! (function (_ [chars branch]) (do ! diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/host.lux index 2bcd95a66..ef4309089 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/host.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/host.lux @@ -171,7 +171,7 @@ (do [! ////////phase.monad] [abstractionG (phase archive abstractionS) .let [variable (: (-> Text (Operation Var)) - (|>> generation.identifier + (|>> generation.symbol (# ! each _.var)))] g!inputs (monad.each ! (function (_ _) (variable "input")) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux index b218eeb31..b7f210d65 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux @@ -67,7 +67,7 @@ [inputG (phase archive input) [[context_module context_artifact] elseG] (generation.with_new_context archive (phase archive else)) - @input (# ! each _.var (generation.identifier "input")) + @input (# ! each _.var (generation.symbol "input")) conditionalsG (: (Operation (List [Expression Expression])) (monad.each ! (function (_ [chars branch]) (do ! diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux index e7c312c0a..5f7cb433f 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux @@ -110,7 +110,7 @@ (do [! /////.monad] [inputG (phase archive input) else! (..statement phase archive else) - @input (# ! each _.var (generation.identifier "input")) + @input (# ! each _.var (generation.symbol "input")) conditionals! (: (Operation (List [(Expression Any) (Statement Any)])) (monad.each ! (function (_ [chars branch]) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/host.lux index 7c257467b..c1fcde536 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/host.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/host.lux @@ -131,7 +131,7 @@ (do [! ////////phase.monad] [abstractionG (phase archive abstractionS) .let [variable (: (-> Text (Operation SVar)) - (|>> generation.identifier + (|>> generation.symbol (# ! each _.var)))] g!inputs (monad.each ! (function (_ _) (variable "input")) (list.repeated (.nat arity) []))] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/r/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/r/common.lux index 854ad42bc..6d6ddd25d 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/r/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/r/common.lux @@ -64,7 +64,7 @@ ... ... <s>.any)))) ... ... (function (_ extension_name phase archive [input else conditionals]) ... ... (do [! /////.monad] -... ... [@input (# ! each _.var (generation.identifier "input")) +... ... [@input (# ! each _.var (generation.symbol "input")) ... ... inputG (phase archive input) ... ... elseG (phase archive else) ... ... conditionalsG (: (Operation (List [Expression Expression])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux index 607320bbb..3be90b82c 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux @@ -109,7 +109,7 @@ (do [! /////.monad] [inputG (phase archive input) else! (statement phase archive else) - @input (# ! each _.local (generation.identifier "input")) + @input (# ! each _.local (generation.symbol "input")) conditionals! (: (Operation (List [Expression Statement])) (monad.each ! (function (_ [chars branch]) (do ! diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/scheme/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/scheme/common.lux index d22c8d075..417205477 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/scheme/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/scheme/common.lux @@ -64,7 +64,7 @@ <s>.any)))) (function (_ extension_name phase archive [input else conditionals]) (do [! /////.monad] - [@input (# ! each _.var (generation.identifier "input")) + [@input (# ! each _.var (generation.symbol "input")) inputG (phase archive input) elseG (phase archive else) conditionalsG (: (Operation (List [Expression Expression])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/function.lux index 9c585b13b..6a7ac6314 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/function.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/function.lux @@ -48,7 +48,7 @@ _ (do [! ///////phase.monad] - [@closure (# ! each _.var (/////generation.identifier "closure"))] + [@closure (# ! each _.var (/////generation.symbol "closure"))] (in (_.labels (list [@closure [(|> (list.enumeration inits) (list#each (|>> product.left ..capture)) _.args) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux index 8180b15b0..acb4af284 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux @@ -87,31 +87,31 @@ (-> (Expression Any) (Computation Any)) (|>> [1 #1] ..variant)) -(syntax: .public (with_vars [vars (<code>.tuple (<>.some <code>.local_identifier)) +(syntax: .public (with_vars [vars (<code>.tuple (<>.some <code>.local_symbol)) body <code>.any]) (do [! meta.monad] [ids (monad.all ! (list.repeated (list.size vars) meta.seed))] (in (list (` (let [(~+ (|> vars (list.zipped/2 ids) (list#each (function (_ [id var]) - (list (code.local_identifier var) + (list (code.local_symbol var) (` (_.var (~ (code.text (format "v" (%.nat id))))))))) list.together))] (~ body))))))) -(syntax: (runtime: [declaration (<>.or <code>.local_identifier - (<code>.form (<>.and <code>.local_identifier - (<>.some <code>.local_identifier)))) +(syntax: (runtime: [declaration (<>.or <code>.local_symbol + (<code>.form (<>.and <code>.local_symbol + (<>.some <code>.local_symbol)))) code <code>.any]) (do meta.monad [runtime_id meta.seed] - (macro.with_identifiers [g!_] - (let [runtime (code.local_identifier (///reference.artifact [..module_id runtime_id])) + (macro.with_symbols [g!_] + (let [runtime (code.local_symbol (///reference.artifact [..module_id runtime_id])) runtime_name (` (_.var (~ (code.text (%.code runtime)))))] (case declaration {.#Left name} - (let [g!name (code.local_identifier name) - code_nameC (code.local_identifier (format "@" name))] + (let [g!name (code.local_symbol name) + code_nameC (code.local_symbol (format "@" name))] (in (list (` (def: .public (~ g!name) _.Var/1 (~ runtime_name))) @@ -121,10 +121,10 @@ (_.defparameter (~ runtime_name) (~ code))))))) {.#Right [name inputs]} - (let [g!name (code.local_identifier name) - code_nameC (code.local_identifier (format "@" name)) + (let [g!name (code.local_symbol name) + code_nameC (code.local_symbol (format "@" name)) - inputsC (list#each code.local_identifier inputs) + inputsC (list#each code.local_symbol inputs) inputs_typesC (list#each (function.constant (` (_.Expression Any))) inputs)] (in (list (` (def: .public ((~ g!name) (~+ inputsC)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux index 686e9934e..42f9e9188 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux @@ -10,7 +10,7 @@ [collection ["[0]" list ("[1]#[0]" functor)]]] ["[0]" meta] - ["[0]" macro {"+" with_identifiers} + ["[0]" macro {"+" with_symbols} ["[0]" code] [syntax {"+" syntax:}]]]] ["[0]" /// "_" @@ -32,12 +32,12 @@ (type: .public (Variadic of) (-> (List of) of)) (syntax: (arity: [arity <code>.nat - name <code>.local_identifier + name <code>.local_symbol type <code>.any]) - (with_identifiers [g!_ g!extension g!name g!phase g!archive g!inputs g!of g!anchor g!expression g!directive] + (with_symbols [g!_ g!extension g!name g!phase g!archive g!inputs g!of g!anchor g!expression g!directive] (do [! meta.monad] - [g!input+ (monad.all ! (list.repeated arity (macro.identifier "input")))] - (in (list (` (def: .public ((~ (code.local_identifier name)) (~ g!extension)) + [g!input+ (monad.all ! (list.repeated arity (macro.symbol "input")))] + (in (list (` (def: .public ((~ (code.local_symbol name)) (~ g!extension)) (All ((~ g!_) (~ g!anchor) (~ g!expression) (~ g!directive)) (-> ((~ type) (~ g!expression)) (generation.Handler (~ g!anchor) (~ g!expression) (~ g!directive)))) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux index e93f01032..c935522f2 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux @@ -85,46 +85,46 @@ (-> Var (-> Var Expression) Statement) (_.define name (definition name))) -(syntax: .public (with_vars [vars (<code>.tuple (<>.some <code>.local_identifier)) +(syntax: .public (with_vars [vars (<code>.tuple (<>.some <code>.local_symbol)) body <code>.any]) (do [! meta.monad] [ids (monad.all ! (list.repeated (list.size vars) meta.seed))] (in (list (` (let [(~+ (|> vars (list.zipped/2 ids) (list#each (function (_ [id var]) - (list (code.local_identifier var) + (list (code.local_symbol var) (` (_.var (~ (code.text (format "v" (%.nat id))))))))) list.together))] (~ body))))))) -(syntax: (runtime: [declaration (<>.or <code>.local_identifier - (<code>.form (<>.and <code>.local_identifier - (<>.some <code>.local_identifier)))) +(syntax: (runtime: [declaration (<>.or <code>.local_symbol + (<code>.form (<>.and <code>.local_symbol + (<>.some <code>.local_symbol)))) code <code>.any]) - (macro.with_identifiers [g!_ runtime] + (macro.with_symbols [g!_ runtime] (let [runtime_name (` (_.var (~ (code.text (%.code runtime)))))] (case declaration {.#Left name} - (let [g!name (code.local_identifier name)] + (let [g!name (code.local_symbol name)] (in (list (` (def: .public (~ g!name) Var (~ runtime_name))) - (` (def: (~ (code.local_identifier (format "@" name))) + (` (def: (~ (code.local_symbol (format "@" name))) Statement (..feature (~ runtime_name) (function ((~ g!_) (~ g!name)) (~ code)))))))) {.#Right [name inputs]} - (let [g!name (code.local_identifier name) - inputsC (list#each code.local_identifier inputs) + (let [g!name (code.local_symbol name) + inputsC (list#each code.local_symbol inputs) inputs_typesC (list#each (function.constant (` _.Expression)) inputs)] (in (list (` (def: .public ((~ g!name) (~+ inputsC)) (-> (~+ inputs_typesC) Computation) (_.apply/* (~ runtime_name) (list (~+ inputsC))))) - (` (def: (~ (code.local_identifier (format "@" name))) + (` (def: (~ (code.local_symbol (format "@" name))) Statement (..feature (~ runtime_name) (function ((~ g!_) (~ g!_)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux index b8216596f..b1f3932b2 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux @@ -102,14 +102,14 @@ (-> Var (-> Var Statement) Statement) (definition name)) -(syntax: .public (with_vars [vars (<code>.tuple (<>.some <code>.local_identifier)) +(syntax: .public (with_vars [vars (<code>.tuple (<>.some <code>.local_symbol)) body <code>.any]) (do [! meta.monad] [ids (monad.all ! (list.repeated (list.size vars) meta.seed))] (in (list (` (let [(~+ (|> vars (list.zipped/2 ids) (list#each (function (_ [id var]) - (list (code.local_identifier var) + (list (code.local_symbol var) (` (_.var (~ (code.text (format "v" (%.nat id))))))))) list.together))] (~ body))))))) @@ -117,40 +117,40 @@ (def: module_id 0) -(syntax: (runtime: [declaration (<>.or <code>.local_identifier - (<code>.form (<>.and <code>.local_identifier - (<>.some <code>.local_identifier)))) +(syntax: (runtime: [declaration (<>.or <code>.local_symbol + (<code>.form (<>.and <code>.local_symbol + (<>.some <code>.local_symbol)))) code <code>.any]) (do meta.monad [runtime_id meta.seed] - (macro.with_identifiers [g!_] - (let [runtime (code.local_identifier (///reference.artifact [..module_id runtime_id])) + (macro.with_symbols [g!_] + (let [runtime (code.local_symbol (///reference.artifact [..module_id runtime_id])) runtime_name (` (_.var (~ (code.text (%.code runtime)))))] (case declaration {.#Left name} - (macro.with_identifiers [g!_] - (let [g!name (code.local_identifier name)] + (macro.with_symbols [g!_] + (let [g!name (code.local_symbol name)] (in (list (` (def: .public (~ g!name) Var (~ runtime_name))) - (` (def: (~ (code.local_identifier (format "@" name))) + (` (def: (~ (code.local_symbol (format "@" name))) Statement (..feature (~ runtime_name) (function ((~ g!_) (~ g!name)) (_.set (~ g!name) (~ code)))))))))) {.#Right [name inputs]} - (macro.with_identifiers [g!_] - (let [g!name (code.local_identifier name) - inputsC (list#each code.local_identifier inputs) + (macro.with_symbols [g!_] + (let [g!name (code.local_symbol name) + inputsC (list#each code.local_symbol inputs) inputs_typesC (list#each (function.constant (` _.Expression)) inputs)] (in (list (` (def: .public ((~ g!name) (~+ inputsC)) (-> (~+ inputs_typesC) Computation) (_.apply/* (list (~+ inputsC)) (~ runtime_name)))) - (` (def: (~ (code.local_identifier (format "@" name))) + (` (def: (~ (code.local_symbol (format "@" name))) Statement (..feature (~ runtime_name) (function ((~ g!_) (~ g!_)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux index 3dc089d50..1b29003d1 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux @@ -70,14 +70,14 @@ (-> Constant (-> Constant Statement) Statement) (definition name)) -(syntax: .public (with_vars [vars (<code>.tuple (<>.some <code>.local_identifier)) +(syntax: .public (with_vars [vars (<code>.tuple (<>.some <code>.local_symbol)) body <code>.any]) (do [! meta.monad] [ids (monad.all ! (list.repeated (list.size vars) meta.seed))] (in (list (` (let [(~+ (|> vars (list.zipped/2 ids) (list#each (function (_ [id var]) - (list (code.local_identifier var) + (list (code.local_symbol var) (` (_.var (~ (code.text (format "v" (%.nat id))))))))) list.together))] (~ body))))))) @@ -85,40 +85,40 @@ (def: module_id 0) -(syntax: (runtime: [declaration (<>.or <code>.local_identifier - (<code>.form (<>.and <code>.local_identifier - (<>.some <code>.local_identifier)))) +(syntax: (runtime: [declaration (<>.or <code>.local_symbol + (<code>.form (<>.and <code>.local_symbol + (<>.some <code>.local_symbol)))) code <code>.any]) (do meta.monad [runtime_id meta.seed] - (macro.with_identifiers [g!_] - (let [runtime (code.local_identifier (///reference.artifact [..module_id runtime_id])) + (macro.with_symbols [g!_] + (let [runtime (code.local_symbol (///reference.artifact [..module_id runtime_id])) runtime_name (` (_.constant (~ (code.text (%.code runtime)))))] (case declaration {.#Left name} - (macro.with_identifiers [g!_] - (let [g!name (code.local_identifier name)] + (macro.with_symbols [g!_] + (let [g!name (code.local_symbol name)] (in (list (` (def: .public (~ g!name) Var (~ runtime_name))) - (` (def: (~ (code.local_identifier (format "@" name))) + (` (def: (~ (code.local_symbol (format "@" name))) Statement (..feature (~ runtime_name) (function ((~ g!_) (~ g!name)) (_.define (~ g!name) (~ code)))))))))) {.#Right [name inputs]} - (macro.with_identifiers [g!_] - (let [g!name (code.local_identifier name) - inputsC (list#each code.local_identifier inputs) + (macro.with_symbols [g!_] + (let [g!name (code.local_symbol name) + inputsC (list#each code.local_symbol inputs) inputs_typesC (list#each (function.constant (` _.Expression)) inputs)] (in (list (` (def: .public ((~ g!name) (~+ inputsC)) (-> (~+ inputs_typesC) Computation) (_.apply/* (list (~+ inputsC)) (~ runtime_name)))) - (` (def: (~ (code.local_identifier (format "@" name))) + (` (def: (~ (code.local_symbol (format "@" name))) Statement (..feature (~ runtime_name) (function ((~ g!_) (~ g!_)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux index 88a0f48ad..41f22d6e1 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux @@ -1,6 +1,6 @@ (.module: [library - [lux {"-" case let if} + [lux {"-" case let if symbol} [abstract ["[0]" monad {"+" do}]] [data @@ -34,7 +34,7 @@ [meta [archive {"+" Archive}]]]]]]]) -(def: .public (identifier prefix) +(def: .public (symbol prefix) (-> Text (Operation SVar)) (///////phase#each (|>> %.nat (format prefix) _.var) /////generation.next)) @@ -279,7 +279,7 @@ (do ! [pre! (recur preP) post! (recur postP) - g!once (..identifier "once")] + g!once (..symbol "once")] (in (..alternation in_closure? g!once pre! post!))) _ @@ -289,7 +289,7 @@ (-> Bit Phase! Phase Archive Path (Operation (Statement Any))) (do ///////phase.monad [pattern_matching! (pattern_matching' in_closure? statement expression archive pathP) - g!once (..identifier "once")] + g!once (..symbol "once")] (in ($_ _.then (..with_looping in_closure? g!once pattern_matching!) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/loop.lux index 570d262d7..5579c4d48 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/loop.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/loop.lux @@ -110,7 +110,7 @@ (Generator! (List Synthesis)) (do [! ///////phase.monad] [offset /////generation.anchor - @temp (//case.identifier "lux_recur_values") + @temp (//case.symbol "lux_recur_values") argsO+ (monad.each ! (expression archive) argsS+) .let [re_binds (|> argsO+ list.enumeration diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux index a4948041f..3615afcb5 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux @@ -100,36 +100,36 @@ (def: (runtime_name name) (-> Text SVar) - (let [identifier (format ..prefix - "_" (%.nat $.version) - "_" (%.nat (text#hash name)))] - (_.var identifier))) + (let [symbol (format ..prefix + "_" (%.nat $.version) + "_" (%.nat (text#hash name)))] + (_.var symbol))) (def: (feature name definition) (-> SVar (-> SVar (Statement Any)) (Statement Any)) (definition name)) -(syntax: .public (with_vars [vars (<code>.tuple (<>.some <code>.local_identifier)) +(syntax: .public (with_vars [vars (<code>.tuple (<>.some <code>.local_symbol)) body <code>.any]) (do [! meta.monad] [ids (monad.all ! (list.repeated (list.size vars) meta.seed))] (in (list (` (let [(~+ (|> vars (list.zipped/2 ids) (list#each (function (_ [id var]) - (list (code.local_identifier var) + (list (code.local_symbol var) (` (_.var (~ (code.text (format "v" (%.nat id))))))))) list.together))] (~ body))))))) -(syntax: (runtime: [declaration (<>.or <code>.local_identifier - (<code>.form (<>.and <code>.local_identifier - (<>.some <code>.local_identifier)))) +(syntax: (runtime: [declaration (<>.or <code>.local_symbol + (<code>.form (<>.and <code>.local_symbol + (<>.some <code>.local_symbol)))) code <code>.any]) (case declaration {.#Left name} - (macro.with_identifiers [g!_] - (let [nameC (code.local_identifier name) - code_nameC (code.local_identifier (format "@" name)) + (macro.with_symbols [g!_] + (let [nameC (code.local_symbol name) + code_nameC (code.local_symbol (format "@" name)) runtime_nameC (` (runtime_name (~ (code.text name))))] (in (list (` (def: .public (~ nameC) SVar (~ runtime_nameC))) (` (def: (~ code_nameC) @@ -139,11 +139,11 @@ (_.set (list (~ g!_)) (~ code)))))))))) {.#Right [name inputs]} - (macro.with_identifiers [g!_] - (let [nameC (code.local_identifier name) - code_nameC (code.local_identifier (format "@" name)) + (macro.with_symbols [g!_] + (let [nameC (code.local_symbol name) + code_nameC (code.local_symbol (format "@" name)) runtime_nameC (` (runtime_name (~ (code.text name)))) - inputsC (list#each code.local_identifier inputs) + inputsC (list#each code.local_symbol inputs) inputs_typesC (list#each (function.constant (` (_.Expression Any))) inputs)] (in (list (` (def: .public ((~ nameC) (~+ inputsC)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/loop.lux index 29bd92b23..3e7bcf927 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/loop.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/loop.lux @@ -43,7 +43,7 @@ ... true loop _ (do [! ///////phase.monad] - [$scope (# ! each _.var (/////generation.identifier "loop_scope")) + [$scope (# ! each _.var (/////generation.symbol "loop_scope")) initsO+ (monad.each ! (expression archive) initsS+) bodyO (/////generation.with_anchor $scope (expression archive bodyS))] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux index d61ff76b1..f45c9c04d 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux @@ -10,7 +10,7 @@ [number] (coll [list "list/" Functor<List>] (dictionary ["dict" unordered {"+" Dict}]))) - [macro {"+" with_identifiers}] + [macro {"+" with_symbols}] (macro [code] ["s" syntax {"+" syntax:}]) [host]) @@ -63,12 +63,12 @@ "Expected: " (|> expected .int %i) "\n" " Actual: " (|> actual .int %i))) -(syntax: (arity: [name s.local_identifier +(syntax: (arity: [name s.local_symbol arity s.nat]) - (with_identifiers [g!_ g!proc g!name g!translate g!inputs] + (with_symbols [g!_ g!proc g!name g!translate g!inputs] (do [@ macro.monad] - [g!input+ (monad.all @ (list.repeated arity (macro.identifier "input")))] - (in (list (` (def: .public ((~ (code.local_identifier name)) (~ g!proc)) + [g!input+ (monad.all @ (list.repeated arity (macro.symbol "input")))] + (in (list (` (def: .public ((~ (code.local_symbol name)) (~ g!proc)) (-> (-> (..Vector (~ (code.nat arity)) Expression) Expression) (-> Text ..Proc)) (function ((~ g!_) (~ g!name)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux index fae9bcf9f..e3523fe0f 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux @@ -76,48 +76,48 @@ ... else (.int input))) -(syntax: .public (with_vars [vars (<code>.tuple (<>.some <code>.local_identifier)) +(syntax: .public (with_vars [vars (<code>.tuple (<>.some <code>.local_symbol)) body <code>.any]) (do [! meta.monad] [ids (monad.all ! (list.repeated (list.size vars) meta.seed))] (in (list (` (let [(~+ (|> vars (list.zipped/2 ids) (list#each (function (_ [id var]) - (list (code.local_identifier var) + (list (code.local_symbol var) (` (_.var (~ (code.text (format "v" (%.nat id))))))))) list.together))] (~ body))))))) -(syntax: (runtime: [declaration (<>.or <code>.local_identifier - (<code>.form (<>.and <code>.local_identifier - (<>.some <code>.local_identifier)))) +(syntax: (runtime: [declaration (<>.or <code>.local_symbol + (<code>.form (<>.and <code>.local_symbol + (<>.some <code>.local_symbol)))) code <code>.any]) (do meta.monad [runtime_id meta.seed] - (macro.with_identifiers [g!_] - (let [runtime (code.local_identifier (///reference.artifact [..module_id runtime_id])) + (macro.with_symbols [g!_] + (let [runtime (code.local_symbol (///reference.artifact [..module_id runtime_id])) runtime_name (` (_.var (~ (code.text (%.code runtime)))))] (case declaration {.#Left name} - (let [g!name (code.local_identifier name)] + (let [g!name (code.local_symbol name)] (in (list (` (def: .public (~ g!name) _.SVar (~ runtime_name))) - (` (def: (~ (code.local_identifier (format "@" name))) + (` (def: (~ (code.local_symbol (format "@" name))) _.Expression (_.set! (~ runtime_name) (~ code))))))) {.#Right [name inputs]} - (let [g!name (code.local_identifier name) - inputsC (list#each code.local_identifier inputs) + (let [g!name (code.local_symbol name) + inputsC (list#each code.local_symbol inputs) inputs_typesC (list#each (function.constant (` _.Expression)) inputs)] (in (list (` (def: .public ((~ g!name) (~+ inputsC)) (-> (~+ inputs_typesC) _.Expression) (_.apply (list (~+ inputsC)) (~ runtime_name)))) - (` (def: (~ (code.local_identifier (format "@" name))) + (` (def: (~ (code.local_symbol (format "@" name))) _.Expression (..with_vars [(~+ inputsC)] (_.set! (~ runtime_name) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux index f43fc7a9f..d6f4d2a2b 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux @@ -1,6 +1,6 @@ (.module: [library - [lux {"-" case let if} + [lux {"-" case let if symbol} [abstract ["[0]" monad {"+" do}]] [control @@ -36,7 +36,7 @@ [meta [archive {"+" Archive}]]]]]]]) -(def: .public (identifier prefix) +(def: .public (symbol prefix) (-> Text (Operation LVar)) (///////phase#each (|>> %.nat (format prefix) _.local) /////generation.next)) @@ -322,16 +322,16 @@ (do ///////phase.monad [pre! (recur preP) post! (recur postP) - g!once (..identifier "once") - g!continue? (..identifier "continue")] + g!once (..symbol "once") + g!continue? (..symbol "continue")] (in (..alternation in_closure? g!once g!continue? pre! post!)))))))) (def: (pattern_matching in_closure? statement expression archive pathP) (-> Bit (Generator! Path)) (do ///////phase.monad [pattern_matching! (pattern_matching' in_closure? statement expression archive pathP) - g!once (..identifier "once") - g!continue? (..identifier "continue")] + g!once (..symbol "once") + g!continue? (..symbol "continue")] (in ($_ _.then (..with_looping in_closure? g!once g!continue? pattern_matching!) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux index 70cb4a42a..9ff64de7f 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux @@ -84,7 +84,7 @@ (Generator! (List Synthesis)) (do [! ///////phase.monad] [offset /////generation.anchor - @temp (//case.identifier "lux_recur_values") + @temp (//case.symbol "lux_recur_values") argsO+ (monad.each ! (expression archive) argsS+) .let [re_binds (|> argsO+ list.enumeration diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux index 1dd09a7b2..e5657407e 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux @@ -71,14 +71,14 @@ (-> LVar (-> LVar Statement) Statement) (definition name)) -(syntax: .public (with_vars [vars (<code>.tuple (<>.some <code>.local_identifier)) +(syntax: .public (with_vars [vars (<code>.tuple (<>.some <code>.local_symbol)) body <code>.any]) (do [! meta.monad] [ids (monad.all ! (list.repeated (list.size vars) meta.seed))] (in (list (` (let [(~+ (|> vars (list.zipped/2 ids) (list#each (function (_ [id var]) - (list (code.local_identifier var) + (list (code.local_symbol var) (` (_.local (~ (code.text (format "v" (%.nat id))))))))) list.together))] (~ body))))))) @@ -86,37 +86,37 @@ (def: module_id 0) -(syntax: (runtime: [declaration (<>.or <code>.local_identifier - (<code>.form (<>.and <code>.local_identifier - (<>.some <code>.local_identifier)))) +(syntax: (runtime: [declaration (<>.or <code>.local_symbol + (<code>.form (<>.and <code>.local_symbol + (<>.some <code>.local_symbol)))) code <code>.any]) (do meta.monad [runtime_id meta.seed] - (macro.with_identifiers [g!_] - (let [runtime (code.local_identifier (///reference.artifact [..module_id runtime_id])) + (macro.with_symbols [g!_] + (let [runtime (code.local_symbol (///reference.artifact [..module_id runtime_id])) runtime_name (` (_.local (~ (code.text (%.code runtime)))))] (case declaration {.#Left name} - (macro.with_identifiers [g!_] - (let [g!name (code.local_identifier name)] + (macro.with_symbols [g!_] + (let [g!name (code.local_symbol name)] (in (list (` (def: .public (~ g!name) LVar (~ runtime_name))) - (` (def: (~ (code.local_identifier (format "@" name))) + (` (def: (~ (code.local_symbol (format "@" name))) Statement (..feature (~ runtime_name) (function ((~ g!_) (~ g!name)) (_.set (list (~ g!name)) (~ code)))))))))) {.#Right [name inputs]} - (macro.with_identifiers [g!_] - (let [g!name (code.local_identifier name) - inputsC (list#each code.local_identifier inputs) + (macro.with_symbols [g!_] + (let [g!name (code.local_symbol name) + inputsC (list#each code.local_symbol inputs) inputs_typesC (list#each (function.constant (` _.Expression)) inputs)] (in (list (` (def: .public ((~ g!name) (~+ inputsC)) (-> (~+ inputs_typesC) Computation) (_.apply/* (list (~+ inputsC)) (~ runtime_name)))) - (` (def: (~ (code.local_identifier (format "@" name))) + (` (def: (~ (code.local_symbol (format "@" name))) Statement (..feature (~ runtime_name) (function ((~ g!_) (~ g!_)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux index d070b09b2..3e5b2e7e7 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux @@ -15,7 +15,7 @@ [collection ["[0]" list ("[1]#[0]" functor)] ["dict" dictionary {"+" Dictionary}]]] - ["[0]" macro {"+" with_identifiers} + ["[0]" macro {"+" with_symbols} ["[0]" code] [syntax {"+" syntax:}]] [target @@ -38,12 +38,12 @@ (type: .public Trinary (-> (Vector 3 Expression) Computation)) (type: .public Variadic (-> (List Expression) Computation)) -(syntax: (arity: [name <code>.local_identifier +(syntax: (arity: [name <code>.local_symbol arity <code>.nat]) - (with_identifiers [g!_ g!extension g!name g!phase g!inputs] + (with_symbols [g!_ g!extension g!name g!phase g!inputs] (do [! macro.monad] - [g!input+ (monad.all ! (list.repeated arity (macro.identifier "input")))] - (in (list (` (def: .public ((~ (code.local_identifier name)) (~ g!extension)) + [g!input+ (monad.all ! (list.repeated arity (macro.symbol "input")))] + (in (list (` (def: .public ((~ (code.local_symbol name)) (~ g!extension)) (-> (-> (..Vector (~ (code.nat arity)) Expression) Computation) Handler) (function ((~ g!_) (~ g!name) (~ g!phase) (~ g!inputs)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux index 59fb09719..c9cad6f31 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux @@ -58,48 +58,48 @@ (def: .public unit (_.string /////synthesis.unit)) -(syntax: .public (with_vars [vars (<code>.tuple (<>.some <code>.local_identifier)) +(syntax: .public (with_vars [vars (<code>.tuple (<>.some <code>.local_symbol)) body <code>.any]) (do [! meta.monad] [ids (monad.all ! (list.repeated (list.size vars) meta.seed))] (in (list (` (let [(~+ (|> vars (list.zipped/2 ids) (list#each (function (_ [id var]) - (list (code.local_identifier var) + (list (code.local_symbol var) (` (_.var (~ (code.text (format "v" (%.nat id))))))))) list.together))] (~ body))))))) -(syntax: (runtime: [declaration (<>.or <code>.local_identifier - (<code>.form (<>.and <code>.local_identifier - (<>.some <code>.local_identifier)))) +(syntax: (runtime: [declaration (<>.or <code>.local_symbol + (<code>.form (<>.and <code>.local_symbol + (<>.some <code>.local_symbol)))) code <code>.any]) (do meta.monad [runtime_id meta.seed] - (macro.with_identifiers [g!_] - (let [runtime (code.local_identifier (///reference.artifact [..module_id runtime_id])) + (macro.with_symbols [g!_] + (let [runtime (code.local_symbol (///reference.artifact [..module_id runtime_id])) runtime_name (` (_.var (~ (code.text (%.code runtime)))))] (case declaration {.#Left name} - (let [g!name (code.local_identifier name)] + (let [g!name (code.local_symbol name)] (in (list (` (def: .public (~ g!name) Var (~ runtime_name))) - (` (def: (~ (code.local_identifier (format "@" name))) + (` (def: (~ (code.local_symbol (format "@" name))) _.Computation (_.define_constant (~ runtime_name) (~ code))))))) {.#Right [name inputs]} - (let [g!name (code.local_identifier name) - inputsC (list#each code.local_identifier inputs) + (let [g!name (code.local_symbol name) + inputsC (list#each code.local_symbol inputs) inputs_typesC (list#each (function.constant (` _.Expression)) inputs)] (in (list (` (def: .public ((~ g!name) (~+ inputsC)) (-> (~+ inputs_typesC) _.Computation) (_.apply/* (list (~+ inputsC)) (~ runtime_name)))) - (` (def: (~ (code.local_identifier (format "@" name))) + (` (def: (~ (code.local_symbol (format "@" name))) _.Computation (..with_vars [(~+ inputsC)] (_.define_function (~ runtime_name) [(list (~+ inputsC)) {.#None}] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux b/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux index 6da850247..5be0c68f9 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux @@ -420,7 +420,7 @@ (!with_char+ source_code//size source_code g!offset/1 g!char/1 @end) (!if_digit? g!char/1 (signed_parser source_code//size offset where (!++/2 offset) source_code) - (!full_symbol_parser offset [where (!++ offset) source_code] where @aliases .#Identifier)))]) + (!full_symbol_parser offset [where (!++ offset) source_code] where @aliases .#Symbol)))]) (with_expansions [<output> {.#Right [[(revised@ .#column (|>> (!n/+ (!n/- start end))) where) end @@ -539,9 +539,9 @@ [(~~ (static ..symbol_separator)) ... (~~ (static ..frac_separator)) ] - ... It's either a Rev, an identifier, or a comment. + ... It's either a Rev, a symbol, or a comment. (with_expansions [<rev_parser> (rev_parser source_code//size offset/0 where (!++ offset/1) source_code) - <short_symbol_parser> (!short_symbol_parser source_code//size current_module [where offset/1 source_code] where .#Identifier) + <short_symbol_parser> (!short_symbol_parser source_code//size current_module [where offset/1 source_code] where .#Symbol) <comment_parser> (case ("lux text index" (!++ offset/1) (static text.new_line) source_code) {.#Some end} (recur (!vertical where end source_code)) @@ -554,10 +554,10 @@ (!if_digit? char/1 ... It's a Rev. <rev_parser> - ... It's either an identifier, or a comment. + ... It's either a symbol, or a comment. ("lux syntax char case!" char/1 [[(~~ (static ..symbol_separator))] - ... It's either an identifier, or a comment. + ... It's either a symbol, or a comment. (<| (let [offset/2 (!++ offset/1)]) (!with_char+ source_code//size source_code offset/2 char/2 (!end_of_file where offset/2 source_code current_module)) @@ -565,9 +565,9 @@ [[(~~ (static ..symbol_separator))] ... It's a comment. <comment_parser>] - ... It's an identifier. + ... It's a symbol. <short_symbol_parser>))] - ... It's an identifier. + ... It's a symbol. <short_symbol_parser>)))) [(~~ (static ..positive_sign)) @@ -588,14 +588,14 @@ ["1" #1]))] ... else - (!full_symbol_parser offset/0 [<consume_1>] where aliases .#Identifier)))] + (!full_symbol_parser offset/0 [<consume_1>] where aliases .#Symbol)))] ... else (!if_digit? char/0 ... Natural number (nat_parser source_code//size offset/0 where (!++ offset/0) source_code) - ... Identifier - (!full_symbol_parser offset/0 [<consume_1>] where aliases .#Identifier)) + ... Symbol + (!full_symbol_parser offset/0 [<consume_1>] where aliases .#Symbol)) ))) ))) )) diff --git a/stdlib/source/library/lux/type.lux b/stdlib/source/library/lux/type.lux index c0737d326..b389af6de 100644 --- a/stdlib/source/library/lux/type.lux +++ b/stdlib/source/library/lux/type.lux @@ -264,7 +264,7 @@ ([.#Sum] [.#Product] [.#Function] [.#Apply]) {.#Named name sub_type} - (code.identifier name) + (code.symbol name) (^template [<tag>] [{<tag> env body} @@ -381,14 +381,14 @@ (n.> 0))) (syntax: (new_secret_marker []) - (macro.with_identifiers [g!_secret_marker_] + (macro.with_symbols [g!_secret_marker_] (in (list g!_secret_marker_)))) (def: secret_marker (`` (symbol (~~ (new_secret_marker))))) -(syntax: .public (:log! [input (<>.or (<>.and <code>.identifier - (<>.maybe (<>.after (<code>.identifier! ..secret_marker) <code>.any))) +(syntax: .public (:log! [input (<>.or (<>.and <code>.symbol + (<>.maybe (<>.after (<code>.symbol! ..secret_marker) <code>.any))) <code>.any)]) (case input {.#Left [valueN valueC]} @@ -406,23 +406,23 @@ (symbol#encoded valueN)) text.new_line " Type: " (..format valueT)))]] - (in (list (code.identifier valueN)))) + (in (list (code.symbol valueN)))) {.#Right valueC} - (macro.with_identifiers [g!value] + (macro.with_symbols [g!value] (in (list (` (.let [(~ g!value) (~ valueC)] - (..:log! (~ valueC) (~ (code.identifier ..secret_marker)) (~ g!value))))))))) + (..:log! (~ valueC) (~ (code.symbol ..secret_marker)) (~ g!value))))))))) (def: type_parameters (Parser (List Text)) - (<code>.tuple (<>.some <code>.local_identifier))) + (<code>.tuple (<>.some <code>.local_symbol))) (syntax: .public (:as [type_vars type_parameters input <code>.any output <code>.any value (<>.maybe <code>.any)]) - (macro.with_identifiers [g!_] - (let [casterC (` (: (All ((~ g!_) (~+ (list#each code.local_identifier type_vars))) + (macro.with_symbols [g!_] + (let [casterC (` (: (All ((~ g!_) (~+ (list#each code.local_symbol type_vars))) (-> (~ input) (~ output))) (|>> :expected)))] (case value @@ -445,8 +445,8 @@ (syntax: .public (:sharing [type_vars ..type_parameters exemplar ..typed computation ..typed]) - (macro.with_identifiers [g!_] - (let [typeC (` (All ((~ g!_) (~+ (list#each code.local_identifier type_vars))) + (macro.with_symbols [g!_] + (let [typeC (` (All ((~ g!_) (~+ (list#each code.local_symbol type_vars))) (-> (~ (value@ #type exemplar)) (~ (value@ #type computation))))) shareC (` (: (~ typeC) @@ -458,7 +458,7 @@ exemplar ..typed extraction <code>.any]) (in (list (` (:of ((~! ..:sharing) - [(~+ (list#each code.local_identifier type_vars))] + [(~+ (list#each code.local_symbol type_vars))] (~ (value@ #type exemplar)) (~ (value@ #expression exemplar)) diff --git a/stdlib/source/library/lux/type/abstract.lux b/stdlib/source/library/lux/type/abstract.lux index 9de534c9b..0e199c7ad 100644 --- a/stdlib/source/library/lux/type/abstract.lux +++ b/stdlib/source/library/lux/type/abstract.lux @@ -180,7 +180,7 @@ (def: cast (Parser [(Maybe Text) Code]) - (<>.either (<>.and (<>.maybe <code>.local_identifier) <code>.any) + (<>.either (<>.and (<>.maybe <code>.local_symbol) <code>.any) (<>.and (<>#in {.#None}) <code>.any))) (template [<name> <from> <to>] @@ -206,8 +206,8 @@ (def: declaration (Parser [Text (List Text)]) - (<>.either (<code>.form (<>.and <code>.local_identifier (<>.some <code>.local_identifier))) - (<>.and <code>.local_identifier (# <>.monad in (list))))) + (<>.either (<code>.form (<>.and <code>.local_symbol (<>.some <code>.local_symbol))) + (<>.and <code>.local_symbol (# <>.monad in (list))))) (def: abstract (Parser [Code [Text (List Text)] Code (List Code)]) @@ -224,9 +224,9 @@ ..abstract]) (do meta.monad [current_module meta.current_module_name - .let [type_varsC (list#each code.local_identifier type_vars) - abstraction_declaration (` ((~ (code.local_identifier name)) (~+ type_varsC))) - representation_declaration (` ((~ (code.local_identifier (representation_definition_name name))) + .let [type_varsC (list#each code.local_symbol type_vars) + abstraction_declaration (` ((~ (code.local_symbol name)) (~+ type_varsC))) + representation_declaration (` ((~ (code.local_symbol (representation_definition_name name))) (~+ type_varsC)))] _ (..push! [name type_varsC @@ -261,19 +261,19 @@ {#Current value} (in (list (` (.|> (~ value) ..:representation ..:abstraction)))))) -(syntax: .public (^:representation [selection (<code>.form (..selection <code>.local_identifier)) +(syntax: .public (^:representation [selection (<code>.form (..selection <code>.local_symbol)) body <code>.any branches (<>.some <code>.any)]) (case selection {#Specific specific name} - (let [g!var (code.local_identifier name)] + (let [g!var (code.local_symbol name)] (in (list& g!var (` (.let [(~ g!var) (..:representation (~ specific) (~ g!var))] (~ body))) branches))) {#Current name} - (let [g!var (code.local_identifier name)] + (let [g!var (code.local_symbol name)] (in (list& g!var (` (.let [(~ g!var) (..:representation (~ g!var))] (~ body))) diff --git a/stdlib/source/library/lux/type/dynamic.lux b/stdlib/source/library/lux/type/dynamic.lux index d0a042d07..2d1eda0db 100644 --- a/stdlib/source/library/lux/type/dynamic.lux +++ b/stdlib/source/library/lux/type/dynamic.lux @@ -10,7 +10,7 @@ [data [text ["%" format]]] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} ["[0]" syntax {"+" syntax:}]] ["[0]" type abstract]]]) @@ -33,13 +33,13 @@ (|>> :representation)) (syntax: .public (:dynamic [value <code>.any]) - (with_identifiers [g!value] + (with_symbols [g!value] (in (list (` (let [(~ g!value) (~ value)] ((~! ..abstraction) [(:of (~ g!value)) (~ g!value)]))))))) (syntax: .public (:static [type <code>.any value <code>.any]) - (with_identifiers [g!type g!value] + (with_symbols [g!type g!value] (in (list (` (let [[(~ g!type) (~ g!value)] ((~! ..representation) (~ value))] (: ((~! try.Try) (~ type)) (if (# (~! type.equivalence) (~' =) diff --git a/stdlib/source/library/lux/type/implicit.lux b/stdlib/source/library/lux/type/implicit.lux index c3b9983f4..12f218f8d 100644 --- a/stdlib/source/library/lux/type/implicit.lux +++ b/stdlib/source/library/lux/type/implicit.lux @@ -315,7 +315,7 @@ (def: (var? input) (-> Code Bit) (case input - [_ {.#Identifier _}] + [_ {.#Symbol _}] #1 _ @@ -329,13 +329,13 @@ (-> Instance Code) (case dependencies {.#End} - (code.identifier constructor) + (code.symbol constructor) _ - (` ((~ (code.identifier constructor)) (~+ (list#each instance$ dependencies)))))) + (` ((~ (code.symbol constructor)) (~+ (list#each instance$ dependencies)))))) -(syntax: .public (## [member <code>.identifier - args (<>.or (<>.and (<>.some <code>.identifier) <code>.end!) +(syntax: .public (## [member <code>.symbol + args (<>.or (<>.and (<>.some <code>.symbol) <code>.end!) (<>.and (<>.some <code>.any) <code>.end!))]) (case args {.#Left [args _]} @@ -350,8 +350,8 @@ {.#Item chosen {.#End}} (in (list (` (# (~ (instance$ chosen)) - (~ (code.local_identifier (product.right member))) - (~+ (list#each code.identifier args)))))) + (~ (code.local_symbol (product.right member))) + (~+ (list#each code.symbol args)))))) _ (meta.failure (format "Too many implementations available: " @@ -362,14 +362,14 @@ {.#Right [args _]} (do [! meta.monad] - [labels (|> (macro.identifier "") (list.repeated (list.size args)) (monad.all !))] + [labels (|> (macro.symbol "") (list.repeated (list.size args)) (monad.all !))] (in (list (` (let [(~+ (|> args (list.zipped/2 labels) (list#each ..pair_list) list#conjoint))] - (..## (~ (code.identifier member)) (~+ labels))))))) + (..## (~ (code.symbol member)) (~+ labels))))))) )) (def: (implicit_bindings amount) (-> Nat (Meta (List Code))) - (|> (macro.identifier "g!implicit") + (|> (macro.symbol "g!implicit") (list.repeated amount) (monad.all meta.monad))) diff --git a/stdlib/source/library/lux/type/poly.lux b/stdlib/source/library/lux/type/poly.lux index fbd910be4..08538565b 100644 --- a/stdlib/source/library/lux/type/poly.lux +++ b/stdlib/source/library/lux/type/poly.lux @@ -16,7 +16,7 @@ [collection ["[0]" list ("[1]#[0]" functor)] ["[0]" dictionary]]] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} ["[0]" code] [syntax {"+" syntax:}]] [math @@ -26,14 +26,14 @@ (def: polyP (Parser [Code Text Code]) (let [private ($_ <>.and - <code>.local_identifier + <code>.local_symbol <code>.any)] (<>.either (<>.and <code>.any private) (<>.and (<>#in (` .private)) private)))) (syntax: .public (poly: [[export_policy name body] ..polyP]) - (with_identifiers [g!_ g!type g!output] - (let [g!name (code.identifier ["" name])] + (with_symbols [g!_ g!type g!output] + (let [g!name (code.symbol ["" name])] (in (.list (` ((~! syntax:) (~ export_policy) ((~ g!name) [(~ g!type) (~! <code>.any)]) ((~! do) (~! meta.monad) [(~ g!type) ((~! meta.eval) .Type (~ g!type))] @@ -85,7 +85,7 @@ [.Tuple .#Product type.flat_tuple]) {.#Named name sub_type} - (code.identifier name) + (code.symbol name) (^template [<tag>] [{<tag> scope body} diff --git a/stdlib/source/library/lux/type/quotient.lux b/stdlib/source/library/lux/type/quotient.lux index 099d14b53..3301280c1 100644 --- a/stdlib/source/library/lux/type/quotient.lux +++ b/stdlib/source/library/lux/type/quotient.lux @@ -6,7 +6,7 @@ [control [parser ["<[0]>" code]]] - [macro {"+" with_identifiers} + [macro {"+" with_symbols} [syntax {"+" syntax:}]] ["[0]" type abstract]]]) @@ -44,7 +44,7 @@ ) (syntax: .public (type [class <code>.any]) - (with_identifiers [g!t g!c g!%] + (with_symbols [g!t g!c g!%] (in (list (` ((~! type.:by_example) [(~ g!t) (~ g!c) (~ g!%)] diff --git a/stdlib/source/library/lux/type/refinement.lux b/stdlib/source/library/lux/type/refinement.lux index 02745abd2..a294ffec8 100644 --- a/stdlib/source/library/lux/type/refinement.lux +++ b/stdlib/source/library/lux/type/refinement.lux @@ -85,7 +85,7 @@ {.#Item head no}])))) (syntax: .public (type [refiner <code>.any]) - (macro.with_identifiers [g!t g!%] + (macro.with_symbols [g!t g!%] (in (list (` ((~! type.:by_example) [(~ g!t) (~ g!%)] (..Refiner (~ g!t) (~ g!%)) (~ refiner) diff --git a/stdlib/source/library/lux/type/resource.lux b/stdlib/source/library/lux/type/resource.lux index 9d562cbd4..d9ffdfea7 100644 --- a/stdlib/source/library/lux/type/resource.lux +++ b/stdlib/source/library/lux/type/resource.lux @@ -127,7 +127,7 @@ (# monad in [context []]))) (syntax: .public (exchange [swaps ..indices]) - (macro.with_identifiers [g!_ g!context g!!] + (macro.with_symbols [g!_ g!context g!!] (case swaps {.#End} (in (list (` (~! no_op)))) @@ -135,7 +135,7 @@ {.#Item head tail} (do [! meta.monad] [.let [max_idx (list#mix n.max head tail)] - g!inputs (<| (monad.all !) (list.repeated (++ max_idx)) (macro.identifier "input")) + g!inputs (<| (monad.all !) (list.repeated (++ max_idx)) (macro.symbol "input")) .let [g!outputs (|> (monad.mix maybe.monad (function (_ from to) (do maybe.monad @@ -166,9 +166,9 @@ (template [<name> <from> <to>] [(syntax: .public (<name> [amount ..amount]) - (macro.with_identifiers [g!_ g!context g!!] + (macro.with_symbols [g!_ g!context g!!] (do [! meta.monad] - [g!keys (|> (macro.identifier "keys") + [g!keys (|> (macro.symbol "keys") (list.repeated amount) (monad.all !))] (in (list (` (: (All ((~ g!_) (~ g!!) (~+ g!keys) (~ g!context)) diff --git a/stdlib/source/library/lux/type/unit.lux b/stdlib/source/library/lux/type/unit.lux index 6509f6505..146abbf8f 100644 --- a/stdlib/source/library/lux/type/unit.lux +++ b/stdlib/source/library/lux/type/unit.lux @@ -88,15 +88,15 @@ (syntax: .public (unit: [[export_policy type_name unit_name] (|export|.parser ($_ <>.and - <code>.local_identifier - <code>.local_identifier))]) + <code>.local_symbol + <code>.local_symbol))]) (do meta.monad [@ meta.current_module_name - .let [g!type (code.local_identifier type_name)]] + .let [g!type (code.local_symbol type_name)]] (in (list (` (type: (~ export_policy) (~ g!type) (Primitive (~ (code.text (%.symbol [@ type_name])))))) - (` (implementation: (~ export_policy) (~ (code.local_identifier unit_name)) + (` (implementation: (~ export_policy) (~ (code.local_symbol unit_name)) (..Unit (~ g!type)) (def: (~' in) (~! ..in')) @@ -117,17 +117,17 @@ (syntax: .public (scale: [[export_policy type_name scale_name ratio] (|export|.parser ($_ <>.and - <code>.local_identifier - <code>.local_identifier + <code>.local_symbol + <code>.local_symbol ..scaleP))]) (do meta.monad [.let [(^open "_[0]") ratio] @ meta.current_module_name - .let [g!scale (code.local_identifier type_name)]] + .let [g!scale (code.local_symbol type_name)]] (in (list (` (type: (~ export_policy) ((~ g!scale) (~' u)) (Primitive (~ (code.text (%.symbol [@ type_name]))) [(~' u)]))) - (` (implementation: (~ export_policy) (~ (code.local_identifier scale_name)) + (` (implementation: (~ export_policy) (~ (code.local_symbol scale_name)) (..Scale (~ g!scale)) (def: (~' scale) @@ -155,8 +155,8 @@ (i./ (.int denominator)) in'))) -(syntax: (implementation_name [type_name <code>.local_identifier]) - (in (list (code.local_identifier (text.lower_cased type_name))))) +(syntax: (implementation_name [type_name <code>.local_symbol]) + (in (list (code.local_symbol (text.lower_cased type_name))))) (template [<type> <from> <to>] [(`` (scale: .public <type> diff --git a/stdlib/source/library/lux/world/net/http/client.lux b/stdlib/source/library/lux/world/net/http/client.lux index a34c8a7fc..d2dc29f2d 100644 --- a/stdlib/source/library/lux/world/net/http/client.lux +++ b/stdlib/source/library/lux/world/net/http/client.lux @@ -36,8 +36,8 @@ (! (Try (//.Response !)))) request))) -(syntax: (method_function [[_ name] <code>.identifier]) - (in (list (code.local_identifier (text.replaced "#" "" (text.lower_cased name)))))) +(syntax: (method_function [[_ name] <code>.symbol]) + (in (list (code.local_symbol (text.replaced "#" "" (text.lower_cased name)))))) (template [<method>] [(with_expansions [<name> (method_function <method>)] diff --git a/stdlib/source/poly/lux/abstract/equivalence.lux b/stdlib/source/poly/lux/abstract/equivalence.lux index 71441f13b..7db8d5c13 100644 --- a/stdlib/source/poly/lux/abstract/equivalence.lux +++ b/stdlib/source/poly/lux/abstract/equivalence.lux @@ -43,7 +43,7 @@ (poly: .public equivalence (`` (do [! <>.monad] - [.let [g!_ (code.local_identifier "_____________")] + [.let [g!_ (code.local_symbol "_____________")] *env* <type>.env inputT <type>.next .let [@Equivalence (: (-> Type Code) @@ -109,9 +109,9 @@ (do ! [members (<type>.variant (<>.many equivalence)) .let [last (-- (list.size members)) - g!_ (code.local_identifier "_____________") - g!left (code.local_identifier "_____________left") - g!right (code.local_identifier "_____________right")]] + g!_ (code.local_symbol "_____________") + g!left (code.local_symbol "_____________left") + g!right (code.local_symbol "_____________right")]] (in (` (: (~ (@Equivalence inputT)) (function ((~ g!_) (~ g!left) (~ g!right)) (case [(~ g!left) (~ g!right)] @@ -129,10 +129,10 @@ ... Tuples (do ! [g!eqs (<type>.tuple (<>.many equivalence)) - .let [g!_ (code.local_identifier "_____________") + .let [g!_ (code.local_symbol "_____________") indices (list.indices (list.size g!eqs)) - g!lefts (list#each (|>> nat#encoded (text#composite "left") code.local_identifier) indices) - g!rights (list#each (|>> nat#encoded (text#composite "right") code.local_identifier) indices)]] + g!lefts (list#each (|>> nat#encoded (text#composite "left") code.local_symbol) indices) + g!rights (list#each (|>> nat#encoded (text#composite "right") code.local_symbol) indices)]] (in (` (: (~ (@Equivalence inputT)) (function ((~ g!_) [(~+ g!lefts)] [(~+ g!rights)]) (and (~+ (|> (list.zipped/3 g!eqs g!lefts g!rights) @@ -141,7 +141,7 @@ ... Type recursion (do ! [[g!self bodyC] (<type>.recursive equivalence) - .let [g!_ (code.local_identifier "_____________")]] + .let [g!_ (code.local_symbol "_____________")]] (in (` (: (~ (@Equivalence inputT)) ((~! /.rec) (.function ((~ g!_) (~ g!self)) (~ bodyC))))))) diff --git a/stdlib/source/poly/lux/abstract/functor.lux b/stdlib/source/poly/lux/abstract/functor.lux index 895d509be..b4c5e44a3 100644 --- a/stdlib/source/poly/lux/abstract/functor.lux +++ b/stdlib/source/poly/lux/abstract/functor.lux @@ -26,10 +26,10 @@ (poly: .public functor (do [! p.monad] - [.let [g!_ (code.local_identifier "____________") - type_funcC (code.local_identifier "____________type_funcC") - funcC (code.local_identifier "____________funcC") - inputC (code.local_identifier "____________inputC")] + [.let [g!_ (code.local_symbol "____________") + type_funcC (code.local_symbol "____________type_funcC") + funcC (code.local_symbol "____________funcC") + inputC (code.local_symbol "____________inputC")] *env* <type>.env inputT <type>.next [polyC varsC non_functorT] (<type>.local (list inputT) @@ -39,7 +39,7 @@ (function (_ unwrappedT) (if (n.= 1 num_vars) (` ((~! /.Functor) (~ (poly.code *env* unwrappedT)))) - (let [paramsC (|> num_vars -- list.indices (list#each (|>> %.nat code.local_identifier)))] + (let [paramsC (|> num_vars -- list.indices (list#each (|>> %.nat code.local_symbol)))] (` (All ((~ g!_) (~+ paramsC)) ((~! /.Functor) ((~ (poly.code *env* unwrappedT)) (~+ paramsC))))))))) Arg<?> (: (-> Code (<type>.Parser Code)) @@ -69,7 +69,7 @@ (<type>.tuple (loop [idx 0 pairsCC (: (List [Code Code]) (list))] - (p.either (let [slotC (|> idx %.nat (format "____________slot") code.local_identifier)] + (p.either (let [slotC (|> idx %.nat (format "____________slot") code.local_symbol)] (do ! [_ (in []) memberC (Arg<?> slotC)] @@ -82,13 +82,13 @@ ... Functions (do ! [_ (in []) - .let [g! (code.local_identifier "____________") - outL (code.local_identifier "____________outL")] + .let [g! (code.local_symbol "____________") + outL (code.local_symbol "____________outL")] [inT+ outC] (<type>.function (p.many <type>.any) (Arg<?> outL)) .let [inC+ (|> (list.size inT+) list.indices - (list#each (|>> %.nat (format "____________inC") code.local_identifier)))]] + (list#each (|>> %.nat (format "____________inC") code.local_symbol)))]] (in (` (function ((~ g!) (~+ inC+)) (let [(~ outL) ((~ valueC) (~+ inC+))] (~ outC)))))) diff --git a/stdlib/source/poly/lux/data/format/json.lux b/stdlib/source/poly/lux/data/format/json.lux index df9c9cc5b..964d7918b 100644 --- a/stdlib/source/poly/lux/data/format/json.lux +++ b/stdlib/source/poly/lux/data/format/json.lux @@ -100,12 +100,12 @@ (with_expansions [<basic> (template [<matcher> <encoder>] [(do ! - [.let [g!_ (code.local_identifier "_______")] + [.let [g!_ (code.local_symbol "_______")] _ <matcher>] (in (` (: (~ (@JSON#encoded inputT)) <encoder>))))] - [(<type>.exactly Any) (function ((~ g!_) (~ (code.identifier ["" "0"]))) {/.#Null})] + [(<type>.exactly Any) (function ((~ g!_) (~ (code.symbol ["" "0"]))) {/.#Null})] [(<type>.sub Bit) (|>> {/.#Boolean})] [(<type>.sub Nat) (# (~! ..nat_codec) (~' encoded))] [(<type>.sub Int) (# (~! ..int_codec) (~' encoded))] @@ -124,7 +124,7 @@ [month.Month month.codec])] (do [! <>.monad] [*env* <type>.env - .let [g!_ (code.local_identifier "_______") + .let [g!_ (code.local_symbol "_______") @JSON#encoded (: (-> Type Code) (function (_ type) (` (-> (~ (poly.code *env* type)) /.JSON))))] @@ -138,9 +138,9 @@ (in (` (: (~ (@JSON#encoded inputT)) (# (~! qty_codec) (~' encoded)))))) (do ! - [.let [g!_ (code.local_identifier "_______") - g!key (code.local_identifier "_______key") - g!val (code.local_identifier "_______val")] + [.let [g!_ (code.local_symbol "_______") + g!key (code.local_symbol "_______key") + g!val (code.local_symbol "_______val")] [_ _ =val=] (<type>.applied ($_ <>.and (<type>.exactly dictionary.Dictionary) (<type>.exactly .Text) @@ -164,8 +164,8 @@ (in (` (: (~ (@JSON#encoded inputT)) (|>> ((~! list#each) (~ =sub=)) ((~! row.of_list)) {/.#Array}))))) (do ! - [.let [g!_ (code.local_identifier "_______") - g!input (code.local_identifier "_______input")] + [.let [g!_ (code.local_symbol "_______") + g!input (code.local_symbol "_______input")] members (<type>.variant (<>.many encoded)) .let [last (-- (list.size members))]] (in (` (: (~ (@JSON#encoded inputT)) @@ -184,10 +184,10 @@ (list.enumeration members)))))))))) (do ! [g!encoders (<type>.tuple (<>.many encoded)) - .let [g!_ (code.local_identifier "_______") + .let [g!_ (code.local_symbol "_______") g!members (|> (list.size g!encoders) list.indices - (list#each (|>> n#encoded code.local_identifier)))]] + (list#each (|>> n#encoded code.local_symbol)))]] (in (` (: (~ (@JSON#encoded inputT)) (function ((~ g!_) [(~+ g!members)]) ((~! /.json) [(~+ (list#each (function (_ [g!member g!encoded]) @@ -196,7 +196,7 @@ ... Type recursion (do ! [[selfC non_recC] (<type>.recursive encoded) - .let [g! (code.local_identifier "____________")]] + .let [g! (code.local_symbol "____________")]] (in (` (: (~ (@JSON#encoded inputT)) ((~! ..rec_encoded) (.function ((~ g!) (~ selfC)) (~ non_recC))))))) @@ -248,7 +248,7 @@ [month.Month month.codec])] (do [! <>.monad] [*env* <type>.env - .let [g!_ (code.local_identifier "_______") + .let [g!_ (code.local_symbol "_______") @JSON#decoded (: (-> Type Code) (function (_ type) (` (</>.Parser (~ (poly.code *env* type))))))] @@ -301,7 +301,7 @@ ... Type recursion (do ! [[selfC bodyC] (<type>.recursive decoded) - .let [g! (code.local_identifier "____________")]] + .let [g! (code.local_symbol "____________")]] (in (` (: (~ (@JSON#decoded inputT)) ((~! <>.rec) (.function ((~ g!) (~ selfC)) (~ bodyC))))))) diff --git a/stdlib/source/program/aedifex/artifact/extension.lux b/stdlib/source/program/aedifex/artifact/extension.lux index df5fe17fe..59ece689a 100644 --- a/stdlib/source/program/aedifex/artifact/extension.lux +++ b/stdlib/source/program/aedifex/artifact/extension.lux @@ -26,7 +26,7 @@ (template [<name>] [(def: .public <name> Extension - (..extension (template.identifier [//._] [<name>])))] + (..extension (template.symbol [//._] [<name>])))] [lux_library] [jvm_library] diff --git a/stdlib/source/specification/compositor/generation/case.lux b/stdlib/source/specification/compositor/generation/case.lux index ec9a36675..6206fa3a1 100644 --- a/stdlib/source/specification/compositor/generation/case.lux +++ b/stdlib/source/specification/compositor/generation/case.lux @@ -156,18 +156,14 @@ (let [__tuple__ (: (-> (List Synthesis) Synthesis) (|>> list.reversed _list_ [9 #0] synthesis.variant _code_)) __form__ (: (-> (List Synthesis) Synthesis) - (|>> list.reversed _list_ [8 #0] synthesis.variant _code_)) + (|>> list.reversed _list_ [7 #0] synthesis.variant _code_)) __text__ (: (-> Text Synthesis) (function (_ value) (_code_ (synthesis.variant [5 #0 (synthesis.text value)])))) - __identifier__ (: (-> Symbol Synthesis) - (function (_ [module short]) - (_code_ (synthesis.variant [6 #0 (synthesis.tuple (list (synthesis.text module) - (synthesis.text short)))])))) - __tag__ (: (-> Symbol Synthesis) - (function (_ [module short]) - (_code_ (synthesis.variant [7 #0 (synthesis.tuple (list (synthesis.text module) - (synthesis.text short)))])))) + __symbol__ (: (-> Symbol Synthesis) + (function (_ [module short]) + (_code_ (synthesis.variant [6 #0 (synthesis.tuple (list (synthesis.text module) + (synthesis.text short)))])))) __list__ (: (-> (List Synthesis) Synthesis) (list#mix (function (_ head tail) (__form__ (list (__tag__ ["" "Item"]) head tail))) @@ -176,13 +172,13 @@ (function (_ func arg) (__form__ (list func arg))))] (|> _end_ - (_item_ (__apply__ (__identifier__ ["" "form$"]) - (__list__ (list (__apply__ (__identifier__ ["" "tag$"]) + (_item_ (__apply__ (__symbol__ ["" "form$"]) + (__list__ (list (__apply__ (__symbol__ ["" "tag$"]) (__tuple__ (list (__text__ .prelude_module) (__text__ "Item")))) - (__identifier__ ["" "export?-meta"]) - (__identifier__ ["" "tail"]))))) - (_item_ (__tuple__ (list (__identifier__ ["" "tail"])))) + (__symbol__ ["" "export?-meta"]) + (__symbol__ ["" "tail"]))))) + (_item_ (__tuple__ (list (__symbol__ ["" "tail"])))) )))) (def: special_path diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index c36f8b11f..dc23cd309 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -297,7 +297,7 @@ ((/.<<| (n.* factor) ++) start))) ))) -(def: example_identifier "YOLO") +(def: example_symbol "YOLO") (def: i8 8) (def: current_module @@ -315,21 +315,21 @@ (code#= (code.rev .2) (/.' .2)) (code#= (code.frac +3.4) (/.' +3.4)) (code#= (code.text "5") (/.' "5")) - (code#= (code.identifier ["" "example_identifier"]) - (/.' example_identifier)) - (code#= (code.identifier [/.prelude_module "example_identifier"]) - (/.' .example_identifier)) - (code#= (code.identifier [..current_module "example_identifier"]) - (/.' ..example_identifier)) + (code#= (code.symbol ["" "example_symbol"]) + (/.' example_symbol)) + (code#= (code.symbol [/.prelude_module "example_symbol"]) + (/.' .example_symbol)) + (code#= (code.symbol [..current_module "example_symbol"]) + (/.' ..example_symbol)) (code#= (code.form (list (code.nat 6) (code.int +7) (code.rev .8))) (/.' (6 +7 .8))) (code#= (code.variant (list (code.frac +9.0) (code.text "9") - (code.identifier ["" "i8"]))) + (code.symbol ["" "i8"]))) (/.' {+9.0 "9" i8})) (code#= (code.tuple (list (code.frac +9.0) (code.text "9") - (code.identifier ["" "i8"]))) + (code.symbol ["" "i8"]))) (/.' [+9.0 "9" i8])) (not (code#= (code.nat example_nat) (/.' (~ (code.nat example_nat))))) @@ -345,21 +345,21 @@ (code#= (code.rev .2) (/.` .2)) (code#= (code.frac +3.4) (/.` +3.4)) (code#= (code.text "5") (/.` "5")) - (code#= (code.identifier [..current_module "example_identifier"]) - (/.` example_identifier)) - (code#= (code.identifier [/.prelude_module "example_identifier"]) - (/.` .example_identifier)) - (code#= (code.identifier [..current_module "example_identifier"]) - (/.` ..example_identifier)) + (code#= (code.symbol [..current_module "example_symbol"]) + (/.` example_symbol)) + (code#= (code.symbol [/.prelude_module "example_symbol"]) + (/.` .example_symbol)) + (code#= (code.symbol [..current_module "example_symbol"]) + (/.` ..example_symbol)) (code#= (code.form (list (code.nat 6) (code.int +7) (code.rev .8))) (/.` (6 +7 .8))) (code#= (code.variant (list (code.frac +9.0) (code.text "9") - (code.identifier [..current_module "i8"]))) + (code.symbol [..current_module "i8"]))) (/.` {+9.0 "9" i8})) (code#= (code.tuple (list (code.frac +9.0) (code.text "9") - (code.identifier [..current_module "i8"]))) + (code.symbol [..current_module "i8"]))) (/.` [+9.0 "9" i8])) (code#= (code.nat example_nat) (/.` (~ (code.nat example_nat)))))))) @@ -374,21 +374,21 @@ (code#= (code.rev .2) (/.`' .2)) (code#= (code.frac +3.4) (/.`' +3.4)) (code#= (code.text "5") (/.`' "5")) - (code#= (code.identifier ["" "example_identifier"]) - (/.`' example_identifier)) - (code#= (code.identifier [/.prelude_module "example_identifier"]) - (/.`' .example_identifier)) - (code#= (code.identifier [..current_module "example_identifier"]) - (/.`' ..example_identifier)) + (code#= (code.symbol ["" "example_symbol"]) + (/.`' example_symbol)) + (code#= (code.symbol [/.prelude_module "example_symbol"]) + (/.`' .example_symbol)) + (code#= (code.symbol [..current_module "example_symbol"]) + (/.`' ..example_symbol)) (code#= (code.form (list (code.nat 6) (code.int +7) (code.rev .8))) (/.`' (6 +7 .8))) (code#= (code.variant (list (code.frac +9.0) (code.text "9") - (code.identifier ["" "i8"]))) + (code.symbol ["" "i8"]))) (/.`' {+9.0 "9" i8})) (code#= (code.tuple (list (code.frac +9.0) (code.text "9") - (code.identifier ["" "i8"]))) + (code.symbol ["" "i8"]))) (/.`' [+9.0 "9" i8])) (code#= (code.nat example_nat) (/.`' (~ (code.nat example_nat)))))))) @@ -1090,19 +1090,19 @@ )) (for [@.old (as_is)] - (as_is (syntax: (for_bindings|test [fn/0 <code>.local_identifier - var/0 <code>.local_identifier - let/0 <code>.local_identifier + (as_is (syntax: (for_bindings|test [fn/0 <code>.local_symbol + var/0 <code>.local_symbol + let/0 <code>.local_symbol - fn/1 <code>.local_identifier - var/1 <code>.local_identifier - let/1 <code>.local_identifier + fn/1 <code>.local_symbol + var/1 <code>.local_symbol + let/1 <code>.local_symbol - fn/2 <code>.local_identifier - var/2 <code>.local_identifier - let/2 <code>.local_identifier + fn/2 <code>.local_symbol + var/2 <code>.local_symbol + let/2 <code>.local_symbol - let/3 <code>.local_identifier]) + let/3 <code>.local_symbol]) (in (list (code.bit (case (value@ .#scopes *lux*) (^ (list& scope/2 _)) (let [locals/2 (value@ .#locals scope/2) diff --git a/stdlib/source/test/lux/control/parser/code.lux b/stdlib/source/test/lux/control/parser/code.lux index aee053104..bbd5de948 100644 --- a/stdlib/source/test/lux/control/parser/code.lux +++ b/stdlib/source/test/lux/control/parser/code.lux @@ -75,8 +75,8 @@ [/.rev /.rev! random.rev code.rev rev.equivalence] [/.frac /.frac! random.safe_frac code.frac frac.equivalence] [/.text /.text! (random.unicode 1) code.text text.equivalence] - [/.identifier /.identifier! ..random_symbol code.identifier symbol.equivalence] - [/.local_identifier /.local_identifier! (random.unicode 1) code.local_identifier text.equivalence] + [/.symbol /.symbol! ..random_symbol code.symbol symbol.equivalence] + [/.local_symbol /.local_symbol! (random.unicode 1) code.local_symbol text.equivalence] )) (~~ (template [<query> <code>] [(do [! random.monad] diff --git a/stdlib/source/test/lux/control/remember.lux b/stdlib/source/test/lux/control/remember.lux index a8eb15141..8c8162d24 100644 --- a/stdlib/source/test/lux/control/remember.lux +++ b/stdlib/source/test/lux/control/remember.lux @@ -34,7 +34,7 @@ (def: (memory macro deadline message focus) (-> Symbol Date Text (Maybe Code) Code) - (` ((~ (code.identifier macro)) + (` ((~ (code.symbol macro)) (~ (code.text (%.date deadline))) (~ (code.text message)) (~+ (case focus @@ -62,7 +62,7 @@ {.#Some focus} (text.contains? (%.code focus) failure)))) -(syntax: (test_macro [macro <code>.identifier +(syntax: (test_macro [macro <code>.symbol extra <code>.text]) (let [now (io.run! instant.now) today (instant.date now) diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux index f12831ab8..f3d3b9b93 100644 --- a/stdlib/source/test/lux/data/format/json.lux +++ b/stdlib/source/test/lux/data/format/json.lux @@ -58,7 +58,7 @@ (syntax: (string []) (do meta.monad - [value (macro.identifier "string")] + [value (macro.symbol "string")] (in (list (code.text (%.code value)))))) (def: .public test diff --git a/stdlib/source/test/lux/data/format/xml.lux b/stdlib/source/test/lux/data/format/xml.lux index 840455f41..4c56dc5e2 100644 --- a/stdlib/source/test/lux/data/format/xml.lux +++ b/stdlib/source/test/lux/data/format/xml.lux @@ -1,6 +1,6 @@ (.module: [library - [lux {"-" char} + [lux {"-" char symbol} ["_" test {"+" Test}] [abstract [monad {"+" Monad do}] @@ -51,7 +51,7 @@ [size (..size bottom top)] (random.text ..char size))) -(def: identifier +(def: symbol (Random Symbol) (random.and (..text 0 10) (..text 1 10))) @@ -63,8 +63,8 @@ (do random.monad [size (..size 0 2)] ($_ random.and - ..identifier - (random.dictionary symbol.hash size ..identifier (..text 0 10)) + ..symbol + (random.dictionary symbol.hash size ..symbol (..text 0 10)) (random.list size random))))))) (def: .public test @@ -78,14 +78,14 @@ ($codec.spec /.equivalence /.codec ..random)) (do [! random.monad] - [(^@ identifier [namespace name]) ..identifier] + [(^@ symbol [namespace name]) ..symbol] (`` ($_ _.and (~~ (template [<type> <format>] [(_.cover [<type> <format>] (and (text#= name (<format> ["" name])) - (let [identifier (<format> identifier)] - (and (text.starts_with? namespace identifier) - (text.ends_with? name identifier)))))] + (let [symbol (<format> symbol)] + (and (text.starts_with? namespace symbol) + (text.ends_with? name symbol)))))] [/.Tag /.tag] [/.Attribute /.attribute] diff --git a/stdlib/source/test/lux/data/text/regex.lux b/stdlib/source/test/lux/data/text/regex.lux index 2eb5ad7e0..eeb1c9b18 100644 --- a/stdlib/source/test/lux/data/text/regex.lux +++ b/stdlib/source/test/lux/data/text/regex.lux @@ -55,7 +55,7 @@ (syntax: (should_check [pattern <code>.any regex <code>.any input <code>.any]) - (macro.with_identifiers [g!message g!_] + (macro.with_symbols [g!message g!_] (in (list (` (|> (~ input) (<text>.result (~ regex)) (case> (^ {try.#Success (~ pattern)}) diff --git a/stdlib/source/test/lux/documentation.lux b/stdlib/source/test/lux/documentation.lux index e686dcd21..4e59139c0 100644 --- a/stdlib/source/test/lux/documentation.lux +++ b/stdlib/source/test/lux/documentation.lux @@ -52,7 +52,7 @@ (_.for [/.Definition] ($_ _.and (_.cover [/.default] - (case (`` (/.default (~~ (template.identifier [.._] [g!default])))) + (case (`` (/.default (~~ (template.symbol [.._] [g!default])))) (^ (list definition)) (and (|> definition (value@ /.#definition) @@ -104,7 +104,7 @@ _ false)))) )) - (_.cover [/.unqualified_identifier] + (_.cover [/.unqualified_symbol] (`` (and (~~ (template [<example>] [(macro_error <example>)] diff --git a/stdlib/source/test/lux/ffi.jvm.lux b/stdlib/source/test/lux/ffi.jvm.lux index 9f5ea29e5..5779817d2 100644 --- a/stdlib/source/test/lux/ffi.jvm.lux +++ b/stdlib/source/test/lux/ffi.jvm.lux @@ -600,7 +600,7 @@ Test ($_ _.and (_.cover [/.class_names_cannot_contain_periods] - (with_expansions [<class> (template.identifier ["java.lang.Float"])] + (with_expansions [<class> (template.symbol ["java.lang.Float"])] (not (expands? (/.import: <class>))))) (_.cover [/.class_name_cannot_be_a_type_variable] (and (not (expands? (/.import: (java/lang/Double a) diff --git a/stdlib/source/test/lux/macro.lux b/stdlib/source/test/lux/macro.lux index 8553e6e16..6cf91e49f 100644 --- a/stdlib/source/test/lux/macro.lux +++ b/stdlib/source/test/lux/macro.lux @@ -51,20 +51,20 @@ token <code>.any]) (in (list.repeated times token))) -(syntax: (fresh_identifier []) +(syntax: (fresh_symbol []) (do meta.monad - [g!fresh (/.identifier "fresh")] + [g!fresh (/.symbol "fresh")] (in (list g!fresh)))) (def: random_lux (Random [Nat Text .Lux]) (do [! random.monad] [seed random.nat - identifier_prefix (random.ascii/upper 1) + symbol_prefix (random.ascii/upper 1) .let [macro_module (symbol.module (symbol /._)) current_module (symbol.module (symbol .._))]] (in [seed - identifier_prefix + symbol_prefix [.#info [.#target "" .#version "" .#mode {.#Build}] @@ -103,7 +103,7 @@ (def: expander Test (do [! random.monad] - [[seed identifier_prefix lux] ..random_lux + [[seed symbol_prefix lux] ..random_lux pow/1 (# ! each code.nat random.nat) @@ -148,27 +148,27 @@ (<| (_.covering /._) ($_ _.and (do [! random.monad] - [[seed identifier_prefix lux] ..random_lux] + [[seed symbol_prefix lux] ..random_lux] ($_ _.and - (_.cover [/.identifier] - (|> (/.identifier identifier_prefix) + (_.cover [/.symbol] + (|> (/.symbol symbol_prefix) (# meta.monad each %.code) (meta.result lux) - (!expect (^multi {try.#Success actual_identifier} - (and (text.contains? identifier_prefix actual_identifier) - (text.contains? (%.nat seed) actual_identifier)))))) + (!expect (^multi {try.#Success actual_symbol} + (and (text.contains? symbol_prefix actual_symbol) + (text.contains? (%.nat seed) actual_symbol)))))) (_.cover [/.wrong_syntax_error] (|> (/.single_expansion (` (/.log_single_expansion!))) (meta.result lux) (!expect (^multi {try.#Failure error} (text.contains? (/.wrong_syntax_error (symbol /.log_single_expansion!)) error))))) - (_.cover [/.with_identifiers] - (with_expansions [<expected> (fresh_identifier)] - (|> (/.with_identifiers [<expected>] + (_.cover [/.with_symbols] + (with_expansions [<expected> (fresh_symbol)] + (|> (/.with_symbols [<expected>] (# meta.monad in <expected>)) (meta.result lux) - (!expect (^multi {try.#Success [_ {.#Identifier ["" actual]}]} + (!expect (^multi {try.#Success [_ {.#Symbol ["" actual]}]} (text.contains? (template.text [<expected>]) actual)))))) )) diff --git a/stdlib/source/test/lux/macro/code.lux b/stdlib/source/test/lux/macro/code.lux index 8a0ab7ef1..f1a983c3d 100644 --- a/stdlib/source/test/lux/macro/code.lux +++ b/stdlib/source/test/lux/macro/code.lux @@ -52,7 +52,7 @@ (random#each /.rev random.rev) (random#each /.frac random.safe_frac) (random#each /.text ..random_text) - (random#each /.identifier ..random_symbol) + (random#each /.symbol ..random_symbol) (random#each /.form (..random_sequence random)) (random#each /.variant (..random_sequence random)) (random#each /.tuple (..random_sequence random)) @@ -93,7 +93,7 @@ (random#each /.rev random.rev) (random#each /.frac random.safe_frac) (random#each /.text ..random_text) - (random#each /.identifier ..random_symbol)))] + (random#each /.symbol ..random_symbol)))] (in [sample sample])) (for_sequence /.form) (for_sequence /.variant) @@ -125,7 +125,7 @@ [/.rev random.rev .#Rev] [/.frac random.safe_frac .#Frac] [/.text ..random_text .#Text] - [/.identifier ..random_symbol .#Identifier] + [/.symbol ..random_symbol .#Symbol] [/.form (..random_sequence ..random) .#Form] [/.variant (..random_sequence ..random) .#Variant] [/.tuple (..random_sequence ..random) .#Tuple])) @@ -146,7 +146,7 @@ (<coverage> expected))) ))] - [/.local_identifier ..random_text .#Identifier] + [/.local_symbol ..random_text .#Symbol] ))))) (def: .public test diff --git a/stdlib/source/test/lux/macro/local.lux b/stdlib/source/test/lux/macro/local.lux index 8cbc19a0c..5a59c735f 100644 --- a/stdlib/source/test/lux/macro/local.lux +++ b/stdlib/source/test/lux/macro/local.lux @@ -46,7 +46,7 @@ constant <code>.any pre_remove <code>.bit body <code>.any]) - (macro.with_identifiers [g!output] + (macro.with_symbols [g!output] (do meta.monad [pop! (/.push (list [name (..constant constant)])) [module short] (meta.normal name) diff --git a/stdlib/source/test/lux/macro/template.lux b/stdlib/source/test/lux/macro/template.lux index c2001cb23..2fb361c01 100644 --- a/stdlib/source/test/lux/macro/template.lux +++ b/stdlib/source/test/lux/macro/template.lux @@ -61,11 +61,11 @@ (case (/.text <short>) <short>' true _ false)) - (_.cover [/.identifier] - (and (case (`` (symbol (~~ (/.identifier <short>)))) + (_.cover [/.symbol] + (and (case (`` (symbol (~~ (/.symbol <short>)))) ["" <short>'] true _ false) - (case (`` (symbol (~~ (/.identifier <module> <short>)))) + (case (`` (symbol (~~ (/.symbol <module> <short>)))) [<module>' <short>'] true _ false) )) diff --git a/stdlib/source/test/lux/meta/symbol.lux b/stdlib/source/test/lux/meta/symbol.lux index 84f87e9fa..83fb1eefd 100644 --- a/stdlib/source/test/lux/meta/symbol.lux +++ b/stdlib/source/test/lux/meta/symbol.lux @@ -61,7 +61,7 @@ (_.for [.symbol] (let [(^open "/#[0]") /.equivalence] ($_ _.and - (_.test "Can obtain Symbol from identifier." + (_.test "Can obtain Symbol from a symbol." (and (/#= [.prelude_module "yolo"] (.symbol .yolo)) (/#= ["test/lux/meta/symbol" "yolo"] (.symbol ..yolo)) (/#= ["" "yolo"] (.symbol yolo)) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux index 8ab7706c7..ebd144e86 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux @@ -57,7 +57,7 @@ arg_name (|> (r.unicode 5) (r.only (|>> (text#= func_name) not))) [outputT outputC] _primitive.primitive [inputT _] _primitive.primitive - .let [g!arg (code.local_identifier arg_name)]] + .let [g!arg (code.local_symbol arg_name)]] (<| (_.context (%.symbol (symbol /.function))) ($_ _.and (_.test "Can analyse function." @@ -76,7 +76,7 @@ _structure.check_succeeds))) (_.test "The function's name is bound to the function's type." (|> (//type.with_type (Rec self (-> inputT self)) - (/.function _primitive.phase func_name arg_name archive.empty (code.local_identifier func_name))) + (/.function _primitive.phase func_name arg_name archive.empty (code.local_symbol func_name))) _structure.check_succeeds)) )))) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux index b8da226ad..d60b78f35 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux @@ -59,7 +59,7 @@ (//module.import def_module) (in []))] (//type.with_inference - (_primitive.phase archive.empty (code.identifier [def_module var_name])))))) + (_primitive.phase archive.empty (code.symbol [def_module var_name])))))) (phase.result _primitive.state) check!)) @@ -77,7 +77,7 @@ (|> (//scope.with_scope scope_name (//scope.with_local [var_name expectedT] (//type.with_inference - (_primitive.phase archive.empty (code.local_identifier var_name))))) + (_primitive.phase archive.empty (code.local_symbol var_name))))) (phase.result _primitive.state) (case> (^ {try.#Success [inferredT {////analysis.#Reference (////reference.local var)}]}) (and (type#= expectedT inferredT) @@ -90,7 +90,7 @@ (|> (do phase.monad [_ (//module.define var_name {.#Right [false expectedT []]})] (//type.with_inference - (_primitive.phase archive.empty (code.identifier def_name)))) + (_primitive.phase archive.empty (code.symbol def_name)))) (//module.with_module 0 def_module) (phase.result _primitive.state) (case> (^ {try.#Success [_ inferredT {////analysis.#Reference (////reference.constant constant_name)}]}) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux b/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux index 639132d1b..16bb01507 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux @@ -48,7 +48,7 @@ (do r.monad [size (|> r.nat (r#each (n.% 20)))] (|> (r.ascii/upper_alpha size) (r#each code.text))) - (|> symbol^ (r#each code.identifier)) + (|> symbol^ (r#each code.symbol)) (|> symbol^ (r#each code.tag)))) simple^ (: (Random Code) ($_ r.either diff --git a/stdlib/source/test/lux/type/resource.lux b/stdlib/source/test/lux/type/resource.lux index aad93d0a2..132674e8b 100644 --- a/stdlib/source/test/lux/type/resource.lux +++ b/stdlib/source/test/lux/type/resource.lux @@ -155,7 +155,7 @@ )) ))))) -(syntax: (with_error [exception <code>.identifier +(syntax: (with_error [exception <code>.symbol to_expand <code>.any]) (monad.do meta.monad [[_ _ exception] (meta.export exception)] |