From ccfa75463cd7c702f41c3dae5cbdaeade7ba5c31 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 14 Sep 2021 16:41:18 -0400 Subject: Re-named "recur" to "again". --- lux-jvm/source/luxc/lang/host/jvm/inst.lux | 4 +-- lux-jvm/source/luxc/lang/synthesis/variable.lux | 20 ++++++------ .../luxc/lang/translation/jvm/expression.lux | 4 +-- .../luxc/lang/translation/jvm/extension/host.lux | 36 +++++++++++----------- lux-jvm/source/luxc/lang/translation/jvm/loop.lux | 2 +- lux-jvm/test/test/luxc/lang/synthesis/loop.lux | 26 ++++++++-------- 6 files changed, 46 insertions(+), 46 deletions(-) (limited to 'lux-jvm') diff --git a/lux-jvm/source/luxc/lang/host/jvm/inst.lux b/lux-jvm/source/luxc/lang/host/jvm/inst.lux index fbb6da059..1384d1a73 100644 --- a/lux-jvm/source/luxc/lang/host/jvm/inst.lux +++ b/lux-jvm/source/luxc/lang/host/jvm/inst.lux @@ -379,7 +379,7 @@ (exec (ffi.write! idx (ffi.long_to_int key) keys_array) (ffi.write! idx label labels_array) - (recur (++ idx)))) + (again (++ idx)))) []))] (do_to visitor (org/objectweb/asm/MethodVisitor::visitLookupSwitchInsn default keys_array labels_array))))) @@ -394,7 +394,7 @@ (exec (ffi.write! idx (maybe.trusted (list.item idx labels)) labels_array) - (recur (++ idx))) + (again (++ idx))) []))] (do_to visitor (org/objectweb/asm/MethodVisitor::visitTableSwitchInsn min max default labels_array))))) diff --git a/lux-jvm/source/luxc/lang/synthesis/variable.lux b/lux-jvm/source/luxc/lang/synthesis/variable.lux index 927ec84e3..02f3c0757 100644 --- a/lux-jvm/source/luxc/lang/synthesis/variable.lux +++ b/lux-jvm/source/luxc/lang/synthesis/variable.lux @@ -56,32 +56,32 @@ tracker) {ls.#Variant tag last? memberS} - (recur memberS tracker) + (again memberS tracker) {ls.#Tuple membersS} - (list/mix recur tracker membersS) + (list/mix again tracker membersS) {ls.#Call funcS argsS} - (list/mix recur (recur funcS tracker) argsS) + (list/mix again (again funcS tracker) argsS) - (^or {ls.#Recur argsS} + (^or {ls.#Again argsS} {ls.#Procedure name argsS}) - (list/mix recur tracker argsS) + (list/mix again tracker argsS) {ls.#Let offset inputS outputS} - (|> tracker (recur inputS) (recur outputS)) + (|> tracker (again inputS) (again outputS)) {ls.#If testS thenS elseS} - (|> tracker (recur testS) (recur thenS) (recur elseS)) + (|> tracker (again testS) (again thenS) (again elseS)) {ls.#Loop offset initsS bodyS} - (recur bodyS (list/mix recur tracker initsS)) + (again bodyS (list/mix again tracker initsS)) {ls.#Case inputS outputPS} (let [tracker' (list/mix s.has - (recur inputS tracker) + (again inputS tracker) (bound-vars outputPS))] - (list/mix recur tracker' (path-bodies outputPS))) + (list/mix again tracker' (path-bodies outputPS))) {ls.#Function arity env bodyS} (list/mix s.lacks tracker env) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/expression.lux b/lux-jvm/source/luxc/lang/translation/jvm/expression.lux index de8ac3c12..087cc8c3b 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/expression.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/expression.lux @@ -59,8 +59,8 @@ (^ (synthesis.branch/case data)) (case.case translate archive data) - (^ (synthesis.loop/recur data)) - (loop.recur translate archive data) + (^ (synthesis.loop/again data)) + (loop.again translate archive data) (^ (synthesis.loop/scope data)) (loop.scope translate archive data) 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 e32e35869..a8becd813 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux @@ -831,7 +831,7 @@ body {synthesis.#Seq _ next} - (recur next) + (again next) {synthesis.#Then hidden} hidden)) @@ -867,14 +867,14 @@ (def: (normalize_path normalize) (-> (-> Synthesis Synthesis) (-> Path Path)) - (function (recur path) + (function (again path) (case path (^ (synthesis.path/then bodyS)) (synthesis.path/then (normalize bodyS)) (^template [] [(^ { leftP rightP}) - { (recur leftP) (recur rightP)}]) + { (again leftP) (again rightP)}]) ([synthesis.#Alt] [synthesis.#Seq]) @@ -886,13 +886,13 @@ [synthesis.#Access]) {synthesis.#Bit_Fork when then else} - {synthesis.#Bit_Fork when (recur then) (maybe#each recur else)} + {synthesis.#Bit_Fork when (again then) (maybe#each again else)} (^template [] [{ [[test then] elses]} - { [[test (recur then)] + { [[test (again then)] (list#each (function (_ [else_test else_then]) - [else_test (recur else_then)]) + [else_test (again else_then)]) elses)]}]) ([synthesis.#I64_Fork] [synthesis.#F64_Fork] @@ -901,7 +901,7 @@ (def: (normalize_method_body mapping) (-> (Dictionary Synthesis Variable) Synthesis Synthesis) - (function (recur body) + (function (again body) (case body (^ {synthesis.#Primitive value}) body @@ -910,10 +910,10 @@ body (^ (synthesis.variant [lefts right? sub])) - (synthesis.variant [lefts right? (recur sub)]) + (synthesis.variant [lefts right? (again sub)]) (^ (synthesis.tuple members)) - (synthesis.tuple (list#each recur members)) + (synthesis.tuple (list#each again members)) (^ (synthesis.variable var)) (|> mapping @@ -922,22 +922,22 @@ synthesis.variable) (^ (synthesis.branch/case [inputS pathS])) - (synthesis.branch/case [(recur inputS) (normalize_path recur pathS)]) + (synthesis.branch/case [(again inputS) (normalize_path again pathS)]) (^ (synthesis.branch/let [inputS register outputS])) - (synthesis.branch/let [(recur inputS) register (recur outputS)]) + (synthesis.branch/let [(again inputS) register (again outputS)]) (^ (synthesis.branch/if [testS thenS elseS])) - (synthesis.branch/if [(recur testS) (recur thenS) (recur elseS)]) + (synthesis.branch/if [(again testS) (again thenS) (again elseS)]) (^ (synthesis.branch/get [path recordS])) - (synthesis.branch/get [path (recur recordS)]) + (synthesis.branch/get [path (again recordS)]) (^ (synthesis.loop/scope [offset initsS+ bodyS])) - (synthesis.loop/scope [offset (list#each recur initsS+) (recur bodyS)]) + (synthesis.loop/scope [offset (list#each again initsS+) (again bodyS)]) - (^ (synthesis.loop/recur updatesS+)) - (synthesis.loop/recur (list#each recur updatesS+)) + (^ (synthesis.loop/again updatesS+)) + (synthesis.loop/again (list#each again updatesS+)) (^ (synthesis.function/abstraction [environment arity bodyS])) (synthesis.function/abstraction [(list#each (function (_ captured) @@ -955,10 +955,10 @@ bodyS]) (^ (synthesis.function/apply [functionS inputsS+])) - (synthesis.function/apply [(recur functionS) (list#each recur inputsS+)]) + (synthesis.function/apply [(again functionS) (list#each again inputsS+)]) {synthesis.#Extension [name inputsS+]} - {synthesis.#Extension [name (list#each recur inputsS+)]}))) + {synthesis.#Extension [name (list#each again inputsS+)]}))) (def: $Object (type.class "java.lang.Object" (list))) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/loop.lux b/lux-jvm/source/luxc/lang/translation/jvm/loop.lux index ad0b41e4e..f31a5d094 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/loop.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/loop.lux @@ -36,7 +36,7 @@ _ false)) -(def: .public (recur translate archive argsS) +(def: .public (again translate archive argsS) (Generator (List Synthesis)) (do [@ phase.monad] [[@begin start] generation.anchor diff --git a/lux-jvm/test/test/luxc/lang/synthesis/loop.lux b/lux-jvm/test/test/luxc/lang/synthesis/loop.lux index a5ef3da9d..16ec6ceda 100644 --- a/lux-jvm/test/test/luxc/lang/synthesis/loop.lux +++ b/lux-jvm/test/test/luxc/lang/synthesis/loop.lux @@ -25,11 +25,11 @@ (loop [pathS pathS] (case pathS (^ [_ {.#Form (list [_ {.#Text "lux case alt"}] leftS rightS)}]) - (or (recur leftS) - (recur rightS)) + (or (again leftS) + (again rightS)) (^ [_ {.#Form (list [_ {.#Text "lux case seq"}] leftS rightS)}]) - (recur rightS) + (again rightS) (^ [_ {.#Form (list [_ {.#Text "lux case exec"}] bodyS)}]) (does-recursion? arity bodyS) @@ -37,15 +37,15 @@ _ #0)) - (^ [_ {.#Form (list& [_ {.#Text "lux recur"}] argsS)}]) + (^ [_ {.#Form (list& [_ {.#Text "lux again"}] argsS)}]) (n/= arity (list.size argsS)) (^ [_ {.#Form (list [_ {.#Text "lux let"}] register inputS bodyS)}]) - (recur bodyS) + (again bodyS) (^ [_ {.#Form (list [_ {.#Text "lux if"}] inputS thenS elseS)}]) - (or (recur thenS) - (recur elseS)) + (or (again thenS) + (again elseS)) _ #0 @@ -93,8 +93,8 @@ (r.Random [Bit Nat la.Analysis]) (do r.Monad [arity (|> r.nat (:: @ each (|>> (n/% +10) (n/max +1)))) - recur? r.bit - outputS (if recur? + again? r.bit + outputS (if again? (wrap (la.apply (list.repeat arity (' [])) (la.var 0))) (do @ [plus-or-minus? r.bit @@ -102,17 +102,17 @@ #let [shift (if plus-or-minus? n/+ n/-)]] (wrap (la.apply (list.repeat (shift how-much arity) (' [])) (la.var 0))))) bodyS (gen-body arity outputS)] - (wrap [recur? arity (make-function arity bodyS)]))) + (wrap [again? arity (make-function arity bodyS)]))) (def: gen-loop (r.Random [Bit Nat la.Analysis]) (do r.Monad [arity (|> r.nat (:: @ each (|>> (n/% +10) (n/max +1)))) - recur? r.bit + again? r.bit self-ref? r.bit #let [selfA (la.var 0) argA (if self-ref? selfA (' []))] - outputS (if recur? + outputS (if again? (wrap (la.apply (list.repeat arity argA) selfA)) (do @ [plus-or-minus? r.bit @@ -120,7 +120,7 @@ #let [shift (if plus-or-minus? n/+ n/-)]] (wrap (la.apply (list.repeat (shift how-much arity) (' [])) selfA)))) bodyS (gen-body arity outputS)] - (wrap [(and recur? (not self-ref?)) + (wrap [(and again? (not self-ref?)) arity (make-function arity bodyS)]))) -- cgit v1.2.3