diff options
author | Eduardo Julian | 2021-08-24 05:23:45 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-08-24 05:23:45 -0400 |
commit | 36303d6cb2ce3ab9e36d045b9516c997bd461862 (patch) | |
tree | b9d2f1495143054d61d9af129f36833624db9dac /lux-jvm/source/luxc/lang/translation/jvm/loop.lux | |
parent | ec1f31b5a1492d5e0ab260397291d4449483bbd9 (diff) |
Outsourced the syntax for labelled type definitions to macros.
Diffstat (limited to 'lux-jvm/source/luxc/lang/translation/jvm/loop.lux')
-rw-r--r-- | lux-jvm/source/luxc/lang/translation/jvm/loop.lux | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/loop.lux b/lux-jvm/source/luxc/lang/translation/jvm/loop.lux index 85187815d..ae1300cf9 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/loop.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/loop.lux @@ -42,8 +42,8 @@ [[@begin start] generation.anchor .let [pairs (|> argsS list.enumeration - (list@map (function (_ [register argument]) - [(n.+ start register) argument])))] + (list@each (function (_ [register argument]) + [(n.+ start register) argument])))] ... It may look weird that first I compile the values separately, ... and then I compile the stores/allocations. ... It must be done that way in order to avoid a potential bug. @@ -52,18 +52,18 @@ ... and stores separately, then by the time Y is evaluated, it ... will refer to the new value of X, instead of the old value, and ... shouldn't be the case. - valuesI+ (monad.map @ (function (_ [register argS]) - (: (Operation Inst) - (if (invariant? register argS) - (in function.identity) - (translate archive argS)))) - pairs) - .let [storesI+ (list@map (function (_ [register argS]) - (: Inst - (if (invariant? register argS) - function.identity - (_.ASTORE register)))) - (list.reversed pairs))]] + valuesI+ (monad.each @ (function (_ [register argS]) + (: (Operation Inst) + (if (invariant? register argS) + (in function.identity) + (translate archive argS)))) + pairs) + .let [storesI+ (list@each (function (_ [register argS]) + (: Inst + (if (invariant? register argS) + function.identity + (_.ASTORE register)))) + (list.reversed pairs))]] (in (|>> (_.fuse valuesI+) (_.fuse storesI+) (_.GOTO @begin))))) @@ -72,13 +72,13 @@ (Generator [Nat (List Synthesis) Synthesis]) (do {@ phase.monad} [@begin _.make_label - initsI+ (monad.map @ (translate archive) initsS+) + initsI+ (monad.each @ (translate archive) initsS+) iterationI (generation.with_anchor [@begin start] (translate archive iterationS)) .let [initializationI (|> (list.enumeration initsI+) - (list@map (function (_ [register initI]) - (|>> initI - (_.ASTORE (n.+ start register))))) + (list@each (function (_ [register initI]) + (|>> initI + (_.ASTORE (n.+ start register))))) _.fuse)]] (in (|>> initializationI (_.label @begin) |