aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux.lux56
1 files changed, 28 insertions, 28 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux
index fd8948164..31e7fe01c 100644
--- a/stdlib/source/lux.lux
+++ b/stdlib/source/lux.lux
@@ -169,7 +169,7 @@
#Nil))))))])
## (type: #rec Type
-## (#Host Text (List Type))
+## (#Primitive Text (List Type))
## #Void
## #Unit
## (#Sum Type Type)
@@ -193,7 +193,7 @@
Type-Pair
(+11 Void
(+9 #Nil
- (+3 ## "lux;Host"
+ (+3 ## "lux;Primitive"
(+4 Text Type-List)
(+3 ## "lux;Void"
(+2)
@@ -225,7 +225,7 @@
(#Cons [[dummy-cursor (+7 ["lux" "export?"])]
[dummy-cursor (+0 true)]]
(#Cons [[dummy-cursor (+7 ["lux" "tags"])]
- [dummy-cursor (+9 (#Cons [dummy-cursor (+5 "Host")]
+ [dummy-cursor (+9 (#Cons [dummy-cursor (+5 "Primitive")]
(#Cons [dummy-cursor (+5 "Void")]
(#Cons [dummy-cursor (+5 "Unit")]
(#Cons [dummy-cursor (+5 "Sum")]
@@ -1944,21 +1944,21 @@
(wrap (wrap-meta (form$ (list (tag$ ["lux" "Record"]) (untemplate-list =fields))))))
))
-(macro:' #export (host tokens)
+(macro:' #export (primitive tokens)
(list [(tag$ ["lux" "doc"])
- (text$ "## Macro to treat host-types as Lux-types.
- (host java.lang.Object)
+ (text$ "## Macro to treat define new primitive types.
+ (primitive java.lang.Object)
- (host java.util.List [java.lang.Long])")])
+ (primitive java.util.List [java.lang.Long])")])
(_lux_case tokens
(#Cons [_ (#Symbol "" class-name)] #Nil)
- (return (list (form$ (list (tag$ ["lux" "Host"]) (text$ class-name) (tag$ ["lux" "Nil"])))))
+ (return (list (form$ (list (tag$ ["lux" "Primitive"]) (text$ class-name) (tag$ ["lux" "Nil"])))))
(#Cons [_ (#Symbol "" class-name)] (#Cons [_ (#Tuple params)] #Nil))
- (return (list (form$ (list (tag$ ["lux" "Host"]) (text$ class-name) (untemplate-list params)))))
+ (return (list (form$ (list (tag$ ["lux" "Primitive"]) (text$ class-name) (untemplate-list params)))))
_
- (fail "Wrong syntax for host")))
+ (fail "Wrong syntax for primitive")))
(def:'' (current-module-name state)
#Nil
@@ -2435,7 +2435,7 @@
(function' [state]
(_lux_case state
{#info info #source source #modules modules
- #scopes scopes #type-context types #host host
+ #scopes scopes #type-context types #host host
#seed seed #expected expected
#cursor cursor
#scope-type-vars scope-type-vars}
@@ -4292,16 +4292,16 @@
_
(list)))
-(def: (Type/show type)
+(def: (type/show type)
(-> Type Text)
(case type
- (#Host name params)
+ (#Primitive name params)
(case params
#;Nil
name
_
- ($_ text/compose "(" name " " (|> params (map Type/show) (interpose " ") reverse (fold text/compose "")) ")"))
+ ($_ text/compose "(" name " " (|> params (map type/show) (interpose " ") reverse (fold text/compose "")) ")"))
#Void
"Void"
@@ -4310,13 +4310,13 @@
"Unit"
(#Sum _)
- ($_ text/compose "(| " (|> (flatten-variant type) (map Type/show) (interpose " ") reverse (fold text/compose "")) ")")
+ ($_ text/compose "(| " (|> (flatten-variant type) (map type/show) (interpose " ") reverse (fold text/compose "")) ")")
(#Product _)
- ($_ text/compose "[" (|> (flatten-tuple type) (map Type/show) (interpose " ") reverse (fold text/compose "")) "]")
+ ($_ text/compose "[" (|> (flatten-tuple type) (map type/show) (interpose " ") reverse (fold text/compose "")) "]")
(#Function _)
- ($_ text/compose "(-> " (|> (flatten-lambda type) (map Type/show) (interpose " ") reverse (fold text/compose "")) ")")
+ ($_ text/compose "(-> " (|> (flatten-lambda type) (map type/show) (interpose " ") reverse (fold text/compose "")) ")")
(#Bound id)
(nat/encode id)
@@ -4328,16 +4328,16 @@
($_ text/compose "⟨e:" (nat/encode id) "⟩")
(#UnivQ env body)
- ($_ text/compose "(All " (Type/show body) ")")
+ ($_ text/compose "(All " (type/show body) ")")
(#ExQ env body)
- ($_ text/compose "(Ex " (Type/show body) ")")
+ ($_ text/compose "(Ex " (type/show body) ")")
(#Apply _)
(let [[func args] (flatten-app type)]
($_ text/compose
- "(" (Type/show func) " "
- (|> args (map Type/show) (interpose " ") reverse (fold text/compose ""))
+ "(" (type/show func) " "
+ (|> args (map type/show) (interpose " ") reverse (fold text/compose ""))
")"))
(#Named [prefix name] _)
@@ -4366,7 +4366,7 @@
struct-evidence (resolve-type-tags init-type)]
(case struct-evidence
#;None
- (fail (text/compose "Can only \"open\" structs: " (Type/show init-type)))
+ (fail (text/compose "Can only \"open\" structs: " (type/show init-type)))
(#;Some tags&members)
(do Monad<Meta>
@@ -4545,7 +4545,7 @@
(return (list/join decls')))
_
- (fail (text/compose "Can only \"open\" structs: " (Type/show struct-type)))))
+ (fail (text/compose "Can only \"open\" structs: " (type/show struct-type)))))
_
(fail "Wrong syntax for open")))
@@ -4921,8 +4921,8 @@
(def: (beta-reduce env type)
(-> (List Type) Type Type)
(case type
- (#;Host name params)
- (#;Host name (list/map (beta-reduce env) params))
+ (#;Primitive name params)
+ (#;Primitive name (list/map (beta-reduce env) params))
(^template [<tag>]
(<tag> left right)
@@ -5191,8 +5191,8 @@
(def: (type-to-code type)
(-> Type Code)
(case type
- (#Host name params)
- (` (#Host (~ (text$ name)) (~ (untemplate-list (map type-to-code params)))))
+ (#Primitive name params)
+ (` (#Primitive (~ (text$ name)) (~ (untemplate-list (map type-to-code params)))))
#Void
(` #Void)
@@ -5866,7 +5866,7 @@
(type: #export (Array a)
{#;doc "Mutable arrays."}
- (#;Host "#Array" (#;Cons a #;Nil)))
+ (#;Primitive "#Array" (#;Cons a #;Nil)))
(def: target
(Meta Text)