From ec1f31b5a1492d5e0ab260397291d4449483bbd9 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 23 Aug 2021 02:30:53 -0400 Subject: The Python compiler can now be compiled by the new JVM compiler. --- lux-jvm/source/luxc/lang/translation/jvm/case.lux | 52 +++++++++++----------- .../luxc/lang/translation/jvm/extension/host.lux | 10 ++--- 2 files changed, 31 insertions(+), 31 deletions(-) (limited to 'lux-jvm/source/luxc/lang/translation/jvm') 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 @@ [( 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)) - (|>> - ( test) - - ( @else) - - thenG - (_.label @else) - elseG))))) - (|>> - (_.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)) + (|>> + ( test) + + ( @else) + + thenG + (_.label @else) + elseG))))) + (|>> + (_.GOTO @else)) + (#.Item cons)))] (in (|>> peekI 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) -- cgit v1.2.3