aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/language
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/language')
-rw-r--r--stdlib/source/lux/language/compiler/analysis.lux4
-rw-r--r--stdlib/source/lux/language/compiler/analysis/case/coverage.lux24
-rw-r--r--stdlib/source/lux/language/compiler/analysis/module.lux10
-rw-r--r--stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux12
-rw-r--r--stdlib/source/lux/language/compiler/meta/cache.lux6
-rw-r--r--stdlib/source/lux/language/compiler/synthesis.lux8
-rw-r--r--stdlib/source/lux/language/compiler/synthesis/case.lux8
-rw-r--r--stdlib/source/lux/language/compiler/synthesis/expression.lux2
-rw-r--r--stdlib/source/lux/language/compiler/synthesis/function.lux4
-rw-r--r--stdlib/source/lux/language/compiler/synthesis/loop.lux8
-rw-r--r--stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux12
-rw-r--r--stdlib/source/lux/language/host/scheme.lux4
-rw-r--r--stdlib/source/lux/language/reference.lux6
-rw-r--r--stdlib/source/lux/language/syntax.lux14
-rw-r--r--stdlib/source/lux/language/type.lux12
-rw-r--r--stdlib/source/lux/language/type/check.lux26
16 files changed, 80 insertions, 80 deletions
diff --git a/stdlib/source/lux/language/compiler/analysis.lux b/stdlib/source/lux/language/compiler/analysis.lux
index e9eb3b921..a2686d6bf 100644
--- a/stdlib/source/lux/language/compiler/analysis.lux
+++ b/stdlib/source/lux/language/compiler/analysis.lux
@@ -183,12 +183,12 @@
_
(#.Some {#lefts lefts
- #right? false
+ #right? #0
#value valueA}))
(<tag> (#Sum (#.Right valueA)))
(#.Some {#lefts lefts
- #right? true
+ #right? #1
#value valueA})
_
diff --git a/stdlib/source/lux/language/compiler/analysis/case/coverage.lux b/stdlib/source/lux/language/compiler/analysis/case/coverage.lux
index b718c382d..c19003df6 100644
--- a/stdlib/source/lux/language/compiler/analysis/case/coverage.lux
+++ b/stdlib/source/lux/language/compiler/analysis/case/coverage.lux
@@ -32,12 +32,12 @@
_
{#///.lefts lefts
- #///.right? false
+ #///.right? #0
#///.value valueP})
(#.Right valueP)
{#///.lefts lefts
- #///.right? true
+ #///.right? #1
#///.value valueP})))
## The coverage of a pattern-matching expression summarizes how well
@@ -64,10 +64,10 @@
(-> Coverage Bit)
(case coverage
(#Exhaustive _)
- true
+ #1
_
- false))
+ #0))
(def: #export (determine pattern)
(-> Pattern (Operation Coverage))
@@ -87,8 +87,8 @@
[#///.Frac]
[#///.Text])
- ## Bits are the exception, since there is only "true" and
- ## "false", which means it is possible for bit
+ ## Bits are the exception, since there is only "#1" and
+ ## "#0", which means it is possible for bit
## pattern-matching to become exhaustive if complementary parts meet.
(#///.Simple (#///.Bit value))
(operation/wrap (#Bit value))
@@ -149,7 +149,7 @@
(def: (= reference sample)
(case [reference sample]
[#Exhaustive #Exhaustive]
- true
+ #1
[(#Bit sideR) (#Bit sideS)]
(bit/= sideR sideS)
@@ -172,7 +172,7 @@
(list.zip2 flatR flatS))))
_
- false)))
+ #0)))
(open: "C/" Equivalence<Coverage>)
@@ -228,15 +228,15 @@
[(#Seq leftA rightA) (#Seq leftSF rightSF)]
(case [(C/= leftSF leftA) (C/= rightSF rightA)]
## There is nothing the addition adds to the coverage.
- [true true]
+ [#1 #1]
redundant-pattern
## The 2 sequences cannot possibly be merged.
- [false false]
+ [#0 #0]
(error/wrap (#Alt so-far addition))
## Same prefix
- [true false]
+ [#1 #0]
(do e.Monad<Error>
[rightM (merge rightA rightSF)]
(if (exhaustive? rightM)
@@ -247,7 +247,7 @@
(wrap (#Seq leftSF rightM))))
## Same suffix
- [false true]
+ [#0 #1]
(do e.Monad<Error>
[leftM (merge leftA leftSF)]
(wrap (#Seq leftM rightA))))
diff --git a/stdlib/source/lux/language/compiler/analysis/module.lux b/stdlib/source/lux/language/compiler/analysis/module.lux
index bdc4abf05..1ac2b4ac4 100644
--- a/stdlib/source/lux/language/compiler/analysis/module.lux
+++ b/stdlib/source/lux/language/compiler/analysis/module.lux
@@ -108,7 +108,7 @@
(|> state
(get@ #.modules)
(plist.get module)
- (case> (#.Some _) true #.None false)
+ (case> (#.Some _) #1 #.None #0)
[state] #e.Success))))
(def: #export (define name definition)
@@ -159,8 +159,8 @@
(case (|> state (get@ #.modules) (plist.get module-name))
(#.Some module)
(let [active? (case (get@ #.module-state module)
- #.Active true
- _ false)]
+ #.Active #1
+ _ #0)]
(if active?
(#e.Success [(update@ #.modules
(plist.put module-name (set@ #.module-state <tag> module))
@@ -180,8 +180,8 @@
(#.Some module)
(#e.Success [state
(case (get@ #.module-state module)
- <tag> true
- _ false)])
+ <tag> #1
+ _ #0)])
#.None
((///.throw unknown-module module-name) state)))))]
diff --git a/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux b/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux
index 876448b5b..da4d4461b 100644
--- a/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux
+++ b/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux
@@ -681,7 +681,7 @@
[<object> <primitive>])
(do @
[_ (typeA.infer (#.Primitive to-name (list)))]
- (wrap true)))
+ (wrap #1)))
(["boolean" "java.lang.Boolean"]
["byte" "java.lang.Byte"]
["short" "java.lang.Short"]
@@ -702,7 +702,7 @@
(if (text/= to-name current-name)
(do @
[_ (typeA.infer toT)]
- (wrap true))
+ (wrap #1))
(do @
[current-class (load-class current-name)
_ (////.assert cannot-cast (format "From class/primitive: " current-name "\n"
@@ -940,19 +940,19 @@
(Modifier::isStatic [modifiers])
_
- true)
+ #1)
(case method-style
#Special
(not (or (Modifier::isInterface [(Class::getModifiers [] class)])
(Modifier::isAbstract [modifiers])))
_
- true)
+ #1)
(n/= (list.size arg-classes) (list.size parameters))
(list/fold (function (_ [expectedJC actualJC] prev)
(and prev
(text/= expectedJC actualJC)))
- true
+ #1
(list.zip2 arg-classes parameters))))))
(def: (check-constructor class arg-classes constructor)
@@ -966,7 +966,7 @@
(list/fold (function (_ [expectedJC actualJC] prev)
(and prev
(text/= expectedJC actualJC)))
- true
+ #1
(list.zip2 arg-classes parameters))))))
(def: idx-to-parameter
diff --git a/stdlib/source/lux/language/compiler/meta/cache.lux b/stdlib/source/lux/language/compiler/meta/cache.lux
index 4a35d81d4..d382c5860 100644
--- a/stdlib/source/lux/language/compiler/meta/cache.lux
+++ b/stdlib/source/lux/language/compiler/meta/cache.lux
@@ -78,11 +78,11 @@
(do @
[? (:: System<m> directory? file)]
(if ?
- (wrap false)
+ (wrap #0)
(do @
[_ (..delete System<m> file)]
- (wrap true))))))]
- [(list.every? (bit/= true))
+ (wrap #1))))))]
+ [(list.every? (bit/= #1))
(if> [(..delete System<m> document)]
[(wrap [])])]))))
diff --git a/stdlib/source/lux/language/compiler/synthesis.lux b/stdlib/source/lux/language/compiler/synthesis.lux
index 202260fa2..3d6762342 100644
--- a/stdlib/source/lux/language/compiler/synthesis.lux
+++ b/stdlib/source/lux/language/compiler/synthesis.lux
@@ -26,7 +26,7 @@
State
{#scope-arity +0
#resolver fresh-resolver
- #direct? false
+ #direct? #0
#locals +0})
(type: #export Primitive
@@ -158,8 +158,8 @@
(All [a] (-> (Operation a) (Operation a)))
(extension.temporary (set@ #direct? <value>)))]
- [indirectly false]
- [directly true]
+ [indirectly #0]
+ [directly #1]
)
(do-template [<name> <type> <tag>]
@@ -177,7 +177,7 @@
(All [a] (-> (Operation a) (Operation a))))
(extension.with-state {#scope-arity arity
#resolver resolver
- #direct? true
+ #direct? #1
#locals arity}))
(do-template [<name> <tag> <type>]
diff --git a/stdlib/source/lux/language/compiler/synthesis/case.lux b/stdlib/source/lux/language/compiler/synthesis/case.lux
index 0c23d1f52..045abbde7 100644
--- a/stdlib/source/lux/language/compiler/synthesis/case.lux
+++ b/stdlib/source/lux/language/compiler/synthesis/case.lux
@@ -152,10 +152,10 @@
headB/bodyS])))))
<if>
- (as-is (^or (^ [[(analysis.pattern/bit true) thenA]
- (list [(analysis.pattern/bit false) elseA])])
- (^ [[(analysis.pattern/bit false) elseA]
- (list [(analysis.pattern/bit true) thenA])]))
+ (as-is (^or (^ [[(analysis.pattern/bit #1) thenA]
+ (list [(analysis.pattern/bit #0) elseA])])
+ (^ [[(analysis.pattern/bit #0) elseA]
+ (list [(analysis.pattern/bit #1) thenA])]))
(do @
[thenS (synthesize^ thenA)
elseS (synthesize^ elseA)]
diff --git a/stdlib/source/lux/language/compiler/synthesis/expression.lux b/stdlib/source/lux/language/compiler/synthesis/expression.lux
index 0d780d444..f6d68fc05 100644
--- a/stdlib/source/lux/language/compiler/synthesis/expression.lux
+++ b/stdlib/source/lux/language/compiler/synthesis/expression.lux
@@ -92,7 +92,7 @@
(list/map (|>> //.variable/local))
[(//.variable/local +0)]
//.function/apply)
- (#//.Reference (#reference.Variable (function.adjust arity false var))))
+ (#//.Reference (#reference.Variable (function.adjust arity #0 var))))
(#//.Reference (#reference.Variable var)))))
(#reference.Foreign register)
diff --git a/stdlib/source/lux/language/compiler/synthesis/function.lux b/stdlib/source/lux/language/compiler/synthesis/function.lux
index 67f0dda46..e73621b5c 100644
--- a/stdlib/source/lux/language/compiler/synthesis/function.lux
+++ b/stdlib/source/lux/language/compiler/synthesis/function.lux
@@ -95,10 +95,10 @@
(list/map (.function (_ closure)
(case (dict.get closure resolver)
(#.Some resolved)
- (adjust arity true resolved)
+ (adjust arity #1 resolved)
#.None
- (adjust arity false closure)))
+ (adjust arity #0 closure)))
environment)
environment)
down-environment (: (List Variable)
diff --git a/stdlib/source/lux/language/compiler/synthesis/loop.lux b/stdlib/source/lux/language/compiler/synthesis/loop.lux
index eeb1adcc7..95666656b 100644
--- a/stdlib/source/lux/language/compiler/synthesis/loop.lux
+++ b/stdlib/source/lux/language/compiler/synthesis/loop.lux
@@ -21,8 +21,8 @@
(def: (some? maybe)
(All [a] (-> (Maybe a) Bit))
(case maybe
- (#.Some _) true
- #.None false))
+ (#.Some _) #1
+ #.None #0))
(template: #export (self)
(#//.Reference (reference.local +0)))
@@ -30,8 +30,8 @@
(template: (recursive-apply args)
(#//.Apply (self) args))
-(def: proper Bit true)
-(def: improper Bit false)
+(def: proper Bit #1)
+(def: improper Bit #0)
(def: (proper? exprS)
(-> Synthesis Bit)
diff --git a/stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux
index a84677144..8e0d0c270 100644
--- a/stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux
+++ b/stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux
@@ -51,19 +51,19 @@
(def: #export none
Computation
- (variant [+0 false ..unit]))
+ (variant [+0 #0 ..unit]))
(def: #export some
(-> Expression Computation)
- (|>> [+0 true] ..variant))
+ (|>> [+0 #1] ..variant))
(def: #export left
(-> Expression Computation)
- (|>> [+0 false] ..variant))
+ (|>> [+0 #0] ..variant))
(def: #export right
(-> Expression Computation)
- (|>> [+0 true] ..variant))
+ (|>> [+0 #1] ..variant))
(def: declaration
(s.Syntax [Text (List Text)])
@@ -283,8 +283,8 @@
(_.if (_.eq?/2 old @temp)
(_.begin
(list (_.vector-set!/3 atom (_.int 0) new)
- (_.bool true)))
- (_.bool false)))))
+ (_.bool #1)))
+ (_.bool #0)))))
(def: runtime//atom
Computation
diff --git a/stdlib/source/lux/language/host/scheme.lux b/stdlib/source/lux/language/host/scheme.lux
index d2edd6fac..e312e769b 100644
--- a/stdlib/source/lux/language/host/scheme.lux
+++ b/stdlib/source/lux/language/host/scheme.lux
@@ -63,8 +63,8 @@
(def: #export bool
(-> Bit Computation)
- (|>> (case> true "#t"
- false "#f")
+ (|>> (case> #0 "#f"
+ #1 "#t")
:abstraction))
(def: #export int
diff --git a/stdlib/source/lux/language/reference.lux b/stdlib/source/lux/language/reference.lux
index 0f4ee03a5..84b838b3d 100644
--- a/stdlib/source/lux/language/reference.lux
+++ b/stdlib/source/lux/language/reference.lux
@@ -24,7 +24,7 @@
([#Local] [#Foreign])
_
- false)))
+ #0)))
(structure: #export _ (Hash Variable)
(def: eq Equivalence<Variable>)
@@ -61,7 +61,7 @@
(-> Variable Bit)
(|>> ..variable
(case> (^ (..local +0))
- true
+ #1
_
- false)))
+ #0)))
diff --git a/stdlib/source/lux/language/syntax.lux b/stdlib/source/lux/language/syntax.lux
index e31356dcb..18fd61c8a 100644
--- a/stdlib/source/lux/language/syntax.lux
+++ b/stdlib/source/lux/language/syntax.lux
@@ -354,7 +354,7 @@
(loop [text-read ""
where (|> where
(update@ #.column inc))
- must-have-offset? false]
+ must-have-offset? #0]
(p.either (if must-have-offset?
## If I'm at the start of a
## new line, I must ensure the
@@ -376,7 +376,7 @@
(format text-read))
(|> where
(update@ #.column (n/+ offset-size)))
- false)
+ #0)
(p.fail (format "Each line of a multi-line text must have an appropriate offset!\n"
"Expected: " (%i (.int offset-column)) " columns.\n"
" Actual: " (%i (.int offset-size)) " columns.\n"))))
@@ -387,7 +387,7 @@
(recur (format text-read normal)
(|> where
(update@ #.column (n/+ (text.size normal))))
- false))
+ #0))
## Must handle escaped
## chars separately.
(do @
@@ -395,7 +395,7 @@
(recur (format text-read char)
(|> where
(update@ #.column (n/+ chars-consumed)))
- false))
+ #0))
## The text ends when it
## reaches the right-delimiter.
(do @
@@ -413,7 +413,7 @@
(|> where
(update@ #.line inc)
(set@ #.column +0))
- true)))))]
+ #1)))))]
(wrap [where'
[where (#.Text text-read)]])))
@@ -581,8 +581,8 @@
(^template [<name> <value>]
["" <name>]
(#.Bit <value>))
- (["true" true]
- ["false" false])
+ (["#0" #0]
+ ["#1" #1])
_
(#.Symbol value))]])))
diff --git a/stdlib/source/lux/language/type.lux b/stdlib/source/lux/language/type.lux
index cdb43422d..11b1e1223 100644
--- a/stdlib/source/lux/language/type.lux
+++ b/stdlib/source/lux/language/type.lux
@@ -55,7 +55,7 @@
(and (text/= xname yname)
(n/= (list.size yparams) (list.size xparams))
(list/fold (.function (_ [x y] prev) (and prev (= x y)))
- true
+ #1
(list.zip2 xparams yparams)))
(^template [<tag>]
@@ -82,11 +82,11 @@
(and (n/= (list.size yenv) (list.size xenv))
(= xbody ybody)
(list/fold (.function (_ [x y] prev) (and prev (= x y)))
- true
+ #1
(list.zip2 xenv yenv)))
_
- false
+ #0
)))
## [Values]
@@ -319,16 +319,16 @@
(quantified? _type)
(#.Apply A F)
- (maybe.default false
+ (maybe.default #0
(do maybe.Monad<Maybe>
[applied (apply (list A) F)]
(wrap (quantified? applied))))
(^or (#.UnivQ _) (#.ExQ _))
- true
+ #1
_
- false))
+ #0))
(def: #export (array level elem-type)
(-> Nat Type Type)
diff --git a/stdlib/source/lux/language/type/check.lux b/stdlib/source/lux/language/type/check.lux
index 3308c497b..abd6bda5e 100644
--- a/stdlib/source/lux/language/type/check.lux
+++ b/stdlib/source/lux/language/type/check.lux
@@ -186,7 +186,7 @@
#.None
(ex.throw unknown-type-var id))))]
- [bound? Bit false true]
+ [bound? Bit #0 #1]
[read (Maybe Type) #.None (#.Some bound)]
)
@@ -348,7 +348,7 @@
(-> [Type Type] Bit (List Assumption) (List Assumption))
(#.Cons [ea status] assumptions))
-(def: (on id type then else)
+(def: (if-bind id type then else)
(All [a]
(-> Var Type (Check a) (-> Type (Check a))
(Check a)))
@@ -530,16 +530,16 @@
(check-vars check' assumptions idE idA)
[(#.Var id) _]
- (on id actual
- (check/wrap assumptions)
- (function (_ bound)
- (check' bound actual assumptions)))
+ (if-bind id actual
+ (check/wrap assumptions)
+ (function (_ bound)
+ (check' bound actual assumptions)))
[_ (#.Var id)]
- (on id expected
- (check/wrap assumptions)
- (function (_ bound)
- (check' expected bound assumptions)))
+ (if-bind id expected
+ (check/wrap assumptions)
+ (function (_ bound)
+ (check' expected bound assumptions)))
(^template [<fe> <fa>]
[(#.Apply A1 <fe>) (#.Apply A2 <fa>)]
@@ -560,7 +560,7 @@
#.None
(do Monad<Check>
[expected' (apply-type! F A)]
- (check' expected' actual (assume! fx-pair true assumptions)))))
+ (check' expected' actual (assume! fx-pair #1 assumptions)))))
[_ (#.Apply A F)]
(do Monad<Check>
@@ -636,10 +636,10 @@
(-> Type Type Bit)
(case (run fresh-context (check expected actual))
(#e.Error error)
- false
+ #0
(#e.Success _)
- true))
+ #1))
(def: #export context
(Check Type-Context)