aboutsummaryrefslogtreecommitdiff
path: root/lux-jvm/source/luxc
diff options
context:
space:
mode:
authorEduardo Julian2021-08-23 02:30:53 -0400
committerEduardo Julian2021-08-23 02:30:53 -0400
commitec1f31b5a1492d5e0ab260397291d4449483bbd9 (patch)
treec730b4ca89af366779b0ad0f46fae705b5c2bcbc /lux-jvm/source/luxc
parent1ea83ecadccc5adee1bdb35bd11527c3982c015e (diff)
The Python compiler can now be compiled by the new JVM compiler.
Diffstat (limited to '')
-rw-r--r--lux-jvm/source/luxc/lang/directive/jvm.lux38
-rw-r--r--lux-jvm/source/luxc/lang/synthesis/variable.lux22
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/case.lux52
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux10
4 files changed, 61 insertions, 61 deletions
diff --git a/lux-jvm/source/luxc/lang/directive/jvm.lux b/lux-jvm/source/luxc/lang/directive/jvm.lux
index a7314b0dc..2c6577ae1 100644
--- a/lux-jvm/source/luxc/lang/directive/jvm.lux
+++ b/lux-jvm/source/luxc/lang/directive/jvm.lux
@@ -18,9 +18,9 @@
["%" format (#+ format)]]
[collection
[array (#+ Array)]
- ["." list ("#\." fold functor monoid)]
+ ["." list ("#\." mix functor monoid)]
["." dictionary (#+ Dictionary)]
- ["." row (#+ Row) ("#\." functor fold)]]]
+ ["." row (#+ Row) ("#\." functor mix)]]]
[math
[number
["." nat]]]
@@ -442,18 +442,18 @@
(#/.TABLESWITCH min max default labels)
(let [[mapping default] (..relabel [mapping default])
- [mapping labels] (list\fold (function (_ input [mapping output])
- (let [[mapping input] (..relabel [mapping input])]
- [mapping (list& input output)]))
- [mapping (list)] labels)]
+ [mapping labels] (list\mix (function (_ input [mapping output])
+ (let [[mapping input] (..relabel [mapping input])]
+ [mapping (list& input output)]))
+ [mapping (list)] labels)]
[mapping (#/.TABLESWITCH min max default (list.reversed labels))])
(#/.LOOKUPSWITCH default keys+labels)
(let [[mapping default] (..relabel [mapping default])
- [mapping keys+labels] (list\fold (function (_ [expected input] [mapping output])
- (let [[mapping input] (..relabel [mapping input])]
- [mapping (list& [expected input] output)]))
- [mapping (list)] keys+labels)]
+ [mapping keys+labels] (list\mix (function (_ [expected input] [mapping output])
+ (let [[mapping input] (..relabel [mapping input])]
+ [mapping (list& [expected input] output)]))
+ [mapping (list)] keys+labels)]
[mapping (#/.LOOKUPSWITCH default (list.reversed keys+labels))])
))
@@ -515,11 +515,11 @@
(def: (relabel_bytecode [mapping bytecode])
(Re_labeler (/.Bytecode Inst))
- (row\fold (function (_ input [mapping output])
- (let [[mapping input'] (..relabel_instruction [mapping input])]
- [mapping (row.suffix input' output)]))
- [mapping (row.row)]
- bytecode))
+ (row\mix (function (_ input [mapping output])
+ (let [[mapping input'] (..relabel_instruction [mapping input])]
+ [mapping (row.suffix input' output)]))
+ [mapping (row.row)]
+ bytecode))
(def: fresh
Mapping
@@ -1033,7 +1033,7 @@
[_scope bodyA] (|> arguments'
(#.Item [self selfT])
list.reversed
- (list\fold scopeA.with_local (analyse archive bodyC))
+ (list\mix scopeA.with_local (analyse archive bodyC))
(typeA.with_type returnT)
analysis.with_scope)]
(in [privacy strict_floating_point? annotations method_tvars exceptions
@@ -1063,7 +1063,7 @@
[_scope bodyA] (|> arguments'
(#.Item [self selfT])
list.reversed
- (list\fold scopeA.with_local (analyse archive bodyC))
+ (list\mix scopeA.with_local (analyse archive bodyC))
(typeA.with_type returnT)
analysis.with_scope)]
(in [[super_name super_tvars] method_name strict_floating_point? annotations
@@ -1091,7 +1091,7 @@
[_scope bodyA] (|> arguments'
(#.Item [self selfT])
list.reversed
- (list\fold scopeA.with_local (analyse archive bodyC))
+ (list\mix scopeA.with_local (analyse archive bodyC))
(typeA.with_type returnT)
analysis.with_scope)]
(in [name privacy final? strict_floating_point? annotations method_tvars
@@ -1116,7 +1116,7 @@
returnT (//A.boxed_reflection_return mapping returnJ)
[_scope bodyA] (|> arguments'
list.reversed
- (list\fold scopeA.with_local (analyse archive bodyC))
+ (list\mix scopeA.with_local (analyse archive bodyC))
(typeA.with_type returnT)
analysis.with_scope)]
(in [name privacy strict_floating_point? annotations method_tvars
diff --git a/lux-jvm/source/luxc/lang/synthesis/variable.lux b/lux-jvm/source/luxc/lang/synthesis/variable.lux
index 4721187f8..f4e68d25b 100644
--- a/lux-jvm/source/luxc/lang/synthesis/variable.lux
+++ b/lux-jvm/source/luxc/lang/synthesis/variable.lux
@@ -2,7 +2,7 @@
lux
(lux (data [library
[number]]
- (coll [list "list/" Fold<List> Monoid<List>]
+ (coll [list "list/" Mix<List> Monoid<List>]
["s" set])))
(luxc (lang ["la" analysis]
["ls" synthesis]
@@ -47,7 +47,7 @@
(def: (unused-vars current-arity bound exprS)
(-> ls.Arity (List Variable) ls.Synthesis (List Variable))
(let [tracker (loop [exprS exprS
- tracker (list/fold s.has init-tracker bound)]
+ tracker (list/mix s.has init-tracker bound)]
(case exprS
(#ls.Variable var)
(if (non-arg? current-arity var)
@@ -58,14 +58,14 @@
(recur memberS tracker)
(#ls.Tuple membersS)
- (list/fold recur tracker membersS)
+ (list/mix recur tracker membersS)
(#ls.Call funcS argsS)
- (list/fold recur (recur funcS tracker) argsS)
+ (list/mix recur (recur funcS tracker) argsS)
(^or (#ls.Recur argsS)
(#ls.Procedure name argsS))
- (list/fold recur tracker argsS)
+ (list/mix recur tracker argsS)
(#ls.Let offset inputS outputS)
(|> tracker (recur inputS) (recur outputS))
@@ -74,16 +74,16 @@
(|> tracker (recur testS) (recur thenS) (recur elseS))
(#ls.Loop offset initsS bodyS)
- (recur bodyS (list/fold recur tracker initsS))
+ (recur bodyS (list/mix recur tracker initsS))
(#ls.Case inputS outputPS)
- (let [tracker' (list/fold s.has
- (recur inputS tracker)
- (bound-vars outputPS))]
- (list/fold recur tracker' (path-bodies outputPS)))
+ (let [tracker' (list/mix s.has
+ (recur inputS tracker)
+ (bound-vars outputPS))]
+ (list/mix recur tracker' (path-bodies outputPS)))
(#ls.Function arity env bodyS)
- (list/fold s.lacks tracker env)
+ (list/mix s.lacks tracker env)
_
tracker
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/case.lux b/lux-jvm/source/luxc/lang/translation/jvm/case.lux
index 3a6291036..eb1f37f0b 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/case.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/case.lux
@@ -8,7 +8,7 @@
["ex" exception (#+ exception:)]]
[data
[collection
- ["." list ("#@." fold)]]]
+ ["." list ("#@." mix)]]]
[math
[number
["n" nat]]]
@@ -132,21 +132,21 @@
[(<tag> cons)
(do {@ phase.monad}
[forkG (: (Operation Inst)
- (monad.fold @ (function (_ [test thenP] elseG)
- (do @
- [thenG (path' stack_depth @else @end phase archive thenP)]
- (in (<| _.with_label (function (_ @else))
- (|>> <dup>
- (<test> test)
- <comparison>
- (<if> @else)
- <pop>
- thenG
- (_.label @else)
- elseG)))))
- (|>> <pop>
- (_.GOTO @else))
- (#.Item cons)))]
+ (monad.mix @ (function (_ [test thenP] elseG)
+ (do @
+ [thenG (path' stack_depth @else @end phase archive thenP)]
+ (in (<| _.with_label (function (_ @else))
+ (|>> <dup>
+ (<test> test)
+ <comparison>
+ (<if> @else)
+ <pop>
+ thenG
+ (_.label @else)
+ elseG)))))
+ (|>> <pop>
+ (_.GOTO @else))
+ (#.Item cons)))]
(in (|>> peekI
<unwrap>
forkG)))])
@@ -266,16 +266,16 @@
(Generator [(List synthesis.Member) Synthesis])
(do phase.monad
[recordG (phase archive recordS)]
- (in (list@fold (function (_ step so_far)
- (.let [next (.case step
- (#.Left lefts)
- (..left_projection lefts)
-
- (#.Right lefts)
- (..right_projection lefts))]
- (|>> so_far next)))
- recordG
- (list.reversed path)))))
+ (in (list@mix (function (_ step so_far)
+ (.let [next (.case step
+ (#.Left lefts)
+ (..left_projection lefts)
+
+ (#.Right lefts)
+ (..right_projection lefts))]
+ (|>> so_far next)))
+ recordG
+ (list.reversed path)))))
(def: .public (case phase archive [valueS path])
(Generator [Synthesis Path])
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
index 31538a0bd..e2855e999 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
@@ -16,7 +16,7 @@
["." text ("#\." equivalence)
["%" format (#+ format)]]
[collection
- ["." list ("#\." monad fold)]
+ ["." list ("#\." monad mix)]
["." dictionary (#+ Dictionary)]
["." set]]]
[macro
@@ -1031,10 +1031,10 @@
(-> Nat (List (Type Value)) Inst)
(|> types
list.enumeration
- (list\fold (function (_ [lux_register type] [jvm_register before])
- (let [[jvm_register' after] (prepare_argument (n.+ offset lux_register) type jvm_register)]
- [jvm_register' (|>> before after)]))
- (: [Register Inst] [offset (|>>)]))
+ (list\mix (function (_ [lux_register type] [jvm_register before])
+ (let [[jvm_register' after] (prepare_argument (n.+ offset lux_register) type jvm_register)]
+ [jvm_register' (|>> before after)]))
+ (: [Register Inst] [offset (|>>)]))
product.right))
(def: .public (returnI returnT)