From 224797231a8144f6ead1baab3b4b01a74cab629c Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 21 Nov 2022 16:40:51 -0400 Subject: Added index section to documentation + re-named Primitive -> Nominal --- stdlib/source/library/lux.lux | 78 +++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 39 deletions(-) (limited to 'stdlib/source/library/lux.lux') diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index 54daff3b3..535b103c8 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -116,7 +116,7 @@ #1) ... (type .public Tag -... (Primitive "#Tag")) +... (Nominal "#Tag")) (.def# Tag (.is_type# {9 #1 [..prelude "Tag"] @@ -124,7 +124,7 @@ #1) ... (type .public Slot -... (Primitive "#Slot")) +... (Nominal "#Slot")) (.def# Slot (.is_type# {9 #1 [..prelude "Slot"] @@ -172,7 +172,7 @@ ... (type .public Type ... (Rec Type ... (Variant -... {#Primitive Text (List Type)} +... {#Nominal Text (List Type)} ... {#Sum Type Type} ... {#Product Type Type} ... {#Function Type Type} @@ -194,7 +194,7 @@ {7 #0 {#End} {1 #0 - ... Primitive + ... Nominal {2 #0 Text Type_List} {1 #0 ... Sum @@ -232,7 +232,7 @@ (.def# type_tags (.is# {9 #0 Symbol List} - {0 #1 [[..prelude "#Primitive"] + {0 #1 [[..prelude "#Nominal"] {0 #1 [[..prelude "#Sum"] {0 #1 [[..prelude "#Product"] {0 #1 [[..prelude "#Function"] @@ -245,7 +245,7 @@ {0 #1 [[..prelude "#Named"] {0 #0}]}]}]}]}]}]}]}]}]}]}]}) #0) -(.def# #Primitive (.as# Tag [(.is# Label' {#Some [0 #0 ..type_tags]}) Type]) #1) +(.def# #Nominal (.as# Tag [(.is# Label' {#Some [0 #0 ..type_tags]}) Type]) #1) (.def# #Sum (.as# Tag [(.is# Label' {#Some [1 #0 ..type_tags]}) Type]) #1) (.def# #Product (.as# Tag [(.is# Label' {#Some [2 #0 ..type_tags]}) Type]) #1) (.def# #Function (.as# Tag [(.is# Label' {#Some [3 #0 ..type_tags]}) Type]) #1) @@ -939,11 +939,11 @@ .public) ... (type .public Macro -... (Primitive "#Macro")) +... (Nominal "#Macro")) (.def# Macro (.is# Type {#Named [..prelude "Macro"] - {#Primitive "#Macro" {#End}}}) + {#Nominal "#Macro" {#End}}}) .public) ... Base functions & macros @@ -1300,9 +1300,9 @@ (.i64_-# (.i64_-# depth id) 0)) ... Recur - {#Primitive name parameters} - {#Primitive name (list#each (__adjusted_quantified_type__ permission depth) - parameters)} + {#Nominal name parameters} + {#Nominal name (list#each (__adjusted_quantified_type__ permission depth) + parameters)} {#Sum left right} {#Sum (__adjusted_quantified_type__ permission depth left) @@ -1875,7 +1875,7 @@ (def' .public UnQuote Type {#Named [..prelude "UnQuote"] - {#Primitive "#Macro/UnQuote" {#End}}}) + {#Nominal "#Macro/UnQuote" {#End}}}) (def' .public (unquote it) (-> Macro UnQuote) @@ -1888,7 +1888,7 @@ (def' .public Spliced_UnQuote Type {#Named [..prelude "Spliced_UnQuote"] - {#Primitive "#Macro/Spliced_UnQuote" {#End}}}) + {#Nominal "#Macro/Spliced_UnQuote" {#End}}}) (def' .public (spliced_unquote it) (-> Macro Spliced_UnQuote) @@ -2042,7 +2042,7 @@ (def' .private (type#= left right) (-> Type Type Bit) - ({[{#Primitive nameL parametersL} {#Primitive nameR parametersR}] + ({[{#Nominal nameL parametersL} {#Nominal nameR parametersR}] (all and' (text#= nameL nameR) (.i64_=# (list#size parametersL) (list#size parametersR)) @@ -2263,17 +2263,17 @@ (untemplated_tuple @composite untemplated replace? subst elements)} [replace? token])) -(def' .public Primitive +(def' .public Nominal Macro (macro (_ tokens) ({{#Item [_ {#Text class_name}] {#End}} - (meta#in (list (variant$ (list (symbol$ [..prelude "#Primitive"]) (text$ class_name) |#End|)))) + (meta#in (list (variant$ (list (symbol$ [..prelude "#Nominal"]) (text$ class_name) |#End|)))) {#Item [_ {#Text class_name}] {#Item [_ {#Tuple params}] {#End}}} - (meta#in (list (variant$ (list (symbol$ [..prelude "#Primitive"]) (text$ class_name) (untemplated_list params))))) + (meta#in (list (variant$ (list (symbol$ [..prelude "#Nominal"]) (text$ class_name) (untemplated_list params))))) _ - (failure (wrong_syntax_error [..prelude "Primitive"]))} + (failure (wrong_syntax_error [..prelude "Nominal"]))} tokens))) (def' .public ` @@ -2624,7 +2624,7 @@ (def' .private (macro_type? type) (-> Type Bit) - ({{#Named ["library/lux" "Macro"] {#Primitive "#Macro" {#End}}} + ({{#Named ["library/lux" "Macro"] {#Nominal "#Macro" {#End}}} #1 _ @@ -3106,9 +3106,9 @@ (def' .private (type#encoded type) (-> Type Text) - ({{#Primitive name params} + ({{#Nominal name params} (all text#composite - "(Primitive " (text#encoded name) + "(Nominal " (text#encoded name) (|> params (list#each (function' [it] (|> it type#encoded (text#composite " ")))) list#reversed @@ -3179,28 +3179,28 @@ (in (symbol$ name)) {#Right [type value]} - ({{#Primitive "#Bit" {#End}} + ({{#Nominal "#Bit" {#End}} (in (bit$ (as Bit value))) - {#Primitive "#Frac" {#End}} + {#Nominal "#Frac" {#End}} (in (frac$ (as Frac value))) - {#Primitive "#Text" {#End}} + {#Nominal "#Text" {#End}} (in (text$ (as Text value))) - {#Primitive "#I64" {#Item {#Primitive "#Nat" {#End}} {#End}}} + {#Nominal "#I64" {#Item {#Nominal "#Nat" {#End}} {#End}}} (in (nat$ (as Nat value))) - {#Primitive "#I64" {#Item {#Primitive "#Int" {#End}} {#End}}} + {#Nominal "#I64" {#Item {#Nominal "#Int" {#End}} {#End}}} (in (int$ (as Int value))) - {#Primitive "#I64" {#Item {#Primitive "#Rev" {#End}} {#End}}} + {#Nominal "#I64" {#Item {#Nominal "#Rev" {#End}} {#End}}} (in (rev$ (as Rev value))) - {#Primitive "#Tag" {#End}} + {#Nominal "#Tag" {#End}} (in (symbol$ name)) - {#Primitive "#Slot" {#End}} + {#Nominal "#Slot" {#End}} (in (symbol$ name)) _ @@ -3255,7 +3255,7 @@ (def' .public Pattern Type {#Named [..prelude "Pattern"] - {#Primitive "#Macro/Pattern" {#End}}}) + {#Nominal "#Macro/Pattern" {#End}}}) (def' .public (pattern it) (-> Macro Pattern) @@ -4638,8 +4638,8 @@ (def (clean_type variables it) (-> (List [Nat (Maybe Type)]) Type Type) (when it - {#Primitive name parameters} - {#Primitive name (list#each (clean_type variables) parameters)} + {#Nominal name parameters} + {#Nominal name (list#each (clean_type variables) parameters)} {#Sum left right} {#Sum (clean_type variables left) @@ -5309,8 +5309,8 @@ (def (type_code type) (-> Type Code) (when type - {#Primitive name params} - (` {.#Primitive (, (text$ name)) (, (untemplated_list (list#each type_code params)))}) + {#Nominal name params} + (` {.#Nominal (, (text$ name)) (, (untemplated_list (list#each type_code params)))}) (with_template#pattern [] [{ left right} @@ -5570,7 +5570,7 @@ type+value (..definition_value symbol) .let [[type value] type+value]] (when (anonymous_type type) - {#Primitive "#Text" {#End}} + {#Nominal "#Text" {#End}} (in (as ..Text value)) _ @@ -5664,7 +5664,7 @@ (in {#Item =module =refers}))))) (type .public Immediate_UnQuote - (Primitive "#Macro/Immediate_UnQuote")) + (Nominal "#Macro/Immediate_UnQuote")) (def .public immediate_unquote (-> Macro Immediate_UnQuote) @@ -5791,9 +5791,9 @@ (def .public Rec (let [recursive_type (is (-> Code Code Text Code Code) (function (recursive_type g!self g!dummy name body) - (` {.#Apply (..Primitive "") + (` {.#Apply (..Nominal "") (.All ((, g!self) (, g!dummy)) - (, (let$ (local$ name) (` {.#Apply (..Primitive "") (, g!self)}) + (, (let$ (local$ name) (` {.#Apply (..Nominal "") (, g!self)}) body)))})))] (macro (_ tokens) (when tokens @@ -5821,7 +5821,7 @@ Type (let [[_ short] (symbol )] {#Named [..prelude short] - {.#Primitive (text#composite "#Extension/" short) (list)}}))] + {.#Nominal (text#composite "#Extension/" short) (list)}}))] [Analysis] [Synthesis] -- cgit v1.2.3