aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-07-28 04:48:42 -0400
committerEduardo Julian2021-07-28 04:48:42 -0400
commit5d4583aebd00adced10275b32ff1a93ab418be50 (patch)
tree89315e104e2b0ddd6d56f894f01a0575d3078699 /stdlib/source/library/lux.lux
parent061fd8a209bbcaffc2bfb850ac6046752a567d50 (diff)
Re-named List's tags: Nil => End && Cons => Item
Diffstat (limited to 'stdlib/source/library/lux.lux')
-rw-r--r--stdlib/source/library/lux.lux1162
1 files changed, 581 insertions, 581 deletions
diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux
index 881848963..9f2b0a697 100644
--- a/stdlib/source/library/lux.lux
+++ b/stdlib/source/library/lux.lux
@@ -52,14 +52,14 @@
#1)
## (type: (List a)
-## #Nil
-## (#Cons a (List a)))
+## #End
+## (#Item a (List a)))
("lux def type tagged" List
(9 #1 ["library/lux" "List"]
(7 #0 (0 #0)
- (1 #0 ## "lux.Nil"
+ (1 #0 ## "lux.End"
Any
- ## "lux.Cons"
+ ## "lux.Item"
(2 #0 (4 #0 1)
(9 #0 (4 #0 1) (4 #0 0))))))
[dummy_location
@@ -68,82 +68,82 @@
(0 #1 [[dummy_location (7 #0 ["library/lux" "doc"])]
[dummy_location (5 #0 "A potentially empty list of values.")]]
(0 #0))))]
- ["Nil" "Cons"]
+ ["End" "Item"]
#1)
("lux def" Bit
("lux type check type"
(9 #1 ["library/lux" "Bit"]
- (0 #0 "#Bit" #Nil)))
+ (0 #0 "#Bit" #End)))
[dummy_location
- (9 #1 (#Cons [[dummy_location (7 #0 ["library/lux" "doc"])]
+ (9 #1 (#Item [[dummy_location (7 #0 ["library/lux" "doc"])]
[dummy_location (5 #0 "Your standard, run-of-the-mill boolean values (as bits).")]]
- #Nil))]
+ #End))]
#1)
("lux def" I64
("lux type check type"
(9 #1 ["library/lux" "I64"]
(7 #0 (0 #0)
- (0 #0 "#I64" (#Cons (4 #0 1) #Nil)))))
+ (0 #0 "#I64" (#Item (4 #0 1) #End)))))
[dummy_location
- (9 #1 (#Cons [[dummy_location (7 #0 ["library/lux" "doc"])]
+ (9 #1 (#Item [[dummy_location (7 #0 ["library/lux" "doc"])]
[dummy_location (5 #0 "64-bit integers without any semantics.")]]
- #Nil))]
+ #End))]
#1)
("lux def" Nat
("lux type check type"
(9 #1 ["library/lux" "Nat"]
- (0 #0 "#I64" (#Cons (0 #0 "#Nat" #Nil) #Nil))))
+ (0 #0 "#I64" (#Item (0 #0 "#Nat" #End) #End))))
[dummy_location
- (9 #1 (#Cons [[dummy_location (7 #0 ["library/lux" "doc"])]
+ (9 #1 (#Item [[dummy_location (7 #0 ["library/lux" "doc"])]
[dummy_location (5 #0 ("lux text concat"
("lux text concat" "Natural numbers (unsigned integers)." __paragraph)
"They start at zero (0) and extend in the positive direction."))]]
- #Nil))]
+ #End))]
#1)
("lux def" Int
("lux type check type"
(9 #1 ["library/lux" "Int"]
- (0 #0 "#I64" (#Cons (0 #0 "#Int" #Nil) #Nil))))
+ (0 #0 "#I64" (#Item (0 #0 "#Int" #End) #End))))
[dummy_location
- (9 #1 (#Cons [[dummy_location (7 #0 ["library/lux" "doc"])]
+ (9 #1 (#Item [[dummy_location (7 #0 ["library/lux" "doc"])]
[dummy_location (5 #0 "Your standard, run-of-the-mill integer numbers.")]]
- #Nil))]
+ #End))]
#1)
("lux def" Rev
("lux type check type"
(9 #1 ["library/lux" "Rev"]
- (0 #0 "#I64" (#Cons (0 #0 "#Rev" #Nil) #Nil))))
+ (0 #0 "#I64" (#Item (0 #0 "#Rev" #End) #End))))
[dummy_location
- (9 #1 (#Cons [[dummy_location (7 #0 ["library/lux" "doc"])]
+ (9 #1 (#Item [[dummy_location (7 #0 ["library/lux" "doc"])]
[dummy_location (5 #0 ("lux text concat"
("lux text concat" "Fractional numbers that live in the interval [0,1)." __paragraph)
"Useful for probability, and other domains that work within that interval."))]]
- #Nil))]
+ #End))]
#1)
("lux def" Frac
("lux type check type"
(9 #1 ["library/lux" "Frac"]
- (0 #0 "#Frac" #Nil)))
+ (0 #0 "#Frac" #End)))
[dummy_location
- (9 #1 (#Cons [[dummy_location (7 #0 ["library/lux" "doc"])]
+ (9 #1 (#Item [[dummy_location (7 #0 ["library/lux" "doc"])]
[dummy_location (5 #0 "Your standard, run-of-the-mill floating-point (fractional) numbers.")]]
- #Nil))]
+ #End))]
#1)
("lux def" Text
("lux type check type"
(9 #1 ["library/lux" "Text"]
- (0 #0 "#Text" #Nil)))
+ (0 #0 "#Text" #End)))
[dummy_location
- (9 #1 (#Cons [[dummy_location (7 #0 ["library/lux" "doc"])]
+ (9 #1 (#Item [[dummy_location (7 #0 ["library/lux" "doc"])]
[dummy_location (5 #0 "Your standard, run-of-the-mill string values.")]]
- #Nil))]
+ #End))]
#1)
("lux def" Name
@@ -151,9 +151,9 @@
(9 #1 ["library/lux" "Name"]
(2 #0 Text Text)))
[dummy_location
- (9 #1 (#Cons [[dummy_location (7 #0 ["library/lux" "doc"])]
+ (9 #1 (#Item [[dummy_location (7 #0 ["library/lux" "doc"])]
[dummy_location (5 #0 "A name. It is used as part of Lux syntax to represent identifiers and tags.")]]
- #Nil))]
+ #End))]
#1)
## (type: (Maybe a)
@@ -161,17 +161,17 @@
## (#Some a))
("lux def type tagged" Maybe
(9 #1 ["library/lux" "Maybe"]
- (7 #0 #Nil
+ (7 #0 #End
(1 #0 ## "lux.None"
Any
## "lux.Some"
(4 #0 1))))
[dummy_location
- (9 #1 (#Cons [[dummy_location (7 #0 ["library/lux" "type-args"])]
- [dummy_location (9 #0 (#Cons [dummy_location (5 #0 "a")] #Nil))]]
- (#Cons [[dummy_location (7 #0 ["library/lux" "doc"])]
+ (9 #1 (#Item [[dummy_location (7 #0 ["library/lux" "type-args"])]
+ [dummy_location (9 #0 (#Item [dummy_location (5 #0 "a")] #End))]]
+ (#Item [[dummy_location (7 #0 ["library/lux" "doc"])]
[dummy_location (5 #0 "A potentially missing value.")]]
- #Nil)))]
+ #End)))]
["None" "Some"]
#1)
@@ -194,7 +194,7 @@
({Type_List
({Type_Pair
(9 #0 Nothing
- (7 #0 #Nil
+ (7 #0 #End
(1 #0 ## "lux.Primitive"
(2 #0 Text Type_List)
(1 #0 ## "lux.Sum"
@@ -221,11 +221,11 @@
("lux type check type" (9 #0 Type List)))}
("lux type check type" (9 #0 (4 #0 1) (4 #0 0)))))
[dummy_location
- (9 #1 (#Cons [[dummy_location (7 #0 ["library/lux" "doc"])]
+ (9 #1 (#Item [[dummy_location (7 #0 ["library/lux" "doc"])]
[dummy_location (5 #0 "This type represents the data-structures that are used to specify types themselves.")]]
- (#Cons [[dummy_location (7 #0 ["library/lux" "type-rec?"])]
+ (#Item [[dummy_location (7 #0 ["library/lux" "type-rec?"])]
[dummy_location (0 #0 #1)]]
- #Nil)))]
+ #End)))]
["Primitive" "Sum" "Product" "Function" "Parameter" "Var" "Ex" "UnivQ" "ExQ" "Apply" "Named"]
#1)
@@ -237,9 +237,9 @@
(#Named ["library/lux" "Location"]
(#Product Text (#Product Nat Nat)))
[dummy_location
- (9 #1 (#Cons [[dummy_location (7 #0 ["library/lux" "doc"])]
+ (9 #1 (#Item [[dummy_location (7 #0 ["library/lux" "doc"])]
[dummy_location (5 #0 "Locations are for specifying the location of Code nodes in Lux files during compilation.")]]
- #Nil))]
+ #End))]
["module" "line" "column"]
#1)
@@ -248,16 +248,16 @@
## #datum v})
("lux def type tagged" Ann
(#Named ["library/lux" "Ann"]
- (#UnivQ #Nil
- (#UnivQ #Nil
+ (#UnivQ #End
+ (#UnivQ #End
(#Product (#Parameter 3)
(#Parameter 1)))))
[dummy_location
- (9 #1 (#Cons [[dummy_location (7 #0 ["library/lux" "doc"])]
+ (9 #1 (#Item [[dummy_location (7 #0 ["library/lux" "doc"])]
[dummy_location (5 #0 "The type of things that can be annotated with meta-data of arbitrary types.")]]
- (#Cons [[dummy_location (7 #0 ["library/lux" "type-args"])]
- [dummy_location (9 #0 (#Cons [dummy_location (5 #0 "m")] (#Cons [dummy_location (5 #0 "v")] #Nil)))]]
- #Nil)))]
+ (#Item [[dummy_location (7 #0 ["library/lux" "type-args"])]
+ [dummy_location (9 #0 (#Item [dummy_location (5 #0 "m")] (#Item [dummy_location (5 #0 "v")] #End)))]]
+ #End)))]
["meta" "datum"]
#1)
@@ -277,7 +277,7 @@
(#Named ["library/lux" "Code'"]
({Code
({Code_List
- (#UnivQ #Nil
+ (#UnivQ #End
(#Sum ## "lux.Bit"
Bit
(#Sum ## "lux.Nat"
@@ -307,9 +307,9 @@
(#Parameter 0))
(#Parameter 1)))))
[dummy_location
- (9 #1 (#Cons [[dummy_location (7 #0 ["library/lux" "type-args"])]
- [dummy_location (9 #0 (#Cons [dummy_location (5 #0 "w")] #Nil))]]
- #Nil))]
+ (9 #1 (#Item [[dummy_location (7 #0 ["library/lux" "type-args"])]
+ [dummy_location (9 #0 (#Item [dummy_location (5 #0 "w")] #End))]]
+ #End))]
["Bit" "Nat" "Int" "Rev" "Frac" "Text" "Identifier" "Tag" "Form" "Tuple" "Record"]
#1)
@@ -321,9 +321,9 @@
(#Apply (#Apply w Code') w)}
("lux type check type" (#Apply Location Ann))))
[dummy_location
- (#Record (#Cons [[dummy_location (#Tag ["library/lux" "doc"])]
+ (#Record (#Item [[dummy_location (#Tag ["library/lux" "doc"])]
[dummy_location (#Text "The type of Code nodes for Lux syntax.")]]
- #Nil))]
+ #End))]
#1)
("lux def" _ann
@@ -333,85 +333,85 @@
Code)
([_ data]
[dummy_location data]))
- [dummy_location (#Record #Nil)]
+ [dummy_location (#Record #End)]
#0)
("lux def" bit$
("lux type check" (#Function Bit Code)
([_ value] (_ann (#Bit value))))
- [dummy_location (#Record #Nil)]
+ [dummy_location (#Record #End)]
#0)
("lux def" nat$
("lux type check" (#Function Nat Code)
([_ value] (_ann (#Nat value))))
- [dummy_location (#Record #Nil)]
+ [dummy_location (#Record #End)]
#0)
("lux def" int$
("lux type check" (#Function Int Code)
([_ value] (_ann (#Int value))))
- [dummy_location (#Record #Nil)]
+ [dummy_location (#Record #End)]
#0)
("lux def" rev$
("lux type check" (#Function Rev Code)
([_ value] (_ann (#Rev value))))
- [dummy_location (#Record #Nil)]
+ [dummy_location (#Record #End)]
#0)
("lux def" frac$
("lux type check" (#Function Frac Code)
([_ value] (_ann (#Frac value))))
- [dummy_location (#Record #Nil)]
+ [dummy_location (#Record #End)]
#0)
("lux def" text$
("lux type check" (#Function Text Code)
([_ text] (_ann (#Text text))))
- [dummy_location (#Record #Nil)]
+ [dummy_location (#Record #End)]
#0)
("lux def" identifier$
("lux type check" (#Function Name Code)
([_ name] (_ann (#Identifier name))))
- [dummy_location (#Record #Nil)]
+ [dummy_location (#Record #End)]
#0)
("lux def" local_identifier$
("lux type check" (#Function Text Code)
([_ name] (_ann (#Identifier ["" name]))))
- [dummy_location (#Record #Nil)]
+ [dummy_location (#Record #End)]
#0)
("lux def" tag$
("lux type check" (#Function Name Code)
([_ name] (_ann (#Tag name))))
- [dummy_location (#Record #Nil)]
+ [dummy_location (#Record #End)]
#0)
("lux def" local_tag$
("lux type check" (#Function Text Code)
([_ name] (_ann (#Tag ["" name]))))
- [dummy_location (#Record #Nil)]
+ [dummy_location (#Record #End)]
#0)
("lux def" form$
("lux type check" (#Function (#Apply Code List) Code)
([_ tokens] (_ann (#Form tokens))))
- [dummy_location (#Record #Nil)]
+ [dummy_location (#Record #End)]
#0)
("lux def" tuple$
("lux type check" (#Function (#Apply Code List) Code)
([_ tokens] (_ann (#Tuple tokens))))
- [dummy_location (#Record #Nil)]
+ [dummy_location (#Record #End)]
#0)
("lux def" record$
("lux type check" (#Function (#Apply (#Product Code Code) List) Code)
([_ tokens] (_ann (#Record tokens))))
- [dummy_location (#Record #Nil)]
+ [dummy_location (#Record #End)]
#0)
## (type: Definition
@@ -420,9 +420,9 @@
("lux type check type"
(#Named ["library/lux" "Definition"]
(#Product Bit (#Product Type (#Product Code Any)))))
- (record$ (#Cons [(tag$ ["library/lux" "doc"])
+ (record$ (#Item [(tag$ ["library/lux" "doc"])
(text$ "Represents all the data associated with a definition: its type, its annotations, and its value.")]
- #Nil))
+ #End))
#1)
## (type: Alias
@@ -431,7 +431,7 @@
("lux type check type"
(#Named ["library/lux" "Alias"]
Name))
- (record$ #Nil)
+ (record$ #End)
#1)
## (type: Global
@@ -441,9 +441,9 @@
(#Named ["library/lux" "Global"]
(#Sum Alias
Definition))
- (record$ (#Cons [(tag$ ["library/lux" "doc"])
+ (record$ (#Item [(tag$ ["library/lux" "doc"])
(text$ "Represents all the data associated with a global constant.")]
- #Nil))
+ #End))
["Alias" "Definition"]
#1)
@@ -452,17 +452,17 @@
## #mappings (List [k v])})
("lux def type tagged" Bindings
(#Named ["library/lux" "Bindings"]
- (#UnivQ #Nil
- (#UnivQ #Nil
+ (#UnivQ #End
+ (#UnivQ #End
(#Product ## "lux.counter"
Nat
## "lux.mappings"
(#Apply (#Product (#Parameter 3)
(#Parameter 1))
List)))))
- (record$ (#Cons [(tag$ ["library/lux" "type-args"])
- (tuple$ (#Cons (text$ "k") (#Cons (text$ "v") #Nil)))]
- #Nil))
+ (record$ (#Item [(tag$ ["library/lux" "type-args"])
+ (tuple$ (#Item (text$ "k") (#Item (text$ "v") #End)))]
+ #End))
["counter" "mappings"]
#1)
@@ -475,7 +475,7 @@
Nat
## Captured
Nat))
- (record$ #Nil)
+ (record$ #End)
["Local" "Captured"]
#1)
@@ -494,14 +494,14 @@
(#Apply (#Product Type Nat) (#Apply Text Bindings))
## captured
(#Apply (#Product Type Ref) (#Apply Text Bindings))))))
- (record$ #Nil)
+ (record$ #End)
["name" "inner" "locals" "captured"]
#1)
("lux def" Code_List
("lux type check type"
(#Apply Code List))
- (record$ #Nil)
+ (record$ #End)
#0)
## (type: (Either l r)
@@ -509,17 +509,17 @@
## (#Right r))
("lux def type tagged" Either
(#Named ["library/lux" "Either"]
- (#UnivQ #Nil
- (#UnivQ #Nil
+ (#UnivQ #End
+ (#UnivQ #End
(#Sum ## "lux.Left"
(#Parameter 3)
## "lux.Right"
(#Parameter 1)))))
- (record$ (#Cons [(tag$ ["library/lux" "type-args"])
- (tuple$ (#Cons (text$ "l") (#Cons (text$ "r") #Nil)))]
- (#Cons [(tag$ ["library/lux" "doc"])
+ (record$ (#Item [(tag$ ["library/lux" "type-args"])
+ (tuple$ (#Item (text$ "l") (#Item (text$ "r") #End)))]
+ (#Item [(tag$ ["library/lux" "doc"])
(text$ "A choice between two values of different types.")]
- #Nil)))
+ #End)))
["Left" "Right"]
#1)
@@ -529,7 +529,7 @@
("lux type check type"
(#Named ["library/lux" "Source"]
(#Product Location (#Product Nat Text))))
- (record$ #Nil)
+ (record$ #End)
#1)
## (type: Module_State
@@ -546,7 +546,7 @@
Any
## #Cached
Any)))
- (record$ #Nil)
+ (record$ #End)
["Active" "Compiled" "Cached"]
#1)
@@ -586,9 +586,9 @@
(#Apply Code Maybe)
Module_State))
))))))
- (record$ (#Cons [(tag$ ["library/lux" "doc"])
+ (record$ (#Item [(tag$ ["library/lux" "doc"])
(text$ "All the information contained within a Lux module.")]
- #Nil))
+ #End))
["module_hash" "module_aliases" "definitions" "imports" "tags" "types" "module_annotations" "module_state"]
#1)
@@ -605,7 +605,7 @@
## var_bindings
(#Apply (#Product Nat (#Apply Type Maybe))
List))))
- (record$ #Nil)
+ (record$ #End)
["ex_counter" "var_counter" "var_bindings"]
#1)
@@ -621,9 +621,9 @@
Any
## Interpreter
Any)))
- (record$ (#Cons [(tag$ ["library/lux" "doc"])
+ (record$ (#Item [(tag$ ["library/lux" "doc"])
(text$ "A sign that shows the conditions under which the compiler is running.")]
- #Nil))
+ #End))
["Build" "Eval" "Interpreter"]
#1)
@@ -641,9 +641,9 @@
Text
## mode
Mode)))
- (record$ (#Cons [(tag$ ["library/lux" "doc"])
+ (record$ (#Item [(tag$ ["library/lux" "doc"])
(text$ "Information about the current version and type of compiler that is running.")]
- #Nil))
+ #End))
["target" "version" "mode"]
#1)
@@ -686,13 +686,13 @@
Any
## "lux.host"
Any))))))))))))
- (record$ (#Cons [(tag$ ["library/lux" "doc"])
+ (record$ (#Item [(tag$ ["library/lux" "doc"])
(text$ ("lux text concat"
("lux text concat" "Represents the state of the Lux compiler during a run." __paragraph)
("lux text concat"
("lux text concat" "It is provided to macros during their invocation, so they can access compiler data." __paragraph)
"Caveat emptor: Avoid fiddling with it, unless you know what you're doing.")))]
- #Nil))
+ #End))
["info" "source" "location" "current_module" "modules" "scopes" "type_context" "expected" "seed" "scope_type_vars" "extensions" "host"]
#1)
@@ -701,17 +701,17 @@
("lux def" Meta
("lux type check type"
(#Named ["library/lux" "Meta"]
- (#UnivQ #Nil
+ (#UnivQ #End
(#Function Lux
(#Apply (#Product Lux (#Parameter 1))
(#Apply Text Either))))))
- (record$ (#Cons [(tag$ ["library/lux" "doc"])
+ (record$ (#Item [(tag$ ["library/lux" "doc"])
(text$ ("lux text concat"
("lux text concat" "Computations that can have access to the state of the compiler." __paragraph)
"These computations may fail, or modify the state of the compiler."))]
- (#Cons [(tag$ ["library/lux" "type-args"])
- (tuple$ (#Cons (text$ "a") #Nil))]
- #Nil)))
+ (#Item [(tag$ ["library/lux" "type-args"])
+ (tuple$ (#Item (text$ "a") #End))]
+ #End)))
#1)
## (type: Macro'
@@ -720,7 +720,7 @@
("lux type check type"
(#Named ["library/lux" "Macro'"]
(#Function Code_List (#Apply Code_List Meta))))
- (record$ #Nil)
+ (record$ #End)
#1)
## (type: Macro
@@ -728,16 +728,16 @@
("lux def" Macro
("lux type check type"
(#Named ["library/lux" "Macro"]
- (#Primitive "#Macro" #Nil)))
- (record$ (#Cons [(tag$ ["library/lux" "doc"])
+ (#Primitive "#Macro" #End)))
+ (record$ (#Item [(tag$ ["library/lux" "doc"])
(text$ "Functions that run at compile-time and allow you to transform and extend the language in powerful ways.")]
- #Nil))
+ #End))
#1)
## Base functions & macros
("lux def" return
("lux type check"
- (#UnivQ #Nil
+ (#UnivQ #End
(#Function (#Parameter 1)
(#Function Lux
(#Apply (#Product Lux
@@ -746,12 +746,12 @@
([_ val]
([_ state]
(#Right state val))))
- (record$ #Nil)
+ (record$ #End)
#0)
("lux def" failure
("lux type check"
- (#UnivQ #Nil
+ (#UnivQ #End
(#Function Text
(#Function Lux
(#Apply (#Product Lux
@@ -760,266 +760,266 @@
([_ msg]
([_ state]
(#Left msg))))
- (record$ #Nil)
+ (record$ #End)
#0)
("lux def" let''
("lux macro"
([_ tokens]
- ({(#Cons lhs (#Cons rhs (#Cons body #Nil)))
- (return (#Cons (form$ (#Cons (record$ (#Cons [lhs body] #Nil)) (#Cons rhs #Nil)))
- #Nil))
+ ({(#Item lhs (#Item rhs (#Item body #End)))
+ (return (#Item (form$ (#Item (record$ (#Item [lhs body] #End)) (#Item rhs #End)))
+ #End))
_
(failure "Wrong syntax for let''")}
tokens)))
- (record$ #.Nil)
+ (record$ #.End)
#0)
("lux def" function''
("lux macro"
([_ tokens]
- ({(#Cons [_ (#Tuple (#Cons arg args'))] (#Cons body #Nil))
- (return (#Cons (_ann (#Form (#Cons (_ann (#Tuple (#Cons (_ann (#Identifier ["" ""]))
- (#Cons arg #Nil))))
- (#Cons ({#Nil
+ ({(#Item [_ (#Tuple (#Item arg args'))] (#Item body #End))
+ (return (#Item (_ann (#Form (#Item (_ann (#Tuple (#Item (_ann (#Identifier ["" ""]))
+ (#Item arg #End))))
+ (#Item ({#End
body
_
- (_ann (#Form (#Cons (_ann (#Identifier ["library/lux" "function''"]))
- (#Cons (_ann (#Tuple args'))
- (#Cons body #Nil)))))}
+ (_ann (#Form (#Item (_ann (#Identifier ["library/lux" "function''"]))
+ (#Item (_ann (#Tuple args'))
+ (#Item body #End)))))}
args')
- #Nil))))
- #Nil))
+ #End))))
+ #End))
- (#Cons [_ (#Identifier ["" self])] (#Cons [_ (#Tuple (#Cons arg args'))] (#Cons body #Nil)))
- (return (#Cons (_ann (#Form (#Cons (_ann (#Tuple (#Cons (_ann (#Identifier ["" self]))
- (#Cons arg #Nil))))
- (#Cons ({#Nil
+ (#Item [_ (#Identifier ["" self])] (#Item [_ (#Tuple (#Item arg args'))] (#Item body #End)))
+ (return (#Item (_ann (#Form (#Item (_ann (#Tuple (#Item (_ann (#Identifier ["" self]))
+ (#Item arg #End))))
+ (#Item ({#End
body
_
- (_ann (#Form (#Cons (_ann (#Identifier ["library/lux" "function''"]))
- (#Cons (_ann (#Tuple args'))
- (#Cons body #Nil)))))}
+ (_ann (#Form (#Item (_ann (#Identifier ["library/lux" "function''"]))
+ (#Item (_ann (#Tuple args'))
+ (#Item body #End)))))}
args')
- #Nil))))
- #Nil))
+ #End))))
+ #End))
_
(failure "Wrong syntax for function''")}
tokens)))
- (record$ #.Nil)
+ (record$ #.End)
#0)
("lux def" location_code
("lux type check" Code
- (tuple$ (#Cons (text$ "") (#Cons (nat$ 0) (#Cons (nat$ 0) #Nil)))))
- (record$ #Nil)
+ (tuple$ (#Item (text$ "") (#Item (nat$ 0) (#Item (nat$ 0) #End)))))
+ (record$ #End)
#0)
("lux def" meta_code
("lux type check" (#Function Name (#Function Code Code))
([_ tag]
([_ value]
- (tuple$ (#Cons location_code
- (#Cons (form$ (#Cons (tag$ tag) (#Cons value #Nil)))
- #Nil))))))
- (record$ #Nil)
+ (tuple$ (#Item location_code
+ (#Item (form$ (#Item (tag$ tag) (#Item value #End)))
+ #End))))))
+ (record$ #End)
#0)
("lux def" flag_meta
("lux type check" (#Function Text Code)
([_ tag]
- (tuple$ (#Cons [(meta_code ["library/lux" "Tag"] (tuple$ (#Cons (text$ "library/lux") (#Cons (text$ tag) #Nil))))
- (#Cons [(meta_code ["library/lux" "Bit"] (bit$ #1))
- #Nil])]))))
- (record$ #Nil)
+ (tuple$ (#Item [(meta_code ["library/lux" "Tag"] (tuple$ (#Item (text$ "library/lux") (#Item (text$ tag) #End))))
+ (#Item [(meta_code ["library/lux" "Bit"] (bit$ #1))
+ #End])]))))
+ (record$ #End)
#0)
("lux def" doc_meta
("lux type check" (#Function Text (#Product Code Code))
(function'' [doc] [(tag$ ["library/lux" "doc"]) (text$ doc)]))
- (record$ #Nil)
+ (record$ #End)
#0)
("lux def" as_def
("lux type check" (#Function Code (#Function Code (#Function Code (#Function Bit Code))))
(function'' [name value annotations exported?]
- (form$ (#Cons (text$ "lux def") (#Cons name (#Cons value (#Cons annotations (#Cons (bit$ exported?) #Nil))))))))
- (record$ #Nil)
+ (form$ (#Item (text$ "lux def") (#Item name (#Item value (#Item annotations (#Item (bit$ exported?) #End))))))))
+ (record$ #End)
#0)
("lux def" as_checked
("lux type check" (#Function Code (#Function Code Code))
(function'' [type value]
- (form$ (#Cons (text$ "lux type check") (#Cons type (#Cons value #Nil))))))
- (record$ #Nil)
+ (form$ (#Item (text$ "lux type check") (#Item type (#Item value #End))))))
+ (record$ #End)
#0)
("lux def" as_function
("lux type check" (#Function Code (#Function (#Apply Code List) (#Function Code Code)))
(function'' [self inputs output]
- (form$ (#Cons (identifier$ ["library/lux" "function''"])
- (#Cons self
- (#Cons (tuple$ inputs)
- (#Cons output #Nil)))))))
- (record$ #Nil)
+ (form$ (#Item (identifier$ ["library/lux" "function''"])
+ (#Item self
+ (#Item (tuple$ inputs)
+ (#Item output #End)))))))
+ (record$ #End)
#0)
("lux def" as_macro
("lux type check" (#Function Code Code)
(function'' [expression]
- (form$ (#Cons (text$ "lux macro")
- (#Cons expression
- #Nil)))))
- (record$ #Nil)
+ (form$ (#Item (text$ "lux macro")
+ (#Item expression
+ #End)))))
+ (record$ #End)
#0)
("lux def" def:''
("lux macro"
(function'' [tokens]
- ({(#Cons [[_ (#Tag ["" "export"])]
- (#Cons [[_ (#Form (#Cons [name args]))]
- (#Cons [meta (#Cons [type (#Cons [body #Nil])])])])])
- (return (#Cons [(as_def name (as_checked type (as_function name args body))
- (form$ (#Cons (identifier$ ["library/lux" "record$"])
- (#Cons meta
- #Nil)))
+ ({(#Item [[_ (#Tag ["" "export"])]
+ (#Item [[_ (#Form (#Item [name args]))]
+ (#Item [meta (#Item [type (#Item [body #End])])])])])
+ (return (#Item [(as_def name (as_checked type (as_function name args body))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta
+ #End)))
#1)
- #Nil]))
+ #End]))
- (#Cons [[_ (#Tag ["" "export"])] (#Cons [name (#Cons [meta (#Cons [type (#Cons [body #Nil])])])])])
- (return (#Cons [(as_def name (as_checked type body)
- (form$ (#Cons (identifier$ ["library/lux" "record$"])
- (#Cons meta
- #Nil)))
+ (#Item [[_ (#Tag ["" "export"])] (#Item [name (#Item [meta (#Item [type (#Item [body #End])])])])])
+ (return (#Item [(as_def name (as_checked type body)
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta
+ #End)))
#1)
- #Nil]))
-
- (#Cons [[_ (#Form (#Cons [name args]))]
- (#Cons [meta (#Cons [type (#Cons [body #Nil])])])])
- (return (#Cons [(as_def name (as_checked type (as_function name args body))
- (form$ (#Cons (identifier$ ["library/lux" "record$"])
- (#Cons meta
- #Nil)))
+ #End]))
+
+ (#Item [[_ (#Form (#Item [name args]))]
+ (#Item [meta (#Item [type (#Item [body #End])])])])
+ (return (#Item [(as_def name (as_checked type (as_function name args body))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta
+ #End)))
#0)
- #Nil]))
+ #End]))
- (#Cons [name (#Cons [meta (#Cons [type (#Cons [body #Nil])])])])
- (return (#Cons [(as_def name (as_checked type body)
- (form$ (#Cons (identifier$ ["library/lux" "record$"])
- (#Cons meta
- #Nil)))
+ (#Item [name (#Item [meta (#Item [type (#Item [body #End])])])])
+ (return (#Item [(as_def name (as_checked type body)
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta
+ #End)))
#0)
- #Nil]))
+ #End]))
_
(failure "Wrong syntax for def''")}
tokens)))
- (record$ #.Nil)
+ (record$ #.End)
#0)
("lux def" macro:'
("lux macro"
(function'' [tokens]
- ({(#Cons [_ (#Form (#Cons name args))] (#Cons body #Nil))
- (return (#Cons (as_def name (as_macro (as_function name args body))
- (form$ (#Cons (identifier$ ["library/lux" "record$"])
- (#Cons (tag$ ["library/lux" "Nil"])
- #Nil)))
+ ({(#Item [_ (#Form (#Item name args))] (#Item body #End))
+ (return (#Item (as_def name (as_macro (as_function name args body))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item (tag$ ["library/lux" "End"])
+ #End)))
#0)
- #Nil))
+ #End))
- (#Cons [_ (#Tag ["" "export"])] (#Cons [_ (#Form (#Cons name args))] (#Cons body #Nil)))
- (return (#Cons (as_def name (as_macro (as_function name args body))
- (form$ (#Cons (identifier$ ["library/lux" "record$"])
- (#Cons (tag$ ["library/lux" "Nil"])
- #Nil)))
+ (#Item [_ (#Tag ["" "export"])] (#Item [_ (#Form (#Item name args))] (#Item body #End)))
+ (return (#Item (as_def name (as_macro (as_function name args body))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item (tag$ ["library/lux" "End"])
+ #End)))
#1)
- #Nil))
+ #End))
- (#Cons [_ (#Tag ["" "export"])] (#Cons [_ (#Form (#Cons name args))] (#Cons meta_data (#Cons body #Nil))))
- (return (#Cons (as_def name (as_macro (as_function name args body))
- (form$ (#Cons (identifier$ ["library/lux" "record$"])
- (#Cons meta_data
- #Nil)))
+ (#Item [_ (#Tag ["" "export"])] (#Item [_ (#Form (#Item name args))] (#Item meta_data (#Item body #End))))
+ (return (#Item (as_def name (as_macro (as_function name args body))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta_data
+ #End)))
#1)
- #Nil))
+ #End))
_
(failure "Wrong syntax for macro:'")}
tokens)))
- (record$ #.Nil)
+ (record$ #.End)
#0)
(macro:' #export (comment tokens)
- (#Cons [(tag$ ["library/lux" "doc"])
+ (#Item [(tag$ ["library/lux" "doc"])
(text$ ("lux text concat"
("lux text concat" "## Throws away any code given to it." __paragraph)
("lux text concat"
("lux text concat" "## Great for commenting-out code, while retaining syntax high-lighting and formatting in your text editor." __paragraph)
"(comment +1 +2 +3 +4)")))]
- #Nil)
- (return #Nil))
+ #End)
+ (return #End))
(macro:' ($' tokens)
- ({(#Cons x #Nil)
+ ({(#Item x #End)
(return tokens)
- (#Cons x (#Cons y xs))
- (return (#Cons (form$ (#Cons (identifier$ ["library/lux" "$'"])
- (#Cons (form$ (#Cons (tag$ ["library/lux" "Apply"])
- (#Cons y (#Cons x #Nil))))
+ (#Item x (#Item y xs))
+ (return (#Item (form$ (#Item (identifier$ ["library/lux" "$'"])
+ (#Item (form$ (#Item (tag$ ["library/lux" "Apply"])
+ (#Item y (#Item x #End))))
xs)))
- #Nil))
+ #End))
_
(failure "Wrong syntax for $'")}
tokens))
(def:'' (list\map f xs)
- #Nil
- (#UnivQ #Nil
- (#UnivQ #Nil
+ #End
+ (#UnivQ #End
+ (#UnivQ #End
(#Function (#Function (#Parameter 3) (#Parameter 1))
(#Function ($' List (#Parameter 3))
($' List (#Parameter 1))))))
- ({#Nil
- #Nil
+ ({#End
+ #End
- (#Cons x xs')
- (#Cons (f x) (list\map f xs'))}
+ (#Item x xs')
+ (#Item (f x) (list\map f xs'))}
xs))
(def:'' RepEnv
- #Nil
+ #End
Type
($' List (#Product Text Code)))
(def:'' (make_env xs ys)
- #Nil
+ #End
(#Function ($' List Text) (#Function ($' List Code) RepEnv))
- ({[(#Cons x xs') (#Cons y ys')]
- (#Cons [x y] (make_env xs' ys'))
+ ({[(#Item x xs') (#Item y ys')]
+ (#Item [x y] (make_env xs' ys'))
_
- #Nil}
+ #End}
[xs ys]))
(def:'' (text\= reference sample)
- #Nil
+ #End
(#Function Text (#Function Text Bit))
("lux text =" reference sample))
(def:'' (get_rep key env)
- #Nil
+ #End
(#Function Text (#Function RepEnv ($' Maybe Code)))
- ({#Nil
+ ({#End
#None
- (#Cons [k v] env')
+ (#Item [k v] env')
({#1
(#Some v)
@@ -1029,7 +1029,7 @@
env))
(def:'' (replace_syntax reps syntax)
- #Nil
+ #End
(#Function RepEnv (#Function Code Code))
({[_ (#Identifier "" name)]
({(#Some replacement)
@@ -1058,7 +1058,7 @@
syntax))
(def:'' (n/* param subject)
- (#.Cons (doc_meta "Nat(ural) multiplication.") #.Nil)
+ (#.Item (doc_meta "Nat(ural) multiplication.") #.End)
(#Function Nat (#Function Nat Nat))
("lux type as" Nat
("lux i64 *"
@@ -1066,7 +1066,7 @@
("lux type as" Int subject))))
(def:'' (update_parameters code)
- #Nil
+ #End
(#Function Code Code)
({[_ (#Tuple members)]
(tuple$ (list\map update_parameters members))
@@ -1078,8 +1078,8 @@
[name (update_parameters val)])))
pairs))
- [_ (#Form (#Cons [_ (#Tag "library/lux" "Parameter")] (#Cons [_ (#Nat idx)] #Nil)))]
- (form$ (#Cons (tag$ ["library/lux" "Parameter"]) (#Cons (nat$ ("lux i64 +" 2 idx)) #Nil)))
+ [_ (#Form (#Item [_ (#Tag "library/lux" "Parameter")] (#Item [_ (#Nat idx)] #End)))]
+ (form$ (#Item (tag$ ["library/lux" "Parameter"]) (#Item (nat$ ("lux i64 +" 2 idx)) #End)))
[_ (#Form members)]
(form$ (list\map update_parameters members))
@@ -1089,51 +1089,51 @@
code))
(def:'' (quantified_args_parser args next)
- #Nil
+ #End
## (-> (List Code) (-> (List Text) (Meta (List Code))) (Meta (List Code)))
(#Function ($' List Code)
(#Function (#Function ($' List Text) (#Apply ($' List Code) Meta))
(#Apply ($' List Code) Meta)
))
- ({#Nil
- (next #Nil)
+ ({#End
+ (next #End)
- (#Cons [_ (#Identifier "" arg_name)] args')
- (quantified_args_parser args' (function'' [names] (next (#Cons arg_name names))))
+ (#Item [_ (#Identifier "" arg_name)] args')
+ (quantified_args_parser args' (function'' [names] (next (#Item arg_name names))))
_
(failure "Expected identifier.")}
args))
(def:'' (make_parameter idx)
- #Nil
+ #End
(#Function Nat Code)
- (form$ (#Cons (tag$ ["library/lux" "Parameter"]) (#Cons (nat$ idx) #Nil))))
+ (form$ (#Item (tag$ ["library/lux" "Parameter"]) (#Item (nat$ idx) #End))))
(def:'' (list\fold f init xs)
- #Nil
+ #End
## (All [a b] (-> (-> b a a) a (List b) a))
- (#UnivQ #Nil (#UnivQ #Nil (#Function (#Function (#Parameter 1)
+ (#UnivQ #End (#UnivQ #End (#Function (#Function (#Parameter 1)
(#Function (#Parameter 3)
(#Parameter 3)))
(#Function (#Parameter 3)
(#Function ($' List (#Parameter 1))
(#Parameter 3))))))
- ({#Nil
+ ({#End
init
- (#Cons x xs')
+ (#Item x xs')
(list\fold f (f x init) xs')}
xs))
(def:'' (list\size list)
- #Nil
- (#UnivQ #Nil
+ #End
+ (#UnivQ #End
(#Function ($' List (#Parameter 1)) Nat))
(list\fold (function'' [_ acc] ("lux i64 +" 1 acc)) 0 list))
(macro:' #export (All tokens)
- (#Cons [(tag$ ["library/lux" "doc"])
+ (#Item [(tag$ ["library/lux" "doc"])
(text$ ("lux text concat"
("lux text concat" "## Universal quantification." __paragraph)
("lux text concat"
@@ -1141,43 +1141,43 @@
("lux text concat"
("lux text concat" "## A name can be provided, to specify a recursive type." __paragraph)
"(All List [a] (| Any [a (List a)]))"))))]
- #Nil)
- (let'' [self_name tokens] ({(#Cons [_ (#Identifier "" self_name)] tokens)
+ #End)
+ (let'' [self_name tokens] ({(#Item [_ (#Identifier "" self_name)] tokens)
[self_name tokens]
_
["" tokens]}
tokens)
- ({(#Cons [_ (#Tuple args)] (#Cons body #Nil))
+ ({(#Item [_ (#Tuple args)] (#Item body #End))
(quantified_args_parser args
(function'' [names]
(let'' body' (list\fold ("lux type check" (#Function Text (#Function Code Code))
(function'' [name' body']
- (form$ (#Cons (tag$ ["library/lux" "UnivQ"])
- (#Cons (tag$ ["library/lux" "Nil"])
- (#Cons (replace_syntax (#Cons [name' (make_parameter 1)] #Nil)
- (update_parameters body')) #Nil))))))
+ (form$ (#Item (tag$ ["library/lux" "UnivQ"])
+ (#Item (tag$ ["library/lux" "End"])
+ (#Item (replace_syntax (#Item [name' (make_parameter 1)] #End)
+ (update_parameters body')) #End))))))
body
names)
- (return (#Cons ({[#1 _]
+ (return (#Item ({[#1 _]
body'
- [_ #Nil]
+ [_ #End]
body'
[#0 _]
- (replace_syntax (#Cons [self_name (make_parameter (n/* 2 ("lux i64 -" 1 (list\size names))))]
- #Nil)
+ (replace_syntax (#Item [self_name (make_parameter (n/* 2 ("lux i64 -" 1 (list\size names))))]
+ #End)
body')}
[(text\= "" self_name) names])
- #Nil)))))
+ #End)))))
_
(failure "Wrong syntax for All")}
tokens)))
(macro:' #export (Ex tokens)
- (#Cons [(tag$ ["library/lux" "doc"])
+ (#Item [(tag$ ["library/lux" "doc"])
(text$ ("lux text concat"
("lux text concat" "## Existential quantification." __paragraph)
("lux text concat"
@@ -1185,93 +1185,93 @@
("lux text concat"
("lux text concat" "## A name can be provided, to specify a recursive type." __paragraph)
"(Ex Self [a] [(Codec Text a) a (List (Self a))])"))))]
- #Nil)
- (let'' [self_name tokens] ({(#Cons [_ (#Identifier "" self_name)] tokens)
+ #End)
+ (let'' [self_name tokens] ({(#Item [_ (#Identifier "" self_name)] tokens)
[self_name tokens]
_
["" tokens]}
tokens)
- ({(#Cons [_ (#Tuple args)] (#Cons body #Nil))
+ ({(#Item [_ (#Tuple args)] (#Item body #End))
(quantified_args_parser args
(function'' [names]
(let'' body' (list\fold ("lux type check" (#Function Text (#Function Code Code))
(function'' [name' body']
- (form$ (#Cons (tag$ ["library/lux" "ExQ"])
- (#Cons (tag$ ["library/lux" "Nil"])
- (#Cons (replace_syntax (#Cons [name' (make_parameter 1)] #Nil)
- (update_parameters body')) #Nil))))))
+ (form$ (#Item (tag$ ["library/lux" "ExQ"])
+ (#Item (tag$ ["library/lux" "End"])
+ (#Item (replace_syntax (#Item [name' (make_parameter 1)] #End)
+ (update_parameters body')) #End))))))
body
names)
- (return (#Cons ({[#1 _]
+ (return (#Item ({[#1 _]
body'
- [_ #Nil]
+ [_ #End]
body'
[#0 _]
- (replace_syntax (#Cons [self_name (make_parameter (n/* 2 ("lux i64 -" 1 (list\size names))))]
- #Nil)
+ (replace_syntax (#Item [self_name (make_parameter (n/* 2 ("lux i64 -" 1 (list\size names))))]
+ #End)
body')}
[(text\= "" self_name) names])
- #Nil)))))
+ #End)))))
_
(failure "Wrong syntax for Ex")}
tokens)))
(def:'' (list\reverse list)
- #Nil
+ #End
(All [a] (#Function ($' List a) ($' List a)))
(list\fold ("lux type check" (All [a] (#Function a (#Function ($' List a) ($' List a))))
- (function'' [head tail] (#Cons head tail)))
- #Nil
+ (function'' [head tail] (#Item head tail)))
+ #End
list))
(macro:' #export (-> tokens)
- (#Cons [(tag$ ["library/lux" "doc"])
+ (#Item [(tag$ ["library/lux" "doc"])
(text$ ("lux text concat"
("lux text concat" "## Function types:" __paragraph)
("lux text concat"
("lux text concat" "(-> Int Int Int)" __paragraph)
"## This is the type of a function that takes 2 Ints and returns an Int.")))]
- #Nil)
- ({(#Cons output inputs)
- (return (#Cons (list\fold ("lux type check" (#Function Code (#Function Code Code))
- (function'' [i o] (form$ (#Cons (tag$ ["library/lux" "Function"]) (#Cons i (#Cons o #Nil))))))
+ #End)
+ ({(#Item output inputs)
+ (return (#Item (list\fold ("lux type check" (#Function Code (#Function Code Code))
+ (function'' [i o] (form$ (#Item (tag$ ["library/lux" "Function"]) (#Item i (#Item o #End))))))
output
inputs)
- #Nil))
+ #End))
_
(failure "Wrong syntax for ->")}
(list\reverse tokens)))
(macro:' #export (list xs)
- (#Cons [(tag$ ["library/lux" "doc"])
+ (#Item [(tag$ ["library/lux" "doc"])
(text$ ("lux text concat"
("lux text concat" "## List-construction macro." __paragraph)
"(list +1 +2 +3)"))]
- #Nil)
- (return (#Cons (list\fold (function'' [head tail]
- (form$ (#Cons (tag$ ["library/lux" "Cons"])
- (#Cons (tuple$ (#Cons [head (#Cons [tail #Nil])]))
- #Nil))))
- (tag$ ["library/lux" "Nil"])
+ #End)
+ (return (#Item (list\fold (function'' [head tail]
+ (form$ (#Item (tag$ ["library/lux" "Item"])
+ (#Item (tuple$ (#Item [head (#Item [tail #End])]))
+ #End))))
+ (tag$ ["library/lux" "End"])
(list\reverse xs))
- #Nil)))
+ #End)))
(macro:' #export (list& xs)
- (#Cons [(tag$ ["library/lux" "doc"])
+ (#Item [(tag$ ["library/lux" "doc"])
(text$ ("lux text concat"
("lux text concat" "## List-construction macro, with the last element being a tail-list." __paragraph)
("lux text concat"
("lux text concat" "## In other words, this macro prepends elements to another list." __paragraph)
"(list& +1 +2 +3 (list +4 +5 +6))")))]
- #Nil)
- ({(#Cons last init)
+ #End)
+ ({(#Item last init)
(return (list (list\fold (function'' [head tail]
- (form$ (list (tag$ ["library/lux" "Cons"])
+ (form$ (list (tag$ ["library/lux" "Item"])
(tuple$ (list head tail)))))
last
init)))
@@ -1281,7 +1281,7 @@
(list\reverse xs)))
(macro:' #export (& tokens)
- (#Cons [(tag$ ["library/lux" "doc"])
+ (#Item [(tag$ ["library/lux" "doc"])
(text$ ("lux text concat"
("lux text concat" "## Tuple types:" __paragraph)
("lux text concat"
@@ -1289,18 +1289,18 @@
("lux text concat"
("lux text concat" "## Any." __paragraph)
"(&)"))))]
- #Nil)
- ({#Nil
+ #End)
+ ({#End
(return (list (identifier$ ["library/lux" "Any"])))
- (#Cons last prevs)
+ (#Item last prevs)
(return (list (list\fold (function'' [left right] (form$ (list (tag$ ["library/lux" "Product"]) left right)))
last
prevs)))}
(list\reverse tokens)))
(macro:' #export (| tokens)
- (#Cons [(tag$ ["library/lux" "doc"])
+ (#Item [(tag$ ["library/lux" "doc"])
(text$ ("lux text concat"
("lux text concat" "## Variant types:" __paragraph)
("lux text concat"
@@ -1308,28 +1308,28 @@
("lux text concat"
("lux text concat" "## Nothing." __paragraph)
"(|)"))))]
- #Nil)
- ({#Nil
+ #End)
+ ({#End
(return (list (identifier$ ["library/lux" "Nothing"])))
- (#Cons last prevs)
+ (#Item last prevs)
(return (list (list\fold (function'' [left right] (form$ (list (tag$ ["library/lux" "Sum"]) left right)))
last
prevs)))}
(list\reverse tokens)))
(macro:' (function' tokens)
- (let'' [name tokens'] ({(#Cons [[_ (#Identifier ["" name])] tokens'])
+ (let'' [name tokens'] ({(#Item [[_ (#Identifier ["" name])] tokens'])
[name tokens']
_
["" tokens]}
tokens)
- ({(#Cons [[_ (#Tuple args)] (#Cons [body #Nil])])
- ({#Nil
+ ({(#Item [[_ (#Tuple args)] (#Item [body #End])])
+ ({#End
(failure "function' requires a non-empty arguments tuple.")
- (#Cons [harg targs])
+ (#Item [harg targs])
(return (list (form$ (list (tuple$ (list (local_identifier$ name)
harg))
(list\fold (function'' [arg body']
@@ -1345,9 +1345,9 @@
tokens')))
(macro:' (def:''' tokens)
- ({(#Cons [[_ (#Tag ["" "export"])]
- (#Cons [[_ (#Form (#Cons [name args]))]
- (#Cons [meta (#Cons [type (#Cons [body #Nil])])])])])
+ ({(#Item [[_ (#Tag ["" "export"])]
+ (#Item [[_ (#Form (#Item [name args]))]
+ (#Item [meta (#Item [type (#Item [body #End])])])])])
(return (list (form$ (list (text$ "lux def")
name
(form$ (list (text$ "lux type check")
@@ -1356,24 +1356,24 @@
name
(tuple$ args)
body))))
- (form$ (#Cons (identifier$ ["library/lux" "record$"])
- (#Cons meta
- #Nil)))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta
+ #End)))
(bit$ #1)))))
- (#Cons [[_ (#Tag ["" "export"])] (#Cons [name (#Cons [meta (#Cons [type (#Cons [body #Nil])])])])])
+ (#Item [[_ (#Tag ["" "export"])] (#Item [name (#Item [meta (#Item [type (#Item [body #End])])])])])
(return (list (form$ (list (text$ "lux def")
name
(form$ (list (text$ "lux type check")
type
body))
- (form$ (#Cons (identifier$ ["library/lux" "record$"])
- (#Cons meta
- #Nil)))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta
+ #End)))
(bit$ #1)))))
- (#Cons [[_ (#Form (#Cons [name args]))]
- (#Cons [meta (#Cons [type (#Cons [body #Nil])])])])
+ (#Item [[_ (#Form (#Item [name args]))]
+ (#Item [meta (#Item [type (#Item [body #End])])])])
(return (list (form$ (list (text$ "lux def")
name
(form$ (list (text$ "lux type check")
@@ -1382,18 +1382,18 @@
name
(tuple$ args)
body))))
- (form$ (#Cons (identifier$ ["library/lux" "record$"])
- (#Cons meta
- #Nil)))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta
+ #End)))
(bit$ #0)))))
- (#Cons [name (#Cons [meta (#Cons [type (#Cons [body #Nil])])])])
+ (#Item [name (#Item [meta (#Item [type (#Item [body #End])])])])
(return (list (form$ (list (text$ "lux def")
name
(form$ (list (text$ "lux type check") type body))
- (form$ (#Cons (identifier$ ["library/lux" "record$"])
- (#Cons meta
- #Nil)))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta
+ #End)))
(bit$ #0)))))
_
@@ -1401,17 +1401,17 @@
tokens))
(def:''' (as_pairs xs)
- #Nil
+ #End
(All [a] (-> ($' List a) ($' List (& a a))))
- ({(#Cons x (#Cons y xs'))
- (#Cons [x y] (as_pairs xs'))
+ ({(#Item x (#Item y xs'))
+ (#Item [x y] (as_pairs xs'))
_
- #Nil}
+ #End}
xs))
(macro:' (let' tokens)
- ({(#Cons [[_ (#Tuple bindings)] (#Cons [body #Nil])])
+ ({(#Item [[_ (#Tuple bindings)] (#Item [body #End])])
(return (list (list\fold ("lux type check" (-> (& Code Code) Code
Code)
(function' [binding body]
@@ -1426,46 +1426,46 @@
tokens))
(def:''' (any? p xs)
- #Nil
+ #End
(All [a]
(-> (-> a Bit) ($' List a) Bit))
- ({#Nil
+ ({#End
#0
- (#Cons x xs')
+ (#Item x xs')
({#1 #1
#0 (any? p xs')}
(p x))}
xs))
(def:''' (wrap_meta content)
- #Nil
+ #End
(-> Code Code)
(tuple$ (list (tuple$ (list (text$ "") (nat$ 0) (nat$ 0)))
content)))
(def:''' (untemplated_list tokens)
- #Nil
+ #End
(-> ($' List Code) Code)
- ({#Nil
- (_ann (#Tag ["library/lux" "Nil"]))
+ ({#End
+ (_ann (#Tag ["library/lux" "End"]))
- (#Cons [token tokens'])
- (_ann (#Form (list (_ann (#Tag ["library/lux" "Cons"])) token (untemplated_list tokens'))))}
+ (#Item [token tokens'])
+ (_ann (#Form (list (_ann (#Tag ["library/lux" "Item"])) token (untemplated_list tokens'))))}
tokens))
(def:''' (list\compose xs ys)
- #Nil
+ #End
(All [a] (-> ($' List a) ($' List a) ($' List a)))
- ({(#Cons x xs')
- (#Cons x (list\compose xs' ys))
+ ({(#Item x xs')
+ (#Item x (list\compose xs' ys))
- #Nil
+ #End
ys}
xs))
(def:''' (_$_joiner op a1 a2)
- #Nil
+ #End
(-> Code Code Code Code)
({[_ (#Form parts)]
(form$ (list\compose parts (list a1 a2)))
@@ -1475,14 +1475,14 @@
op))
(def:''' (function/flip func)
- #Nil
+ #End
(All [a b c]
(-> (-> a b c) (-> b a c)))
(function' [right left]
(func left right)))
(macro:' #export (_$ tokens)
- (#Cons [(tag$ ["library/lux" "doc"])
+ (#Item [(tag$ ["library/lux" "doc"])
(text$ ("lux text concat"
("lux text concat" "## Left-association for the application of binary functions over variadic arguments." ..\n)
("lux text concat"
@@ -1490,9 +1490,9 @@
("lux text concat"
("lux text concat" "## =>" ..\n)
"(text\compose (text\compose ''Hello, '' name) ''. How are you?'')"))))]
- #Nil)
- ({(#Cons op tokens')
- ({(#Cons first nexts)
+ #End)
+ ({(#Item op tokens')
+ ({(#Item first nexts)
(return (list (list\fold (function/flip (_$_joiner op)) first nexts)))
_
@@ -1504,7 +1504,7 @@
tokens))
(macro:' #export ($_ tokens)
- (#Cons [(tag$ ["library/lux" "doc"])
+ (#Item [(tag$ ["library/lux" "doc"])
(text$ ("lux text concat"
("lux text concat" "## Right-association for the application of binary functions over variadic arguments." ..\n)
("lux text concat"
@@ -1512,9 +1512,9 @@
("lux text concat"
("lux text concat" "## =>" ..\n)
"(text\compose ''Hello, '' (text\compose name ''. How are you?''))"))))]
- #Nil)
- ({(#Cons op tokens')
- ({(#Cons last prevs)
+ #End)
+ ({(#Item op tokens')
+ ({(#Item last prevs)
(return (list (list\fold (_$_joiner op) last prevs)))
_
@@ -1542,7 +1542,7 @@
#0)
(def:''' maybe_monad
- #Nil
+ #End
($' Monad Maybe)
{#in
(function' [x] (#Some x))
@@ -1554,7 +1554,7 @@
ma))})
(def:''' meta_monad
- #Nil
+ #End
($' Monad Meta)
{#in
(function' [x]
@@ -1572,7 +1572,7 @@
(ma state))))})
(macro:' (do tokens)
- ({(#Cons monad (#Cons [_ (#Tuple bindings)] (#Cons body #Nil)))
+ ({(#Item monad (#Item [_ (#Tuple bindings)] (#Item body #End)))
(let' [g!in (local_identifier$ "in")
g!bind (local_identifier$ " bind ")
body' (list\fold ("lux type check" (-> (& Code Code) Code Code)
@@ -1597,7 +1597,7 @@
tokens))
(def:''' (monad\map m f xs)
- #Nil
+ #End
## (All [m a b]
## (-> (Monad m) (-> a (m b)) (List a) (m (List b))))
(All [m a b]
@@ -1606,18 +1606,18 @@
($' List a)
($' m ($' List b))))
(let' [{#in in #bind _} m]
- ({#Nil
- (in #Nil)
+ ({#End
+ (in #End)
- (#Cons x xs')
+ (#Item x xs')
(do m
[y (f x)
ys (monad\map m f xs')]
- (in (#Cons y ys)))}
+ (in (#Item y ys)))}
xs)))
(def:''' (monad\fold m f y xs)
- #Nil
+ #End
## (All [m a b]
## (-> (Monad m) (-> a b (m b)) b (List a) (m b)))
(All [m a b]
@@ -1627,10 +1627,10 @@
($' List a)
($' m b)))
(let' [{#in in #bind _} m]
- ({#Nil
+ ({#End
(in y)
- (#Cons x xs')
+ (#Item x xs')
(do m
[y' (f x y)]
(monad\fold m f y' xs'))}
@@ -1642,7 +1642,7 @@
"Picks which expression to evaluate based on a bit test value." __paragraph
"(if #1 ''Oh, yeah!'' ''Aw hell naw!'')" __paragraph
"=> ''Oh, yeah!''"))])
- ({(#Cons test (#Cons then (#Cons else #Nil)))
+ ({(#Item test (#Item then (#Item else #End)))
(return (list (form$ (list (record$ (list [(bit$ #1) then]
[(bit$ #0) else]))
test))))
@@ -1652,38 +1652,38 @@
tokens))
(def:''' (get k plist)
- #Nil
+ #End
(All [a]
(-> Text ($' List (& Text a)) ($' Maybe a)))
- ({(#Cons [[k' v] plist'])
+ ({(#Item [[k' v] plist'])
(if (text\= k k')
(#Some v)
(get k plist'))
- #Nil
+ #End
#None}
plist))
(def:''' (put k v dict)
- #Nil
+ #End
(All [a]
(-> Text a ($' List (& Text a)) ($' List (& Text a))))
- ({#Nil
+ ({#End
(list [k v])
- (#Cons [[k' v'] dict'])
+ (#Item [[k' v'] dict'])
(if (text\= k k')
- (#Cons [[k' v] dict'])
- (#Cons [[k' v'] (put k v dict')]))}
+ (#Item [[k' v] dict'])
+ (#Item [[k' v'] (put k v dict')]))}
dict))
(def:''' (text\compose x y)
- #Nil
+ #End
(-> Text Text Text)
("lux text concat" x y))
(def:''' (name\encode full_name)
- #Nil
+ #End
(-> Name Text)
(let' [[module name] full_name]
({"" name
@@ -1691,11 +1691,11 @@
module)))
(def:''' (get_meta tag def_meta)
- #Nil
+ #End
(-> Name Code ($' Maybe Code))
(let' [[prefix name] tag]
({[_ (#Record def_meta)]
- ({(#Cons [key value] def_meta')
+ ({(#Item [key value] def_meta')
({[_ (#Tag [prefix' name'])]
({[#1 #1]
(#Some value)
@@ -1709,7 +1709,7 @@
(get_meta tag (record$ def_meta'))}
key)
- #Nil
+ #End
#None}
def_meta)
@@ -1718,7 +1718,7 @@
def_meta)))
(def:''' (resolve_global_identifier full_name state)
- #Nil
+ #End
(-> Name ($' Meta Name))
(let' [[module name] full_name
{#info info #source source #current_module _ #modules modules
@@ -1743,7 +1743,7 @@
(get module modules))))
(def:''' (as_code_list expression)
- #Nil
+ #End
(-> Code Code)
(let' [type (form$ (list (tag$ ["library/lux" "Apply"])
(identifier$ ["library/lux" "Code"])
@@ -1751,26 +1751,26 @@
(form$ (list (text$ "lux type check") type expression))))
(def:''' (spliced replace? untemplate elems)
- #Nil
+ #End
(-> Bit (-> Code ($' Meta Code)) ($' List Code) ($' Meta Code))
({#1
- ({#Nil
- (return (tag$ ["library/lux" "Nil"]))
+ ({#End
+ (return (tag$ ["library/lux" "End"]))
- (#Cons lastI inits)
+ (#Item lastI inits)
(do meta_monad
- [lastO ({[_ (#Form (#Cons [[_ (#Identifier ["" "~+"])] (#Cons [spliced #Nil])]))]
+ [lastO ({[_ (#Form (#Item [[_ (#Identifier ["" "~+"])] (#Item [spliced #End])]))]
(in (as_code_list spliced))
_
(do meta_monad
[lastO (untemplate lastI)]
- (in (as_code_list (form$ (list (tag$ ["library/lux" "Cons"])
- (tuple$ (list lastO (tag$ ["library/lux" "Nil"]))))))))}
+ (in (as_code_list (form$ (list (tag$ ["library/lux" "Item"])
+ (tuple$ (list lastO (tag$ ["library/lux" "End"]))))))))}
lastI)]
(monad\fold meta_monad
(function' [leftI rightO]
- ({[_ (#Form (#Cons [[_ (#Identifier ["" "~+"])] (#Cons [spliced #Nil])]))]
+ ({[_ (#Form (#Item [[_ (#Identifier ["" "~+"])] (#Item [spliced #End])]))]
(let' [g!in-module (form$ (list (text$ "lux in-module")
(text$ "library/lux")
(identifier$ ["library/lux" "list\compose"])))]
@@ -1779,7 +1779,7 @@
_
(do meta_monad
[leftO (untemplate leftI)]
- (in (form$ (list (tag$ ["library/lux" "Cons"]) (tuple$ (list leftO rightO))))))}
+ (in (form$ (list (tag$ ["library/lux" "Item"]) (tuple$ (list leftO rightO))))))}
leftI))
lastO
inits))}
@@ -1791,12 +1791,12 @@
replace?))
(def:''' (untemplated_text value)
- #Nil
+ #End
(-> Text Code)
(wrap_meta (form$ (list (tag$ ["library/lux" "Text"]) (text$ value)))))
(def:''' (untemplate replace? subst token)
- #Nil
+ #End
(-> Bit Text Code ($' Meta Code))
({[_ [_ (#Bit value)]]
(return (wrap_meta (form$ (list (tag$ ["library/lux" "Bit"]) (bit$ value)))))
@@ -1844,12 +1844,12 @@
[#0 [_ (#Identifier [module name])]]
(return (wrap_meta (form$ (list (tag$ ["library/lux" "Identifier"]) (tuple$ (list (text$ module) (text$ name)))))))
- [#1 [_ (#Form (#Cons [[_ (#Identifier ["" "~"])] (#Cons [unquoted #Nil])]))]]
+ [#1 [_ (#Form (#Item [[_ (#Identifier ["" "~"])] (#Item [unquoted #End])]))]]
(return (form$ (list (text$ "lux type check")
(identifier$ ["library/lux" "Code"])
unquoted)))
- [#1 [_ (#Form (#Cons [[_ (#Identifier ["" "~!"])] (#Cons [dependent #Nil])]))]]
+ [#1 [_ (#Form (#Item [[_ (#Identifier ["" "~!"])] (#Item [dependent #End])]))]]
(do meta_monad
[independent (untemplate replace? subst dependent)]
(in (wrap_meta (form$ (list (tag$ ["library/lux" "Form"])
@@ -1857,7 +1857,7 @@
(untemplated_text subst)
independent)))))))
- [#1 [_ (#Form (#Cons [[_ (#Identifier ["" "~'"])] (#Cons [keep_quoted #Nil])]))]]
+ [#1 [_ (#Form (#Item [[_ (#Identifier ["" "~'"])] (#Item [keep_quoted #End])]))]]
(untemplate #0 subst keep_quoted)
[_ [meta (#Form elems)]]
@@ -1892,10 +1892,10 @@
"## Macro to treat define new primitive types." __paragraph
"(primitive ''java.lang.Object'')" __paragraph
"(primitive ''java.util.List'' [(primitive ''java.lang.Long'')])"))])
- ({(#Cons [_ (#Text class_name)] #Nil)
- (return (list (form$ (list (tag$ ["library/lux" "Primitive"]) (text$ class_name) (tag$ ["library/lux" "Nil"])))))
+ ({(#Item [_ (#Text class_name)] #End)
+ (return (list (form$ (list (tag$ ["library/lux" "Primitive"]) (text$ class_name) (tag$ ["library/lux" "End"])))))
- (#Cons [_ (#Text class_name)] (#Cons [_ (#Tuple params)] #Nil))
+ (#Item [_ (#Text class_name)] (#Item [_ (#Tuple params)] #End))
(return (list (form$ (list (tag$ ["library/lux" "Primitive"]) (text$ class_name) (untemplated_list params)))))
_
@@ -1903,7 +1903,7 @@
tokens))
(def:'' (current_module_name state)
- #Nil
+ #End
($' Meta Text)
({{#info info #source source #current_module current_module #modules modules
#scopes scopes #type_context types #host host
@@ -1923,7 +1923,7 @@
"## Hygienic quasi-quotation as a macro. Unquote (~) and unquote-splice (~+) must also be used as forms." __paragraph
"## All unprefixed macros will receive their parent module's prefix if imported; otherwise will receive the prefix of the module on which the quasi-quote is being used." __paragraph
"(` (def: (~ name) (function ((~' _) (~+ args)) (~ body))))"))])
- ({(#Cons template #Nil)
+ ({(#Item template #End)
(do meta_monad
[current_module current_module_name
=template (untemplate #1 current_module template)]
@@ -1940,7 +1940,7 @@
(text$ ($_ "lux text concat"
"## Unhygienic quasi-quotation as a macro. Unquote (~) and unquote-splice (~+) must also be used as forms." __paragraph
"(`' (def: (~ name) (function (_ (~+ args)) (~ body))))"))])
- ({(#Cons template #Nil)
+ ({(#Item template #End)
(do meta_monad
[=template (untemplate #1 "" template)]
(in (list (form$ (list (text$ "lux type check") (identifier$ ["library/lux" "Code"]) =template)))))
@@ -1954,7 +1954,7 @@
(text$ ($_ "lux text concat"
"## Quotation as a macro." __paragraph
"(' YOLO)"))])
- ({(#Cons template #Nil)
+ ({(#Item template #End)
(do meta_monad
[=template (untemplate #0 "" template)]
(in (list (form$ (list (text$ "lux type check") (identifier$ ["library/lux" "Code"]) =template)))))
@@ -1970,7 +1970,7 @@
"(|> elems (list\map int\encode) (interpose '' '') (fold text\compose ''''))" __paragraph
"## =>" __paragraph
"(fold text\compose '''' (interpose '' '' (list\map int\encode elems)))"))])
- ({(#Cons [init apps])
+ ({(#Item [init apps])
(return (list (list\fold ("lux type check" (-> Code Code Code)
(function' [app acc]
({[_ (#Tuple parts)]
@@ -1996,7 +1996,7 @@
"(<| (fold text\compose '''') (interpose '' '') (list\map int\encode) elems)" __paragraph
"## =>" __paragraph
"(fold text\compose '''' (interpose '' '' (list\map int\encode elems)))"))])
- ({(#Cons [init apps])
+ ({(#Item [init apps])
(return (list (list\fold ("lux type check" (-> Code Code Code)
(function' [app acc]
({[_ (#Tuple parts)]
@@ -2023,7 +2023,7 @@
(function' [x] (f (g x))))
(def:''' (get_name x)
- #Nil
+ #End
(-> Code ($' Maybe Name))
({[_ (#Identifier sname)]
(#Some sname)
@@ -2033,7 +2033,7 @@
x))
(def:''' (get_tag x)
- #Nil
+ #End
(-> Code ($' Maybe Name))
({[_ (#Tag sname)]
(#Some sname)
@@ -2043,7 +2043,7 @@
x))
(def:''' (get_short x)
- #Nil
+ #End
(-> Code ($' Maybe Text))
({[_ (#Identifier "" sname)]
(#Some sname)
@@ -2053,7 +2053,7 @@
x))
(def:''' (tuple_to_list tuple)
- #Nil
+ #End
(-> Code ($' Maybe ($' List Code)))
({[_ (#Tuple members)]
(#Some members)
@@ -2063,7 +2063,7 @@
tuple))
(def:''' (apply_template env template)
- #Nil
+ #End
(-> RepEnv Code Code)
({[_ (#Identifier "" sname)]
({(#Some subst)
@@ -2091,7 +2091,7 @@
template))
(def:''' (every? p xs)
- #Nil
+ #End
(All [a]
(-> (-> a Bit) ($' List a) Bit))
(list\fold (function' [_2 _1] (if _1 (p _2) #0)) #1 xs))
@@ -2132,10 +2132,10 @@
("lux i64 =" reference sample)))
(def:''' (list\join xs)
- #Nil
+ #End
(All [a]
(-> ($' List ($' List a)) ($' List a)))
- (list\fold list\compose #Nil (list\reverse xs)))
+ (list\fold list\compose #End (list\reverse xs)))
(macro:' #export (template tokens)
(list [(tag$ ["library/lux" "doc"])
@@ -2145,7 +2145,7 @@
" " "[(def: #export <name> (-> Int Int) (+ <diff>))]" __paragraph
" " "[inc +1]" ..\n
" " "[dec -1]"))])
- ({(#Cons [[_ (#Tuple bindings)] (#Cons [[_ (#Tuple templates)] data])])
+ ({(#Item [[_ (#Tuple bindings)] (#Item [[_ (#Tuple templates)] data])])
({[(#Some bindings') (#Some data')]
(let' [apply ("lux type check" (-> RepEnv ($' List Code))
(function' [env] (list\map (apply_template env) templates)))
@@ -2202,12 +2202,12 @@
right))
(def:''' (bit\encode x)
- #Nil
+ #End
(-> Bit Text)
(if x "#1" "#0"))
(def:''' (digit::format digit)
- #Nil
+ #End
(-> Nat Text)
({0 "0"
1 "1" 2 "2" 3 "3"
@@ -2217,7 +2217,7 @@
digit))
(def:''' (nat\encode value)
- #Nil
+ #End
(-> Nat Text)
({0
"0"
@@ -2234,14 +2234,14 @@
value))
(def:''' (int\abs value)
- #Nil
+ #End
(-> Int Int)
(if ("lux i64 <" +0 value)
("lux i64 *" -1 value)
value))
(def:''' (int\encode value)
- #Nil
+ #End
(-> Int Text)
(if ("lux i64 =" +0 value)
"+0"
@@ -2259,12 +2259,12 @@
(|> value ("lux i64 %" +10) int\abs ("lux type as" Nat) digit::format)))))
(def:''' (frac\encode x)
- #Nil
+ #End
(-> Frac Text)
("lux f64 encode" x))
(def:''' (multiple? div n)
- #Nil
+ #End
(-> Nat Nat Bit)
(|> n (n/% div) ("lux i64 =" 0)))
@@ -2280,7 +2280,7 @@
(def:''' (macro_type? type)
(list)
(-> Type Bit)
- ({(#Named ["library/lux" "Macro"] (#Primitive "#Macro" #Nil))
+ ({(#Named ["library/lux" "Macro"] (#Primitive "#Macro" #End))
#1
_
@@ -2288,7 +2288,7 @@
type))
(def:''' (macro' modules current_module module name)
- #Nil
+ #End
(-> ($' List (& Text Module))
Text Text Text
($' Maybe Macro))
@@ -2310,7 +2310,7 @@
("lux type check" Global gdef))))
(def:''' (normalize name)
- #Nil
+ #End
(-> Name ($' Meta Name))
({["" name]
(do meta_monad
@@ -2322,7 +2322,7 @@
name))
(def:''' (macro full_name)
- #Nil
+ #End
(-> Name ($' Meta ($' Maybe Macro)))
(do meta_monad
[current_module current_module_name]
@@ -2337,7 +2337,7 @@
state)))))
(def:''' (macro? name)
- #Nil
+ #End
(-> Name ($' Meta Bit))
(do meta_monad
[name (normalize name)
@@ -2347,23 +2347,23 @@
output))))
(def:''' (interpose sep xs)
- #Nil
+ #End
(All [a]
(-> a ($' List a) ($' List a)))
- ({#Nil
+ ({#End
xs
- (#Cons [x #Nil])
+ (#Item [x #End])
xs
- (#Cons [x xs'])
+ (#Item [x xs'])
(list& x sep (interpose sep xs'))}
xs))
(def:''' (macro_expand_once token)
- #Nil
+ #End
(-> Code ($' Meta ($' List Code)))
- ({[_ (#Form (#Cons [_ (#Identifier macro_name)] args))]
+ ({[_ (#Form (#Item [_ (#Identifier macro_name)] args))]
(do meta_monad
[macro_name' (normalize macro_name)
?macro (macro macro_name')]
@@ -2379,9 +2379,9 @@
token))
(def:''' (macro_expand token)
- #Nil
+ #End
(-> Code ($' Meta ($' List Code)))
- ({[_ (#Form (#Cons [_ (#Identifier macro_name)] args))]
+ ({[_ (#Form (#Item [_ (#Identifier macro_name)] args))]
(do meta_monad
[macro_name' (normalize macro_name)
?macro (macro macro_name')]
@@ -2400,9 +2400,9 @@
token))
(def:''' (macro_expand_all syntax)
- #Nil
+ #End
(-> Code ($' Meta ($' List Code)))
- ({[_ (#Form (#Cons [_ (#Identifier macro_name)] args))]
+ ({[_ (#Form (#Item [_ (#Identifier macro_name)] args))]
(do meta_monad
[macro_name' (normalize macro_name)
?macro (macro macro_name')]
@@ -2415,7 +2415,7 @@
#None
(do meta_monad
[args' (monad\map meta_monad macro_expand_all args)]
- (in (list (form$ (#Cons (identifier$ macro_name) (list\join args'))))))}
+ (in (list (form$ (#Item (identifier$ macro_name) (list\join args'))))))}
?macro))
[_ (#Form members)]
@@ -2435,7 +2435,7 @@
(let' [[key val] kv]
(do meta_monad
[val' (macro_expand_all val)]
- ({(#Cons val'' #Nil)
+ ({(#Item val'' #End)
(return [key val''])
_
@@ -2449,24 +2449,24 @@
syntax))
(def:''' (walk_type type)
- #Nil
+ #End
(-> Code Code)
- ({[_ (#Form (#Cons [_ (#Tag tag)] parts))]
- (form$ (#Cons [(tag$ tag) (list\map walk_type parts)]))
+ ({[_ (#Form (#Item [_ (#Tag tag)] parts))]
+ (form$ (#Item [(tag$ tag) (list\map walk_type parts)]))
[_ (#Tuple members)]
(` (& (~+ (list\map walk_type members))))
- [_ (#Form (#Cons [_ (#Text "lux in-module")]
- (#Cons [_ (#Text module)]
- (#Cons type'
- #Nil))))]
+ [_ (#Form (#Item [_ (#Text "lux in-module")]
+ (#Item [_ (#Text module)]
+ (#Item type'
+ #End))))]
(` ("lux in-module" (~ (text$ module)) (~ (walk_type type'))))
- [_ (#Form (#Cons [_ (#Identifier ["" ":~"])] (#Cons expression #Nil)))]
+ [_ (#Form (#Item [_ (#Identifier ["" ":~"])] (#Item expression #End)))]
expression
- [_ (#Form (#Cons type_fn args))]
+ [_ (#Form (#Item type_fn args))]
(list\fold ("lux type check" (-> Code Code Code)
(function' [arg type_fn] (` (#.Apply (~ arg) (~ type_fn)))))
(walk_type type_fn)
@@ -2481,10 +2481,10 @@
(text$ ($_ "lux text concat"
"## Takes a type expression and returns it's representation as data-structure." __paragraph
"(type (All [a] (Maybe (List a))))"))])
- ({(#Cons type #Nil)
+ ({(#Item type #End)
(do meta_monad
[type+ (macro_expand_all type)]
- ({(#Cons type' #Nil)
+ ({(#Item type' #End)
(in (list (walk_type type')))
_
@@ -2500,7 +2500,7 @@
(text$ ($_ "lux text concat"
"## The type-annotation macro." __paragraph
"(: (List Int) (list +1 +2 +3))"))])
- ({(#Cons type (#Cons value #Nil))
+ ({(#Item type (#Item value #End))
(return (list (` ("lux type check" (type (~ type)) (~ value)))))
_
@@ -2512,7 +2512,7 @@
(text$ ($_ "lux text concat"
"## The type-coercion macro." __paragraph
"(:as Dinosaur (list +1 +2 +3))"))])
- ({(#Cons type (#Cons value #Nil))
+ ({(#Item type (#Item value #End))
(return (list (` ("lux type as" (type (~ type)) (~ value)))))
_
@@ -2520,15 +2520,15 @@
tokens))
(def:''' (empty? xs)
- #Nil
+ #End
(All [a] (-> ($' List a) Bit))
- ({#Nil #1
+ ({#End #1
_ #0}
xs))
(template [<name> <type> <value>]
[(def:''' (<name> xy)
- #Nil
+ #End
(All [a b] (-> (& a b) <type>))
(let' [[x y] xy] <value>))]
@@ -2536,9 +2536,9 @@
[second b y])
(def:''' (unfold_type_def type_codes)
- #Nil
+ #End
(-> ($' List Code) ($' Meta (& Code ($' Maybe ($' List Text)))))
- ({(#Cons [_ (#Record pairs)] #Nil)
+ ({(#Item [_ (#Record pairs)] #End)
(do meta_monad
[members (monad\map meta_monad
(: (-> [Code Code] (Meta [Text Code]))
@@ -2553,18 +2553,18 @@
(return [(` (& (~+ (list\map second members))))
(#Some (list\map first members))]))
- (#Cons type #Nil)
+ (#Item type #End)
({[_ (#Tag "" member_name)]
(return [(` .Any) (#Some (list member_name))])
- [_ (#Form (#Cons [_ (#Tag "" member_name)] member_types))]
+ [_ (#Form (#Item [_ (#Tag "" member_name)] member_types))]
(return [(` (& (~+ member_types))) (#Some (list member_name))])
_
(return [type #None])}
type)
- (#Cons case cases)
+ (#Item case cases)
(do meta_monad
[members (monad\map meta_monad
(: (-> Code (Meta [Text Code]))
@@ -2572,10 +2572,10 @@
({[_ (#Tag "" member_name)]
(return [member_name (` .Any)])
- [_ (#Form (#Cons [_ (#Tag "" member_name)] (#Cons member_type #Nil)))]
+ [_ (#Form (#Item [_ (#Tag "" member_name)] (#Item member_type #End)))]
(return [member_name member_type])
- [_ (#Form (#Cons [_ (#Tag "" member_name)] member_types))]
+ [_ (#Form (#Item [_ (#Tag "" member_name)] member_types))]
(return [member_name (` (& (~+ member_types)))])
_
@@ -2590,7 +2590,7 @@
type_codes))
(def:''' (gensym prefix state)
- #Nil
+ #End
(-> Text ($' Meta Code))
({{#info info #source source #current_module _ #modules modules
#scopes scopes #type_context types #host host
@@ -2611,10 +2611,10 @@
"## Parameter-less recursive types." __paragraph
"## A name has to be given to the whole type, to use it within its body." __paragraph
"(Rec Self [Int (List Self)])"))])
- ({(#Cons [_ (#Identifier "" name)] (#Cons body #Nil))
+ ({(#Item [_ (#Identifier "" name)] (#Item body #End))
(let' [body' (replace_syntax (list [name (` (#.Apply (~ (make_parameter 1)) (~ (make_parameter 0))))])
(update_parameters body))]
- (return (list (` (#.Apply .Nothing (#.UnivQ #.Nil (~ body')))))))
+ (return (list (` (#.Apply .Nothing (#.UnivQ #.End (~ body')))))))
_
(failure "Wrong syntax for Rec")}
@@ -2629,7 +2629,7 @@
" " "(log! ''#2'')" ..\n
" " "(log! ''#3'')" ..\n
"''YOLO'')"))])
- ({(#Cons value actions)
+ ({(#Item value actions)
(let' [dummy (local_identifier$ "")]
(return (list (list\fold ("lux type check" (-> Code Code Code)
(function' [pre post] (` ({(~ dummy) (~ post)}
@@ -2642,30 +2642,30 @@
(list\reverse tokens)))
(macro:' (def:' tokens)
- (let' [[export? tokens'] ({(#Cons [_ (#Tag ["" "export"])] tokens')
+ (let' [[export? tokens'] ({(#Item [_ (#Tag ["" "export"])] tokens')
[#1 tokens']
_
[#0 tokens]}
tokens)
parts (: (Maybe [Code (List Code) (Maybe Code) Code])
- ({(#Cons [_ (#Form (#Cons name args))] (#Cons type (#Cons body #Nil)))
+ ({(#Item [_ (#Form (#Item name args))] (#Item type (#Item body #End)))
(#Some name args (#Some type) body)
- (#Cons name (#Cons type (#Cons body #Nil)))
- (#Some name #Nil (#Some type) body)
+ (#Item name (#Item type (#Item body #End)))
+ (#Some name #End (#Some type) body)
- (#Cons [_ (#Form (#Cons name args))] (#Cons body #Nil))
+ (#Item [_ (#Form (#Item name args))] (#Item body #End))
(#Some name args #None body)
- (#Cons name (#Cons body #Nil))
- (#Some name #Nil #None body)
+ (#Item name (#Item body #End))
+ (#Some name #End #None body)
_
#None}
tokens'))]
({(#Some name args ?type body)
- (let' [body' ({#Nil
+ (let' [body' ({#End
body
_
@@ -2680,7 +2680,7 @@
(return (list (` ("lux def" (~ name)
(~ body'')
[(~ location_code)
- (#.Record #.Nil)]
+ (#.Record #.End)]
(~ (bit$ export?)))))))
#None
@@ -2751,8 +2751,8 @@
(def:' (expander branches)
(-> (List Code) (Meta (List Code)))
- ({(#Cons [_ (#Form (#Cons [_ (#Identifier macro_name)] macro_args))]
- (#Cons body
+ ({(#Item [_ (#Form (#Item [_ (#Identifier macro_name)] macro_args))]
+ (#Item body
branches'))
(do meta_monad
[??? (macro? macro_name)]
@@ -2766,12 +2766,12 @@
body
sub_expansion)))))
- (#Cons pattern (#Cons body branches'))
+ (#Item pattern (#Item body branches'))
(do meta_monad
[sub_expansion (expander branches')]
(in (list& pattern body sub_expansion)))
- #Nil
+ #End
(do meta_monad [] (in (list)))
_
@@ -2788,11 +2788,11 @@
"## The pattern-matching macro." ..\n
"## Allows the usage of macros within the patterns to provide custom syntax." ..\n
"(case (: (List Int) (list +1 +2 +3))" ..\n
- " " "(#Cons x (#Cons y (#Cons z #Nil)))" ..\n
+ " " "(#Item x (#Item y (#Item z #End)))" ..\n
" " "(#Some ($_ * x y z))" __paragraph
" " "_" ..\n
" " "#None)"))])
- ({(#Cons value branches)
+ ({(#Item value branches)
(do meta_monad
[expansion (expander branches)]
(in (list (` ((~ (record$ (as_pairs expansion))) (~ value))))))
@@ -2813,11 +2813,11 @@
" _" ..\n
" #None)"))])
(case tokens
- (#Cons [_ (#Form (#Cons pattern #Nil))] (#Cons body branches))
+ (#Item [_ (#Form (#Item pattern #End))] (#Item body branches))
(do meta_monad
[pattern+ (macro_expand_all pattern)]
(case pattern+
- (#Cons pattern' #Nil)
+ (#Item pattern' #End)
(in (list& pattern' body branches))
_
@@ -2844,7 +2844,7 @@
(case tokens
(^ (list& [_ (#Form patterns)] body branches))
(case patterns
- #Nil
+ #End
(failure "^or cannot have 0 patterns")
_
@@ -2899,7 +2899,7 @@
" (function (_ x y) x))"
__paragraph
"(: (All [a b] (-> a b a))" ..\n
- " (function (const x y) x))"))])
+ " (function (constant x y) x))"))])
(case (: (Maybe [Text Code (List Code) Code])
(case tokens
(^ (list [_ (#Form (list& [_ (#Identifier ["" name])] head tail))] body))
@@ -2976,11 +2976,11 @@
(def:' (with_func_args args meta)
(-> (List Code) Code Code)
(case args
- #Nil
+ #End
meta
_
- (` (#.Cons [[(~ location_code) (#.Tag ["library/lux" "func-args"])]
+ (` (#.Item [[(~ location_code) (#.Tag ["library/lux" "func-args"])]
[(~ location_code) (#.Tuple (.list (~+ (list\map (function (_ arg)
(` [(~ location_code) (#.Text (~ (text$ (code\encode arg))))]))
args))))]]
@@ -2994,7 +2994,7 @@
(def:' (export^ tokens)
(-> (List Code) [Bit (List Code)])
(case tokens
- (#Cons [_ (#Tag [_ "export"])] tokens')
+ (#Item [_ (#Tag [_ "export"])] tokens')
[#1 tokens']
_
@@ -3021,36 +3021,36 @@
(let [[exported? tokens'] (export^ tokens)
parts (: (Maybe [Code (List Code) (Maybe Code) Code (List [Code Code])])
(case tokens'
- (^ (list [_ (#Form (#Cons name args))] [_ (#Record meta_kvs)] type body))
+ (^ (list [_ (#Form (#Item name args))] [_ (#Record meta_kvs)] type body))
(#Some [name args (#Some type) body meta_kvs])
(^ (list name [_ (#Record meta_kvs)] type body))
- (#Some [name #Nil (#Some type) body meta_kvs])
+ (#Some [name #End (#Some type) body meta_kvs])
- (^ (list [_ (#Form (#Cons name args))] [_ (#Record meta_kvs)] body))
+ (^ (list [_ (#Form (#Item name args))] [_ (#Record meta_kvs)] body))
(#Some [name args #None body meta_kvs])
(^ (list name [_ (#Record meta_kvs)] body))
- (#Some [name #Nil #None body meta_kvs])
+ (#Some [name #End #None body meta_kvs])
- (^ (list [_ (#Form (#Cons name args))] type body))
- (#Some [name args (#Some type) body #Nil])
+ (^ (list [_ (#Form (#Item name args))] type body))
+ (#Some [name args (#Some type) body #End])
(^ (list name type body))
- (#Some [name #Nil (#Some type) body #Nil])
+ (#Some [name #End (#Some type) body #End])
- (^ (list [_ (#Form (#Cons name args))] body))
- (#Some [name args #None body #Nil])
+ (^ (list [_ (#Form (#Item name args))] body))
+ (#Some [name args #None body #End])
(^ (list name body))
- (#Some [name #Nil #None body #Nil])
+ (#Some [name #End #None body #End])
_
#None))]
(case parts
(#Some name args ?type body meta)
(let [body (case args
- #Nil
+ #End
body
_
@@ -3075,7 +3075,7 @@
(-> [Code Code] Code Code)
(case [addition meta]
[[name value] [location (#Record pairs)]]
- [location (#Record (#Cons [name value] pairs))]
+ [location (#Record (#Item [name value] pairs))]
_
meta))
@@ -3109,13 +3109,13 @@
(#Some [name args (list) body])
(^ (list [_ (#Identifier name)] body))
- (#Some [name #Nil (list) body])
+ (#Some [name #End (list) body])
(^ (list [_ (#Form (list& [_ (#Identifier name)] args))] [_ (#Record meta_rec_parts)] body))
(#Some [name args meta_rec_parts body])
(^ (list [_ (#Identifier name)] [_ (#Record meta_rec_parts)] body))
- (#Some [name #Nil meta_rec_parts body])
+ (#Some [name #End meta_rec_parts body])
_
#None))]
@@ -3123,7 +3123,7 @@
(#Some [name args meta body])
(let [name (identifier$ name)
body (case args
- #Nil
+ #End
body
_
@@ -3160,13 +3160,13 @@
(#Some name args [meta_rec_location (#Record meta_rec_parts)] sigs)
(^ (list& [_ (#Identifier name)] [meta_rec_location (#Record meta_rec_parts)] sigs))
- (#Some name #Nil [meta_rec_location (#Record meta_rec_parts)] sigs)
+ (#Some name #End [meta_rec_location (#Record meta_rec_parts)] sigs)
(^ (list& [_ (#Form (list& [_ (#Identifier name)] args))] sigs))
(#Some name args (` {}) sigs)
(^ (list& [_ (#Identifier name)] sigs))
- (#Some name #Nil (` {}) sigs)
+ (#Some name #End (` {}) sigs)
_
#None))]
@@ -3195,7 +3195,7 @@
sig_meta (meta_code_merge (` {#.sig? #1})
meta)
usage (case args
- #Nil
+ #End
def_name
_
@@ -3209,10 +3209,10 @@
(All [a b]
(-> (-> a (Maybe b)) (List a) (Maybe b)))
(case xs
- #Nil
+ #End
#None
- (#Cons x xs')
+ (#Item x xs')
(case (f x)
#None
(find f xs')
@@ -3288,10 +3288,10 @@
(All [a]
(-> Nat (List a) (Maybe a)))
(case xs
- #Nil
+ #End
#None
- (#Cons x xs')
+ (#Item x xs')
(if ("lux i64 =" 0 idx)
(#Some x)
(nth ("lux i64 -" 1 idx) xs'))))
@@ -3311,7 +3311,7 @@
(#UnivQ ?local_env ?local_def)
(case ?local_env
- #Nil
+ #End
(#UnivQ env ?local_def)
_
@@ -3319,7 +3319,7 @@
(#ExQ ?local_env ?local_def)
(case ?local_env
- #Nil
+ #End
(#ExQ env ?local_def)
_
@@ -3383,7 +3383,7 @@
(case type
(#Apply head func')
(let [[func tail] (flat_app func')]
- [func (#Cons head tail)])
+ [func (#Item head tail)])
_
[type (list)]))
@@ -3527,10 +3527,10 @@
(def: (text\join_with separator parts)
(-> Text (List Text) Text)
(case parts
- #Nil
+ #End
""
- (#Cons head tail)
+ (#Item head tail)
(list\fold (function (_ right left)
($_ text\compose left separator right))
head
@@ -3558,20 +3558,20 @@
(#Some name args type [meta_rec_location (#Record meta_rec_parts)] definitions)
(^ (list& name [meta_rec_location (#Record meta_rec_parts)] type definitions))
- (#Some name #Nil type [meta_rec_location (#Record meta_rec_parts)] definitions)
+ (#Some name #End type [meta_rec_location (#Record meta_rec_parts)] definitions)
(^ (list& [_ (#Form (list& name args))] type definitions))
(#Some name args type (` {}) definitions)
(^ (list& name type definitions))
- (#Some name #Nil type (` {}) definitions)
+ (#Some name #End type (` {}) definitions)
_
#None))]
(case ?parts
(#Some [name args type meta definitions])
(let [usage (case args
- #Nil
+ #End
name
_
@@ -3590,10 +3590,10 @@
(macro: #export (type: tokens)
{#.doc (text$ ($_ "lux text concat"
"## The type-definition macro." ..\n
- "(type: (List a) #Nil (#Cons a (List a)))"))}
+ "(type: (List a) #End (#Item a (List a)))"))}
(let [[exported? tokens'] (export^ tokens)
[rec? tokens'] (case tokens'
- (#Cons [_ (#Tag [_ "rec"])] tokens')
+ (#Item [_ (#Tag [_ "rec"])] tokens')
[#1 tokens']
_
@@ -3601,21 +3601,21 @@
parts (: (Maybe [Text (List Code) (List [Code Code]) (List Code)])
(case tokens'
(^ (list [_ (#Identifier "" name)] [meta_location (#Record meta_parts)] [type_location (#Record type_parts)]))
- (#Some [name #Nil meta_parts (list [type_location (#Record type_parts)])])
+ (#Some [name #End meta_parts (list [type_location (#Record type_parts)])])
(^ (list& [_ (#Identifier "" name)] [meta_location (#Record meta_parts)] type_code1 type_codes))
- (#Some [name #Nil meta_parts (#Cons type_code1 type_codes)])
+ (#Some [name #End meta_parts (#Item type_code1 type_codes)])
(^ (list& [_ (#Identifier "" name)] type_codes))
- (#Some [name #Nil (list) type_codes])
+ (#Some [name #End (list) type_codes])
- (^ (list [_ (#Form (#Cons [_ (#Identifier "" name)] args))] [meta_location (#Record meta_parts)] [type_location (#Record type_parts)]))
+ (^ (list [_ (#Form (#Item [_ (#Identifier "" name)] args))] [meta_location (#Record meta_parts)] [type_location (#Record type_parts)]))
(#Some [name args meta_parts (list [type_location (#Record type_parts)])])
- (^ (list& [_ (#Form (#Cons [_ (#Identifier "" name)] args))] [meta_location (#Record meta_parts)] type_code1 type_codes))
- (#Some [name args meta_parts (#Cons type_code1 type_codes)])
+ (^ (list& [_ (#Form (#Item [_ (#Identifier "" name)] args))] [meta_location (#Record meta_parts)] type_code1 type_codes))
+ (#Some [name args meta_parts (#Item type_code1 type_codes)])
- (^ (list& [_ (#Form (#Cons [_ (#Identifier "" name)] args))] type_codes))
+ (^ (list& [_ (#Form (#Item [_ (#Identifier "" name)] args))] type_codes))
(#Some [name args (list) type_codes])
_
@@ -3637,14 +3637,14 @@
.Nothing))))
#None)
(case args
- #Nil
+ #End
(#Some type)
_
(#Some (` (.All (~ type_name) [(~+ args)] (~ type)))))))
total_meta (let [meta (process_def_meta meta)
meta (if rec?
- (` (#.Cons (~ (flag_meta "type-rec?")) (~ meta)))
+ (` (#.Item (~ (flag_meta "type-rec?")) (~ meta)))
meta)]
(` [(~ location_code)
(#.Record (~ meta))]))]
@@ -3747,8 +3747,8 @@
(def: (openings_parser parts)
(-> (List Code) (Meta [(List Openings) (List Code)]))
(case parts
- #.Nil
- (return [#.Nil #.Nil])
+ #.End
+ (return [#.End #.End])
(^ (list& [_ (#Form (list& [_ (#Text prefix)] structs))] parts'))
(do meta_monad
@@ -3763,11 +3763,11 @@
structs)
next+remainder (openings_parser parts')]
(let [[next remainder] next+remainder]
- (return [(#.Cons [prefix structs'] next)
+ (return [(#.Item [prefix structs'] next)
remainder])))
_
- (return [#.Nil parts])))
+ (return [#.End parts])))
(def: (text\split! at x)
(-> Nat Text [Text Text])
@@ -3845,19 +3845,19 @@
(def: (list\take amount list)
(All [a] (-> Nat (List a) (List a)))
(case [amount list]
- (^or [0 _] [_ #Nil])
- #Nil
+ (^or [0 _] [_ #End])
+ #End
- [_ (#Cons head tail)]
- (#Cons head (list\take ("lux i64 -" 1 amount) tail))))
+ [_ (#Item head tail)]
+ (#Item head (list\take ("lux i64 -" 1 amount) tail))))
(def: (list\drop amount list)
(All [a] (-> Nat (List a) (List a)))
(case [amount list]
- (^or [0 _] [_ #Nil])
+ (^or [0 _] [_ #End])
list
- [_ (#Cons _ tail)]
+ [_ (#Item _ tail)]
(list\drop ("lux i64 -" 1 amount) tail)))
(def: (clean_module nested? relative_root module)
@@ -3934,7 +3934,7 @@
#let [[openings extra] openings+extra]
sub_imports (imports_parser #1 import_name context_alias extra)]
(in (case [referral openings]
- [#Nothing #Nil]
+ [#Nothing #End]
sub_imports
_
@@ -3959,7 +3959,7 @@
de_aliased (de_alias context_alias m_name alias)]
sub_imports (imports_parser #1 import_name de_aliased extra)]
(in (case [referral openings]
- [#Ignore #Nil]
+ [#Ignore #End]
sub_imports
_
@@ -4023,12 +4023,12 @@
(def: (only p xs)
(All [a] (-> (-> a Bit) (List a) (List a)))
(case xs
- #Nil
+ #End
(list)
- (#Cons x xs')
+ (#Item x xs')
(if (p x)
- (#Cons x (only p xs'))
+ (#Item x (only p xs'))
(only p xs'))))
(def: (is_member? cases name)
@@ -4121,10 +4121,10 @@
(def: (type_variable idx bindings)
(-> Nat (List [Nat (Maybe Type)]) (Maybe Type))
(case bindings
- #Nil
- #Nil
+ #End
+ #End
- (#Cons [var bound] bindings')
+ (#Item [var bound] bindings')
(if ("lux i64 =" idx var)
bound
(type_variable idx bindings'))))
@@ -4174,9 +4174,9 @@
(def: (zipped/2 xs ys)
(All [a b] (-> (List a) (List b) (List [a b])))
(case xs
- (#Cons x xs')
+ (#Item x xs')
(case ys
- (#Cons y ys')
+ (#Item y ys')
(list& [x y] (zipped/2 xs' ys'))
_
@@ -4190,7 +4190,7 @@
(case type
(#Primitive name params)
(case params
- #Nil
+ #End
name
_
@@ -4307,11 +4307,11 @@
(def: (enumeration' idx xs)
(All [a] (-> Nat (List a) (List [Nat a])))
(case xs
- (#Cons x xs')
- (#Cons [idx x] (enumeration' ("lux i64 +" 1 idx) xs'))
+ (#Item x xs')
+ (#Item [idx x] (enumeration' ("lux i64 +" 1 idx) xs'))
- #Nil
- #Nil))
+ #End
+ #End))
(def: (enumeration xs)
(All [a] (-> (List a) (List [Nat a])))
@@ -4393,7 +4393,7 @@
_
(return (list (` ("lux def" (~ (local_identifier$ (de_alias "" short alias)))
(~ source+)
- [(~ location_code) (#.Record #Nil)]
+ [(~ location_code) (#.Record #End)]
#0)))))))
(macro: #export (open: tokens)
@@ -4432,7 +4432,7 @@
(do meta_monad
[g!struct (gensym "struct")]
(return (list (` ("lux def" (~ g!struct) (~ struct)
- [(~ location_code) (#.Record #Nil)]
+ [(~ location_code) (#.Record #End)]
#0))
(` (..open: (~ (text$ alias)) (~ g!struct)))))))
@@ -4477,7 +4477,7 @@
#let [[openings options] openings+options]
current_module current_module_name]
(case options
- #Nil
+ #End
(in {#refer_defs referral
#refer_open openings})
@@ -4613,7 +4613,7 @@
=module (` ("lux def module" [(~ location_code)
(#.Record (~ (process_def_meta _meta)))]
(~ =imports)))]]
- (in (#Cons =module =refers))))
+ (in (#Item =module =refers))))
(macro: #export (\ tokens)
{#.doc (text$ ($_ "lux text concat"
@@ -4678,7 +4678,7 @@
(^ (list [_ (#Tuple slots)] value record))
(case slots
- #Nil
+ #End
(failure "Wrong syntax for set@")
_
@@ -4696,8 +4696,8 @@
[_ accesses'] (list\fold (: (-> [Code Code] [Code (List (List Code))] [Code (List (List Code))])
(function (_ [new_slot new_binding] [old_record accesses'])
[(` (get@ (~ new_slot) (~ new_binding)))
- (#Cons (list new_binding old_record) accesses')]))
- [record (: (List (List Code)) #Nil)]
+ (#Item (list new_binding old_record) accesses')]))
+ [record (: (List (List Code)) #End)]
pairs)
accesses (list\join (list\reverse accesses'))]]
(in (list (` (let [(~+ accesses)]
@@ -4767,7 +4767,7 @@
(^ (list [_ (#Tuple slots)] fun record))
(case slots
- #Nil
+ #End
(failure "Wrong syntax for update@")
_
@@ -4818,7 +4818,7 @@
" (^template [<tag>]" ..\n
" [(<tag> old_env def)" ..\n
" (case old_env" ..\n
- " #.Nil" ..\n
+ " #.End" ..\n
" (<tag> env def)"
__paragraph
" _" ..\n
@@ -4916,8 +4916,8 @@
(def: (repeat n x)
(All [a] (-> Int a (List a)))
(if ("lux i64 <" n +0)
- (#Cons x (repeat ("lux i64 +" -1 n) x))
- #Nil))
+ (#Item x (repeat ("lux i64 +" -1 n) x))
+ #End))
(def: (location_padding baseline [_ old_line old_column] [_ new_line new_column])
(-> Nat Location Location Text)
@@ -5020,15 +5020,15 @@
(def: (interleave xs ys)
(All [a] (-> (List a) (List a) (List a)))
(case xs
- #Nil
- #Nil
+ #End
+ #End
- (#Cons x xs')
+ (#Item x xs')
(case ys
- #Nil
- #Nil
+ #End
+ #End
- (#Cons y ys')
+ (#Item y ys')
(list& x y (interleave xs' ys')))))
(def: (type_to_code type)
@@ -5233,7 +5233,7 @@
_
(failure "[with_expansions] Improper macro expansion.")))
- #Nil
+ #End
(return bodies)
_
@@ -5341,10 +5341,10 @@
(def: (multi_level_case^ levels)
(-> (List Code) (Meta Multi_Level_Case))
(case levels
- #Nil
+ #End
(failure "Multi-level patterns cannot be empty.")
- (#Cons init extras)
+ (#Item init extras)
(do meta_monad
[extras' (monad\map meta_monad case_level^ extras)]
(in [init extras']))))
@@ -5545,7 +5545,7 @@
(-> Int Int)
(undefined)))}
(case tokens
- #Nil
+ #End
(do meta_monad
[location ..location
#let [[module line column] location
@@ -5710,8 +5710,8 @@
type+value (..definition_value identifier)
#let [[type value] type+value]]
(case (..flat_alias type)
- (^or (#Primitive "#Text" #Nil)
- (#Named ["library/lux" "Text"] (#Primitive "#Text" #Nil)))
+ (^or (#Primitive "#Text" #End)
+ (#Named ["library/lux" "Text"] (#Primitive "#Text" #End)))
(in (:as ..Text value))
_
@@ -5727,7 +5727,7 @@
(def: (target_pick target options default)
(-> Text (List [Code Code]) (Maybe Code) (Meta (List Code)))
(case options
- #Nil
+ #End
(case default
#.None
(failure ($_ text\compose "No code for target platform: " target))
@@ -5735,7 +5735,7 @@
(#.Some default)
(return (list default)))
- (#Cons [key pick] options')
+ (#Item [key pick] options')
(do meta_monad
[platform (..resolve_target key)]
(if (text\= target platform)
@@ -5819,11 +5819,11 @@
(def: (untemplated_list& last inits)
(-> Code (List Code) Code)
(case inits
- #Nil
+ #End
last
- (#Cons [init inits'])
- (` (#.Cons (~ init) (~ (untemplated_list& last inits'))))))
+ (#Item [init inits'])
+ (` (#.Item (~ init) (~ (untemplated_list& last inits'))))))
(def: (untemplated_record g!meta untemplated_pattern fields)
(-> Code (-> Code (Meta Code))
@@ -5843,7 +5843,7 @@
(-> Code (-> Code (Meta Code))
(-> (List Code) (Meta Code)))
(case (list\reverse elems)
- (#Cons [_ (#Form (#Cons [[_ (#Identifier ["" "~+"])] (#Cons [spliced #Nil])]))]
+ (#Item [_ (#Form (#Item [[_ (#Identifier ["" "~+"])] (#Item [spliced #End])]))]
inits)
(do meta_monad
[=inits (monad\map meta_monad untemplated_pattern (list\reverse inits))]
@@ -5875,10 +5875,10 @@
[#.Tag name$]
[#.Identifier name$])
- [_ (#Form (#Cons [[_ (#Identifier ["" "~"])] (#Cons [unquoted #Nil])]))]
+ [_ (#Form (#Item [[_ (#Identifier ["" "~"])] (#Item [unquoted #End])]))]
(return unquoted)
- [_ (#Form (#Cons [[_ (#Identifier ["" "~+"])] (#Cons [spliced #Nil])]))]
+ [_ (#Form (#Item [[_ (#Identifier ["" "~+"])] (#Item [spliced #End])]))]
(failure "Cannot use (~+) inside of ^code unless it is the last element in a form or a tuple.")
(^template [<tag> <untemplate>]