From 971767f1eafb22208912353d8709f11081f2d3c8 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 14 Sep 2021 02:56:22 -0400 Subject: Re-named "Identifier" to "Symbol". --- stdlib/source/library/lux.lux | 452 +++++++++++++++++++++--------------------- 1 file changed, 226 insertions(+), 226 deletions(-) (limited to 'stdlib/source/library/lux.lux') 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 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 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 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 ( 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 ( 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 [] @@ -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 [ ] [[_ { 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 [ ] @@ -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)) -- cgit v1.2.3