From 2dbbaaec93a53f8dd0b96a0028b9cf125c9066cd Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 12 Sep 2021 15:39:55 -0400 Subject: Re-named \ => # && \\ => ## --- lux-jvm/source/luxc/lang/translation/jvm.lux | 8 +-- .../source/luxc/lang/translation/jvm/common.lux | 8 +-- .../luxc/lang/translation/jvm/extension/host.lux | 76 +++++++++++----------- .../source/luxc/lang/translation/jvm/reference.lux | 4 +- .../source/luxc/lang/translation/jvm/structure.lux | 2 +- 5 files changed, 49 insertions(+), 49 deletions(-) (limited to 'lux-jvm/source/luxc/lang/translation') diff --git a/lux-jvm/source/luxc/lang/translation/jvm.lux b/lux-jvm/source/luxc/lang/translation/jvm.lux index a44bc67e3..1da7db420 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm.lux @@ -132,7 +132,7 @@ (io.run! (do (try.with io.monad) [_ (loader.store eval_class bytecode library) class (loader.load eval_class loader) - value (\ io.monad in (..class_value eval_class class))] + value (# io.monad in (..class_value eval_class class))] (in [value [eval_class bytecode]]))))) @@ -140,7 +140,7 @@ (-> Library java/lang/ClassLoader Definition (Try Any)) (io.run! (do (try.with io.monad) [existing_class? (|> (atom.read! library) - (\ io.monad each (function (_ library) + (# io.monad each (function (_ library) (dictionary.key? library class_name))) (try.lifted io.monad) (: (IO (Try Bit)))) @@ -165,7 +165,7 @@ (: Host (implementation (def: (evaluate! context valueI) - (\ try.monad each product.left + (# try.monad each product.left (..evaluate! library loader context valueI))) (def: execute! @@ -188,7 +188,7 @@ custom)] _ (loader.store class_name bytecode library) class (loader.load class_name loader)] - (\ io.monad in (..class_value class_name class)))))))]))) + (# io.monad in (..class_value class_name class)))))))]))) (def: .public $Variant (type.array ..$Value)) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/common.lux b/lux-jvm/source/luxc/lang/translation/jvm/common.lux index 456a20694..642f5f83e 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/common.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/common.lux @@ -9,7 +9,7 @@ ... ["[0]" io]] ... [data ... [binary {"+" [Binary]}] - ... ["[0]" text ("[1]/[0]" hash) + ... ["[0]" text {"+" [\n]} ("[1]#[0]" hash) ... format] ... [collection ... ["[0]" dictionary {"+" [Dictionary]}]]] @@ -51,7 +51,7 @@ ... (def: .public (load-definition state) ... (-> Lux (-> Name Binary (Try Any))) ... (function (_ (^@ def-name [def-module def-name]) def-bytecode) -... (let [normal-name (format (name.normalize def-name) (%n (text/hash def-name))) +... (let [normal-name (format (name.normalize def-name) (%n (text#hash def-name))) ... class-name (format (text.replace-all "/" "." def-module) "." normal-name)] ... (<| (macro.result state) ... (do macro.monad @@ -68,6 +68,6 @@ ... {try.#Failure error} ... (phase.throw cannot-load-definition -... (format "Definition: " (%name def-name) "\n" -... "Error:\n" +... (format "Definition: " (%name def-name) \n +... "Error:" \n ... error)))))))) 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 930e219a5..3120b66b4 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux @@ -5,18 +5,18 @@ [abstract ["[0]" monad {"+" [do]}]] [control - ["[0]" maybe ("[1]\[0]" functor)] + ["[0]" maybe ("[1]#[0]" functor)] ["[0]" exception {"+" [exception:]}] ["[0]" function] - ["<>" parser ("[1]\[0]" monad) + ["<>" parser ("[1]#[0]" monad) ["<[0]>" text] ["<[0]>" synthesis {"+" [Parser]}]]] [data ["[0]" product] - ["[0]" text ("[1]\[0]" equivalence) + ["[0]" text ("[1]#[0]" equivalence) ["%" format {"+" [format]}]] [collection - ["[0]" list ("[1]\[0]" monad mix)] + ["[0]" list ("[1]#[0]" monad mix)] ["[0]" dictionary {"+" [Dictionary]}] ["[0]" set]]] [macro @@ -35,7 +35,7 @@ ["[0]" parser]]]] [tool [compiler - ["[0]" phase ("[1]\[0]" monad)] + ["[0]" phase ("[1]#[0]" monad)] [reference {"+" []} ["[0]" variable {"+" [Variable Register]}]] [meta @@ -570,15 +570,15 @@ (do phase.monad [valueI (generate archive valueS)] (`` (cond (~~ (template [ ] - [(and (text\= (reflection.reflection (type.reflection )) + [(and (text#= (reflection.reflection (type.reflection )) from) - (text\= + (text#= to)) (in (|>> valueI (_.wrap ))) - (and (text\= + (and (text#= from) - (text\= (reflection.reflection (type.reflection )) + (text#= (reflection.reflection (type.reflection )) to)) (in (|>> valueI (_.unwrap )))] @@ -735,8 +735,8 @@ (function (_ extension_name generate archive [class method outputT inputsTS]) (do [! phase.monad] [inputsTI (monad.each ! (generate_input generate archive) inputsTS)] - (in (|>> (_.fuse (list\each product.right inputsTI)) - (_.INVOKESTATIC class method (type.method [(list) (list\each product.left inputsTI) outputT (list)])) + (in (|>> (_.fuse (list#each product.right inputsTI)) + (_.INVOKESTATIC class method (type.method [(list) (list#each product.left inputsTI) outputT (list)])) (prepare_output outputT)))))])) (template [ ] @@ -750,10 +750,10 @@ inputsTI (monad.each ! (generate_input generate archive) inputsTS)] (in (|>> objectI (_.CHECKCAST class) - (_.fuse (list\each product.right inputsTI)) + (_.fuse (list#each product.right inputsTI)) ( class method (type.method [(list) - (list\each product.left inputsTI) + (list#each product.left inputsTI) outputT (list)])) (prepare_output outputT)))))]))] @@ -772,8 +772,8 @@ [inputsTI (monad.each ! (generate_input generate archive) inputsTS)] (in (|>> (_.NEW class) _.DUP - (_.fuse (list\each product.right inputsTI)) - (_.INVOKESPECIAL class "" (type.method [(list) (list\each product.left inputsTI) type.void (list)]))))))])) + (_.fuse (list#each product.right inputsTI)) + (_.INVOKESPECIAL class "" (type.method [(list) (list#each product.left inputsTI) type.void (list)]))))))])) (def: member_bundle Bundle @@ -886,12 +886,12 @@ [synthesis.#Access]) {synthesis.#Bit_Fork when then else} - {synthesis.#Bit_Fork when (recur then) (maybe\each recur else)} + {synthesis.#Bit_Fork when (recur then) (maybe#each recur else)} (^template [] [{ [[test then] elses]} { [[test (recur then)] - (list\each (function (_ [else_test else_then]) + (list#each (function (_ [else_test else_then]) [else_test (recur else_then)]) elses)]}]) ([synthesis.#I64_Fork] @@ -913,7 +913,7 @@ (synthesis.variant [lefts right? (recur sub)]) (^ (synthesis.tuple members)) - (synthesis.tuple (list\each recur members)) + (synthesis.tuple (list#each recur members)) (^ (synthesis.variable var)) (|> mapping @@ -934,13 +934,13 @@ (synthesis.branch/get [path (recur recordS)]) (^ (synthesis.loop/scope [offset initsS+ bodyS])) - (synthesis.loop/scope [offset (list\each recur initsS+) (recur bodyS)]) + (synthesis.loop/scope [offset (list#each recur initsS+) (recur bodyS)]) (^ (synthesis.loop/recur updatesS+)) - (synthesis.loop/recur (list\each recur updatesS+)) + (synthesis.loop/recur (list#each recur updatesS+)) (^ (synthesis.function/abstraction [environment arity bodyS])) - (synthesis.function/abstraction [(list\each (function (_ captured) + (synthesis.function/abstraction [(list#each (function (_ captured) (case captured (^ (synthesis.variable var)) (|> mapping @@ -955,10 +955,10 @@ bodyS]) (^ (synthesis.function/apply [functionS inputsS+])) - (synthesis.function/apply [(recur functionS) (list\each recur inputsS+)]) + (synthesis.function/apply [(recur functionS) (list#each recur inputsS+)]) {synthesis.#Extension [name inputsS+]} - {synthesis.#Extension [name (list\each recur inputsS+)]}))) + {synthesis.#Extension [name (list#each recur inputsS+)]}))) (def: $Object (type.class "java.lang.Object" (list))) @@ -975,15 +975,15 @@ (let [store_capturedI (|> env list.size list.indices - (list\each (.function (_ register) + (list#each (.function (_ register) (|>> (_.ALOAD 0) (_.ALOAD (++ register)) (_.PUTFIELD class (///reference.foreign_name register) $Object)))) _.fuse)] (_def.method #$.Public $.noneM "" (anonymous_init_method env) (|>> (_.ALOAD 0) - ((_.fuse (list\each product.right inputsTI))) - (_.INVOKESPECIAL super_class "" (type.method [(list) (list\each product.left inputsTI) type.void (list)])) + ((_.fuse (list#each product.right inputsTI))) + (_.INVOKESPECIAL super_class "" (type.method [(list) (list#each product.left inputsTI) type.void (list)])) store_capturedI _.RETURN)))) @@ -1013,7 +1013,7 @@ (_.wrap ) (_.ASTORE lux_register))]]] (`` (cond (~~ (template [ ] - [(\ type.equivalence = argumentT) + [(# type.equivalence = argumentT) (wrap_primitive )] [1 _.ILOAD type.boolean] @@ -1024,14 +1024,14 @@ [1 _.FLOAD type.float] [2 _.LLOAD type.long])) - ... (\ type.equivalence = type.double argumentT) + ... (# type.equivalence = type.double argumentT) (wrap_primitive 2 _.DLOAD type.double)))))) (def: .public (prepare_arguments offset types) (-> Nat (List (Type Value)) Inst) (|> types list.enumeration - (list\mix (function (_ [lux_register type] [jvm_register before]) + (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 (|>>)])) @@ -1059,7 +1059,7 @@ [(|>> (_.unwrap ) )]] (`` (cond (~~ (template [ ] - [(\ type.equivalence = returnT) + [(# type.equivalence = returnT) (unwrap_primitive )] [_.IRETURN type.boolean] @@ -1070,7 +1070,7 @@ [_.FRETURN type.float] [_.LRETURN type.long])) - ... (\ type.equivalence = type.double returnT) + ... (# type.equivalence = type.double returnT) (unwrap_primitive _.DRETURN type.double))))))) (def: class::anonymous @@ -1092,26 +1092,26 @@ class (type.class anonymous_class_name (list)) total_environment (|> overriden_methods ... Get all the environments. - (list\each product.left) + (list#each product.left) ... Combine them. - list\conjoint + list#conjoint ... Remove duplicates. (set.of_list synthesis.hash) set.list) global_mapping (|> total_environment ... Give them names as "foreign" variables. list.enumeration - (list\each (function (_ [id capture]) + (list#each (function (_ [id capture]) [capture {variable.#Foreign id}])) (dictionary.of_list synthesis.hash)) - normalized_methods (list\each (function (_ [environment + normalized_methods (list#each (function (_ [environment [ownerT name strict_fp? annotations vars self_name arguments returnT exceptionsT body]]) (let [local_mapping (|> environment list.enumeration - (list\each (function (_ [foreign_id capture]) + (list#each (function (_ [foreign_id capture]) [(synthesis.variable/foreign foreign_id) (|> global_mapping (dictionary.value capture) @@ -1131,7 +1131,7 @@ (do ! [bodyG (generation.with_context artifact_id (generate archive bodyS)) - .let [argumentsT (list\each product.right arguments)]] + .let [argumentsT (list#each product.right arguments)]] (in (_def.method #$.Public (if strict_fp? ($_ $.++M $.finalM $.strictM) @@ -1141,7 +1141,7 @@ (|>> (prepare_arguments 1 argumentsT) bodyG (returnI returnT))))))) - (\ ! each _def.fuse)) + (# ! each _def.fuse)) .let [directive [anonymous_class_name (_def.class #$.V1_6 #$.Public $.finalC anonymous_class_name (list) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/reference.lux b/lux-jvm/source/luxc/lang/translation/jvm/reference.lux index 1c1beda17..aebd84a60 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/reference.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/reference.lux @@ -39,7 +39,7 @@ (def: (foreign archive variable) (-> Archive Register (Operation Inst)) (do [@ phase.monad] - [class_name (\ @ each //.class_name + [class_name (# @ each //.class_name (generation.context archive))] (in (|>> (_.ALOAD 0) (_.GETFIELD (type.class class_name (list)) @@ -62,6 +62,6 @@ (def: .public (constant archive name) (-> Archive Name (Operation Inst)) (do [@ phase.monad] - [class_name (\ @ each //.class_name + [class_name (# @ each //.class_name (generation.remember archive name))] (in (_.GETSTATIC (type.class class_name (list)) //.value_field //.$Value)))) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/structure.lux b/lux-jvm/source/luxc/lang/translation/jvm/structure.lux index e1c0c9f5f..3f113e83d 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/structure.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/structure.lux @@ -57,7 +57,7 @@ (_.int (.int idx)) memberI _.AASTORE))))) - (\ @ each _.fuse))] + (# @ each _.fuse))] (in (|>> (_.int (.int size)) (_.array //runtime.$Value) membersI)))) -- cgit v1.2.3