diff options
author | Eduardo Julian | 2021-07-30 01:12:05 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-07-30 01:12:05 -0400 |
commit | 9f039e8a0a09e0278547d697efa018cd3fd68672 (patch) | |
tree | 0b2298edfae39efa7195fc5152d267cc25dd7fc1 /stdlib/source/library/lux/tool/compiler | |
parent | 54b28c1caeda08965c258411a32229be1766d47f (diff) |
More renamings.
Diffstat (limited to 'stdlib/source/library/lux/tool/compiler')
30 files changed, 128 insertions, 128 deletions
diff --git a/stdlib/source/library/lux/tool/compiler/default/platform.lux b/stdlib/source/library/lux/tool/compiler/default/platform.lux index cde736979..c5f2cfb8e 100644 --- a/stdlib/source/library/lux/tool/compiler/default/platform.lux +++ b/stdlib/source/library/lux/tool/compiler/default/platform.lux @@ -319,7 +319,7 @@ (|> dependence lens (dictionary.get module) - (maybe.default ..empty)))) + (maybe.else ..empty)))) transitive_depends_on (transitive_dependency (get@ #depends_on) import) transitive_depended_by (transitive_dependency (get@ #depended_by) module) update_dependence (: (-> [Module (Set Module)] [Module (Set Module)] @@ -351,7 +351,7 @@ (let [targets (|> dependence relationship (dictionary.get from) - (maybe.default ..empty))] + (maybe.else ..empty))] (set.member? targets to))))] (or (dependence? import (get@ #depends_on) module) (dependence? module (get@ #depended_by) import)))) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux index e48d2b1f8..291cf89c2 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux @@ -194,8 +194,8 @@ (.case inputT' (#.Product _) (let [subs (type.flat_tuple inputT') - num_subs (maybe.default (list.size subs) - num_tags) + num_subs (maybe.else (list.size subs) + num_tags) num_sub_patterns (list.size sub_patterns) matches (cond (n.< num_subs num_sub_patterns) (let [[prefix suffix] (list.split (dec num_sub_patterns) subs)] @@ -253,7 +253,7 @@ (#.Sum _) (let [flat_sum (type.flat_variant inputT') size_sum (list.size flat_sum) - num_cases (maybe.default size_sum num_tags) + num_cases (maybe.else size_sum num_tags) idx (/.tag lefts right?)] (.case (list.nth idx flat_sum) (^multi (#.Some caseT) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux index 99e1730f1..3760c86cc 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux @@ -29,7 +29,7 @@ (def: cases (-> (Maybe Nat) Nat) - (|>> (maybe.default 0))) + (|>> (maybe.else 0))) (def: known_cases? (-> Nat Bit) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux index 863975408..31ce0998c 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux @@ -85,8 +85,8 @@ (#.Right [state #.None]) (#.Item top_outer _) - (let [[ref_type init_ref] (maybe.default (undefined) - (..reference name top_outer)) + (let [[ref_type init_ref] (maybe.else (undefined) + (..reference name top_outer)) [ref inner'] (list\fold (: (-> Scope [Variable (List Scope)] [Variable (List Scope)]) (function (_ scope ref+inner) [(#variable.Foreign (get@ [#.captured #.counter] scope)) @@ -169,7 +169,7 @@ state)]) (#try.Success [[bundle' state'] output]) (#try.Success [[bundle' (update@ #.scopes - (|>> list.tail (maybe.default (list))) + (|>> list.tail (maybe.else (list))) state')] output]) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux index b34743db7..3804bcec2 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux @@ -1117,7 +1117,7 @@ (#.Some name) (|> aliasing (dictionary.get name) - (maybe.default name) + (maybe.else name) jvm.var) #.None @@ -1147,7 +1147,7 @@ (#.Some name) (|> aliasing (dictionary.get name) - (maybe.default name) + (maybe.else name) jvm.var) #.None diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux index 4fd8d5842..602c40504 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux @@ -101,7 +101,7 @@ (/.install "or" (binary _.logior/2)) (/.install "xor" (binary _.logxor/2)) (/.install "left-shift" (binary _.ash/2)) - (/.install "right-shift" (binary (product.uncurry //runtime.i64//right_shift))) + (/.install "right-shift" (binary (product.uncurry //runtime.i64//right_shifted))) (/.install "=" (binary _.=/2)) (/.install "<" (binary _.</2)) (/.install "+" (binary _.+/2)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux index e84d5cdf7..da9bbc7f8 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux @@ -52,8 +52,8 @@ (Binary Expression) (<op> subjectG (//runtime.i64//to_number paramG)))] - [i64//left_shift //runtime.i64//left_shift] - [i64//right_shift //runtime.i64//right_shift] + [i64//left_shifted //runtime.i64//left_shifted] + [i64//right_shifted //runtime.i64//right_shifted] ) ## [[Numbers]] @@ -132,8 +132,8 @@ (/.install "and" (binary (product.uncurry //runtime.i64//and))) (/.install "or" (binary (product.uncurry //runtime.i64//or))) (/.install "xor" (binary (product.uncurry //runtime.i64//xor))) - (/.install "left-shift" (binary i64//left_shift)) - (/.install "right-shift" (binary i64//right_shift)) + (/.install "left-shift" (binary i64//left_shifted)) + (/.install "right-shift" (binary i64//right_shifted)) (/.install "=" (binary (product.uncurry //runtime.i64//=))) (/.install "<" (binary (product.uncurry //runtime.i64//<))) (/.install "+" (binary (product.uncurry //runtime.i64//+))) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux index eed3eb6ce..354537c19 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux @@ -182,8 +182,8 @@ shiftG ..jvm_int <op> (///value.wrap type.long)))] - [i64::left_shift _.lshl] - [i64::right_shift _.lushr] + [i64::left_shifted _.lshl] + [i64::right_shifted _.lushr] ) (template [<name> <type> <op>] @@ -272,8 +272,8 @@ (/////bundle.install "and" (binary ..i64::and)) (/////bundle.install "or" (binary ..i64::or)) (/////bundle.install "xor" (binary ..i64::xor)) - (/////bundle.install "left-shift" (binary ..i64::left_shift)) - (/////bundle.install "right-shift" (binary ..i64::right_shift)) + (/////bundle.install "left-shift" (binary ..i64::left_shifted)) + (/////bundle.install "right-shift" (binary ..i64::right_shifted)) (/////bundle.install "=" (binary ..i64::=)) (/////bundle.install "<" (binary ..i64::<)) (/////bundle.install "+" (binary ..i64::+)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux index 9827c2480..58ac1efc1 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux @@ -889,7 +889,7 @@ (^ (//////synthesis.variable var)) (|> mapping (dictionary.get var) - (maybe.default var) + (maybe.else var) //////synthesis.variable) (^ (//////synthesis.branch/case [inputS pathS])) @@ -916,7 +916,7 @@ (^ (//////synthesis.variable local)) (|> mapping (dictionary.get local) - (maybe.default local) + (maybe.else local) //////synthesis.variable) _ diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux index 519ed6563..3925bec4b 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux @@ -105,7 +105,7 @@ (/.install "try" (unary //runtime.lux//try)) )) -(def: (left_shift [parameter subject]) +(def: (left_shifted [parameter subject]) (Binary Expression) (_.bit_shl (_.% (_.int +64) parameter) subject)) @@ -116,8 +116,8 @@ (/.install "and" (binary (product.uncurry _.bit_and))) (/.install "or" (binary (product.uncurry _.bit_or))) (/.install "xor" (binary (product.uncurry _.bit_xor))) - (/.install "left-shift" (binary ..left_shift)) - (/.install "right-shift" (binary (product.uncurry //runtime.i64//right_shift))) + (/.install "left-shift" (binary ..left_shifted)) + (/.install "right-shift" (binary (product.uncurry //runtime.i64//right_shifted))) (/.install "=" (binary (product.uncurry _.==))) (/.install "<" (binary (product.uncurry _.<))) (/.install "+" (binary (product.uncurry //runtime.i64//+))) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/extension/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/extension/common.lux index 1853971a6..ee472fe92 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/extension/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/extension/common.lux @@ -29,18 +29,18 @@ (bundle.install "is" (binary (product.uncurry _.eq))) (bundle.install "try" (unary ///runtime.lux//try)))) -(def: (i64//left_shift [paramG subjectG]) +(def: (i64//left_shifted [paramG subjectG]) (Binary (Expression Any)) (_.ash (_.rem (_.int +64) paramG) subjectG)) -(def: (i64//arithmetic_right_shift [paramG subjectG]) +(def: (i64//arithmetic_right_shifted [paramG subjectG]) (Binary (Expression Any)) (_.ash (|> paramG (_.rem (_.int +64)) (_.* (_.int -1))) subjectG)) -(def: (i64//logic_right_shift [paramG subjectG]) +(def: (i64//logic_right_shifted [paramG subjectG]) (Binary (Expression Any)) - (///runtime.i64//logic_right_shift (_.rem (_.int +64) paramG) subjectG)) + (///runtime.i64//logic_right_shifted (_.rem (_.int +64) paramG) subjectG)) (def: i64_procs Bundle @@ -49,9 +49,9 @@ (bundle.install "and" (binary (product.uncurry _.logand))) (bundle.install "or" (binary (product.uncurry _.logior))) (bundle.install "xor" (binary (product.uncurry _.logxor))) - (bundle.install "left-shift" (binary i64//left_shift)) - (bundle.install "logical-right-shift" (binary i64//logic_right_shift)) - (bundle.install "arithmetic-right-shift" (binary i64//arithmetic_right_shift)) + (bundle.install "left-shift" (binary i64//left_shifted)) + (bundle.install "logical-right-shift" (binary i64//logic_right_shifted)) + (bundle.install "arithmetic-right-shift" (binary i64//arithmetic_right_shifted)) (bundle.install "=" (binary (product.uncurry _.=))) (bundle.install "<" (binary (product.uncurry _.<))) (bundle.install "+" (binary (product.uncurry _.+))) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux index fd0e7a780..6b390352b 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux @@ -226,7 +226,7 @@ @tuple//right @sum//get)) -(runtime: (i64//right_shift shift input) +(runtime: (i64//right_shifted shift input) (_.if (_.=/2 [(_.int +0) shift]) input (let [anti_shift (_.-/2 [shift (_.int +64)]) @@ -239,7 +239,7 @@ (def: runtime//i64 (List (Expression Any)) - (list @i64//right_shift)) + (list @i64//right_shifted)) (runtime: (text//clip offset length text) (_.subseq/3 [text offset (_.+/2 [offset length])])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux index 506a957c7..94fe61c3e 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux @@ -64,11 +64,11 @@ (def: #export high (-> (I64 Any) (I64 Any)) - (i64.right_shift 32)) + (i64.right_shifted 32)) (def: #export low (-> (I64 Any) (I64 Any)) - (let [mask (dec (i64.left_shift 32 1))] + (let [mask (dec (i64.left_shifted 32 1))] (|>> (i64.and mask)))) (def: #export unit @@ -416,7 +416,7 @@ (-> Var Expression) (|>> (_.< (_.i32 +32)))) -(runtime: (i64//left_shift input shift) +(runtime: (i64//left_shifted input shift) ($_ _.then (..cap_shift! shift) (_.return (<| (..no_shift! shift input) @@ -429,7 +429,7 @@ (..i64 high (_.i32 +0))))) )) -(runtime: (i64//arithmetic_right_shift input shift) +(runtime: (i64//arithmetic_right_shifted input shift) ($_ _.then (..cap_shift! shift) (_.return (<| (..no_shift! shift input) @@ -444,7 +444,7 @@ low (|> input (_.the ..i64_high_field) (_.arithmetic_right_shift (_.- (_.i32 +32) shift)))] (..i64 high low)))))) -(runtime: (i64//right_shift input shift) +(runtime: (i64//right_shifted input shift) ($_ _.then (..cap_shift! shift) (_.return (<| (..no_shift! shift input) @@ -465,9 +465,9 @@ @i64//or @i64//xor @i64//not - @i64//left_shift - @i64//arithmetic_right_shift - @i64//right_shift + @i64//left_shifted + @i64//arithmetic_right_shifted + @i64//right_shifted )) (runtime: (i64//- parameter subject) @@ -557,11 +557,11 @@ [(i64//= i64//min parameter) (_.return i64//one)]) (with_vars [approximation] - (let [subject/2 (..i64//arithmetic_right_shift subject (_.i32 +1))] + (let [subject/2 (..i64//arithmetic_right_shifted subject (_.i32 +1))] ($_ _.then - (_.define approximation (i64//left_shift (i64/// parameter - subject/2) - (_.i32 +1))) + (_.define approximation (i64//left_shifted (i64/// parameter + subject/2) + (_.i32 +1))) (_.if (i64//= i64//zero approximation) (_.return (_.? (negative? parameter) i64//one diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux index 86a980c95..80315db66 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux @@ -608,4 +608,4 @@ ## This shift is done to avoid the possibility of forged labels ## to be in the range of the labels that are generated automatically ## during the evaluation of Bytecode expressions. - (\ ////.monad map (i64.left_shift shift) generation.next))) + (\ ////.monad map (i64.left_shifted shift) generation.next))) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux index 3c9054abf..b51cd2930 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux @@ -65,7 +65,7 @@ (//////phase\map _.return (/function.function statement expression archive abstraction)) )) -(exception: #export cannot-recur-as-an-expression) +(exception: #export cannot_recur_as_an_expression) (def: (expression archive synthesis) Phase @@ -103,7 +103,7 @@ (/loop.scope ..statement expression archive scope) (^ (synthesis.loop/recur updates)) - (//////phase.except ..cannot-recur-as-an-expression []) + (//////phase.except ..cannot_recur_as_an_expression []) (^ (synthesis.function/abstraction abstraction)) (/function.function ..statement expression archive abstraction) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux index 1565f7c0e..7d92f48d3 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux @@ -260,10 +260,10 @@ (def: cap_shift (_.% (_.int +64))) -(runtime: (i64//left_shift param subject) +(runtime: (i64//left_shifted param subject) (_.return (_.bit_shl (..cap_shift param) subject))) -(runtime: (i64//right_shift param subject) +(runtime: (i64//right_shifted param subject) (let [mask (|> (_.int +1) (_.bit_shl (_.- param (_.int +64))) (_.- (_.int +1)))] @@ -294,8 +294,8 @@ (def: runtime//i64 Statement ($_ _.then - @i64//left_shift - @i64//right_shift + @i64//left_shifted + @i64//right_shifted @i64//division @i64//remainder )) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux index 9729815b6..6c08b4ed0 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux @@ -338,14 +338,14 @@ (def: #export high (-> (I64 Any) (I64 Any)) - (i64.right_shift 32)) + (i64.right_shifted 32)) (def: #export low (-> (I64 Any) (I64 Any)) - (let [mask (dec (i64.left_shift 32 1))] + (let [mask (dec (i64.left_shifted 32 1))] (|>> (i64.and mask)))) -(runtime: (i64//right_shift param subject) +(runtime: (i64//right_shifted param subject) (let [## The mask has to be calculated this way instead of in a more straightforward way ## because in some languages, 1<<63 = max_negative_value ## and max_negative_value-1 = max_positive_value. @@ -376,13 +376,13 @@ _.iconv/3)))) (runtime: (i64//+ parameter subject) - (let [high_16 (..i64//right_shift (_.int +16)) + (let [high_16 (..i64//right_shifted (_.int +16)) low_16 (_.bit_and (_.int (.int (hex "FFFF")))) cap_16 low_16 - hh (..i64//right_shift (_.int +48)) - hl (|>> (..i64//right_shift (_.int +32)) cap_16) - lh (|>> (..i64//right_shift (_.int +16)) cap_16) + hh (..i64//right_shifted (_.int +48)) + hl (|>> (..i64//right_shifted (_.int +32)) cap_16) + lh (|>> (..i64//right_shifted (_.int +16)) cap_16) ll cap_16 up_16 (_.bit_shl (_.int +16))] @@ -435,13 +435,13 @@ (_.return (..i64//+ (..i64//negate parameter) subject))) (runtime: (i64//* parameter subject) - (let [high_16 (..i64//right_shift (_.int +16)) + (let [high_16 (..i64//right_shifted (_.int +16)) low_16 (_.bit_and (_.int (.int (hex "FFFF")))) cap_16 low_16 - hh (..i64//right_shift (_.int +48)) - hl (|>> (..i64//right_shift (_.int +32)) cap_16) - lh (|>> (..i64//right_shift (_.int +16)) cap_16) + hh (..i64//right_shifted (_.int +48)) + hl (|>> (..i64//right_shifted (_.int +32)) cap_16) + lh (|>> (..i64//right_shifted (_.int +16)) cap_16) ll cap_16 up_16 (_.bit_shl (_.int +16))] @@ -492,7 +492,7 @@ (def: runtime//i64 Statement ($_ _.then - @i64//right_shift + @i64//right_shifted @i64//char @i64//+ @i64//negate diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux index 440f208ba..44ea19376 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux @@ -298,12 +298,12 @@ (def: as_nat (_.% ..i64::+iteration)) -(runtime: (i64::left_shift param subject) +(runtime: (i64::left_shifted param subject) (_.return (|> subject (_.bit_shl (_.% (_.int +64) param)) ..i64::64))) -(runtime: (i64::right_shift param subject) +(runtime: (i64::right_shifted param subject) ($_ _.then (_.set (list param) (_.% (_.int +64) param)) (_.return (_.? (_.= (_.int +0) param) @@ -354,8 +354,8 @@ (Statement Any) ($_ _.then @i64::64 - @i64::left_shift - @i64::right_shift + @i64::left_shifted + @i64::right_shifted @i64::division @i64::remainder @i64::and diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux index 225d32a81..b650c7e8d 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux @@ -163,9 +163,9 @@ Binary (<op> (runtimeT.int64_low paramO) subjectO))] - [bit//left_shift runtimeT.bit//left_shift] - [bit//arithmetic_right_shift runtimeT.bit//arithmetic_right_shift] - [bit//logical_right_shift runtimeT.bit//logical_right_shift] + [bit//left_shifted runtimeT.bit//left_shifted] + [bit//arithmetic_right_shifted runtimeT.bit//arithmetic_right_shifted] + [bit//logical_right_shifted runtimeT.bit//logical_right_shifted] ) (def: bit_procs @@ -175,9 +175,9 @@ (install "and" (binary bit//and)) (install "or" (binary bit//or)) (install "xor" (binary bit//xor)) - (install "left-shift" (binary bit//left_shift)) - (install "logical-right-shift" (binary bit//logical_right_shift)) - (install "arithmetic-right-shift" (binary bit//arithmetic_right_shift)) + (install "left-shift" (binary bit//left_shifted)) + (install "logical-right-shift" (binary bit//logical_right_shifted)) + (install "arithmetic-right-shift" (binary bit//arithmetic_right_shifted)) ))) ## [[Numbers]] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux index 06ae68255..dba43659e 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux @@ -199,7 +199,7 @@ (def: high_32 (-> Nat Nat) - (i64.right_shift 32)) + (i64.right_shifted 32)) (def: low_32 (-> Nat Nat) @@ -214,7 +214,7 @@ (def: #export (lux_i64 high low) (-> Int Int Int) (|> high - (i64.left_shift 32) + (i64.left_shifted 32) (i64.or low))) (template [<name> <value>] @@ -387,7 +387,7 @@ [(|> shift (_.= (_.int +0))) input]) -(runtime: (i64::left_shift shift input) +(runtime: (i64::left_shifted shift input) ($_ _.then (limit_shift! shift) (_.cond (list (no_shift_clause shift input) @@ -403,26 +403,26 @@ (_.bit_shl (|> shift (_.- (_.int +32)))))] (i64::new high (_.int +0)))))) -(runtime: (i64::arithmetic_right_shift_32 shift input) +(runtime: (i64::arithmetic_right_shifted_32 shift input) (let [top_bit (|> input (_.bit_and (_.as::integer (_.int (hex "+80000000")))))] (|> input (_.bit_ushr shift) (_.bit_or top_bit)))) -(runtime: (i64::arithmetic_right_shift shift input) +(runtime: (i64::arithmetic_right_shifted shift input) ($_ _.then (limit_shift! shift) (_.cond (list (no_shift_clause shift input) [(|> shift (_.< (_.int +32))) (let [mid (|> (i64_high input) (_.bit_shl (|> (_.int +32) (_.- shift)))) high (|> (i64_high input) - (i64::arithmetic_right_shift_32 shift)) + (i64::arithmetic_right_shifted_32 shift)) low (|> (i64_low input) (_.bit_ushr shift) (_.bit_or mid))] (i64::new high low))]) (let [low (|> (i64_high input) - (i64::arithmetic_right_shift_32 (|> shift (_.- (_.int +32))))) + (i64::arithmetic_right_shifted_32 (|> shift (_.- (_.int +32))))) high (_.if (|> (i64_high input) (_.>= (_.int +0))) (_.int +0) (_.int -1))] @@ -447,9 +447,9 @@ ($_ _.then (_.set! approximation (|> subject - (i64::arithmetic_right_shift (_.int +1)) + (i64::arithmetic_right_shifted (_.int +1)) (i64::/ param) - (i64::left_shift (_.int +1)))) + (i64::left_shifted (_.int +1)))) (_.if (|> approximation (i64::= i64::zero)) (_.if (negative? param) i64::one @@ -647,7 +647,7 @@ [i64::xor _.bit_xor] ) -(runtime: (i64::right_shift shift input) +(runtime: (i64::right_shifted shift input) ($_ _.then (limit_shift! shift) (_.cond (list (no_shift_clause shift input) @@ -682,10 +682,10 @@ @i64::or @i64::xor @i64::not - @i64::left_shift - @i64::arithmetic_right_shift_32 - @i64::arithmetic_right_shift - @i64::right_shift + @i64::left_shifted + @i64::arithmetic_right_shifted_32 + @i64::arithmetic_right_shifted + @i64::right_shifted @i64::zero @i64::one diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux index 1a19be4a3..1ab1ab616 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux @@ -275,12 +275,12 @@ (def: as_nat (_.% (_.manual "0x10000000000000000"))) -(runtime: (i64//left_shift param subject) +(runtime: (i64//left_shifted param subject) (_.return (|> subject (_.bit_shl (_.% (_.int +64) param)) ..i64//64))) -(runtime: (i64//right_shift param subject) +(runtime: (i64//right_shifted param subject) ($_ _.then (_.set (list param) (_.% (_.int +64) param)) (_.return (_.? (_.= (_.int +0) param) @@ -309,8 +309,8 @@ ($_ _.then @i64//64 @i64//nat_top - @i64//left_shift - @i64//right_shift + @i64//left_shifted + @i64//right_shifted @i64//and @i64//or @i64//xor diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux index 9d9c62b18..79d8950ce 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux @@ -183,7 +183,7 @@ [/////synthesis.side/right true inc]) (^ (/////synthesis.member/left 0)) - (///////phase\in (..push_cursor! (_.vector-ref/2 ..peek (_.int +0)))) + (///////phase\in (..push_cursor! (_.vector_ref/2 ..peek (_.int +0)))) (^template [<pm> <getter>] [(^ (<pm> lefts)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux index 6b976b9b6..a3a598808 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux @@ -39,23 +39,23 @@ (syntax: (arity: {name s.local_identifier} {arity s.nat}) (with_gensyms [g!_ g!extension g!name g!phase g!inputs] - (do {! macro.monad} - [g!input+ (monad.seq ! (list.repeat arity (macro.gensym "input")))] - (in (list (` (def: #export ((~ (code.local_identifier name)) (~ g!extension)) - (-> (-> (..Vector (~ (code.nat arity)) Expression) Computation) - Handler) - (function ((~ g!_) (~ g!name) (~ g!phase) (~ g!inputs)) - (case (~ g!inputs) - (^ (list (~+ g!input+))) - (do /////.monad - [(~+ (|> g!input+ - (list\map (function (_ g!input) - (list g!input (` ((~ g!phase) (~ g!input)))))) - list.concat))] - ((~' in) ((~ g!extension) [(~+ g!input+)]))) - - (~' _) - (/////.except /////extension.incorrect_arity [(~ g!name) 1 (list.size (~ g!inputs))])))))))))) + (do {! macro.monad} + [g!input+ (monad.seq ! (list.repeat arity (macro.gensym "input")))] + (in (list (` (def: #export ((~ (code.local_identifier name)) (~ g!extension)) + (-> (-> (..Vector (~ (code.nat arity)) Expression) Computation) + Handler) + (function ((~ g!_) (~ g!name) (~ g!phase) (~ g!inputs)) + (case (~ g!inputs) + (^ (list (~+ g!input+))) + (do /////.monad + [(~+ (|> g!input+ + (list\map (function (_ g!input) + (list g!input (` ((~ g!phase) (~ g!input)))))) + list.concat))] + ((~' in) ((~ g!extension) [(~+ g!input+)]))) + + (~' _) + (/////.except /////extension.incorrect_arity [(~ g!name) 1 (list.size (~ g!inputs))])))))))))) (arity: nullary 0) (arity: unary 1) @@ -86,19 +86,19 @@ [i64::xor _.bit_xor/2] ) -(def: (i64::left_shift [subjectO paramO]) +(def: (i64::left_shifted [subjectO paramO]) Binary (_.arithmetic_shift/2 (_.remainder/2 (_.int +64) paramO) subjectO)) -(def: (i64::arithmetic_right_shift [subjectO paramO]) +(def: (i64::arithmetic_right_shifted [subjectO paramO]) Binary (_.arithmetic_shift/2 (|> paramO (_.remainder/2 (_.int +64)) (_.*/2 (_.int -1))) subjectO)) -(def: (i64::logical_right_shift [subjectO paramO]) +(def: (i64::logical_right_shifted [subjectO paramO]) Binary - (///runtime.i64//logical_right_shift (_.remainder/2 (_.int +64) paramO) subjectO)) + (///runtime.i64//logical_right_shifted (_.remainder/2 (_.int +64) paramO) subjectO)) (template [<name> <op>] [(def: (<name> [subjectO paramO]) @@ -147,9 +147,9 @@ (bundle.install "and" (binary i64::and)) (bundle.install "or" (binary i64::or)) (bundle.install "xor" (binary i64::xor)) - (bundle.install "left-shift" (binary i64::left_shift)) - (bundle.install "logical-right-shift" (binary i64::logical_right_shift)) - (bundle.install "arithmetic-right-shift" (binary i64::arithmetic_right_shift)) + (bundle.install "left-shift" (binary i64::left_shifted)) + (bundle.install "logical-right-shift" (binary i64::logical_right_shifted)) + (bundle.install "arithmetic-right-shift" (binary i64::arithmetic_right_shifted)) (bundle.install "+" (binary i64::+)) (bundle.install "-" (binary i64::-)) (bundle.install "*" (binary i64::*)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux index 140b72106..2e5c8d495 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux @@ -265,7 +265,7 @@ )) input)))) -(runtime: (i64//left_shift param subject) +(runtime: (i64//left_shifted param subject) (|> subject (_.arithmetic_shift/2 (_.remainder/2 (_.int +64) param)) ..i64//64)) @@ -273,7 +273,7 @@ (def: as_nat (_.remainder/2 ..i64//+iteration)) -(runtime: (i64//right_shift shift subject) +(runtime: (i64//right_shifted shift subject) (_.let (list [shift (_.remainder/2 (_.int +64) shift)]) (_.if (_.=/2 (_.int +0) shift) subject @@ -296,8 +296,8 @@ (def: runtime//i64 Computation (_.begin (list @i64//64 - @i64//left_shift - @i64//right_shift + @i64//left_shifted + @i64//right_shifted @i64//or @i64//xor @i64//and diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux index 10a5c6eec..4dc984bae 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux @@ -72,7 +72,7 @@ _ (/.loop/scope [start inits iteration]))))) - (maybe.default <apply>)))) + (maybe.else <apply>)))) (in <apply>)) (^ (/.function/apply [funcS' argsS'])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux index 956c59cd6..80d3eb556 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux @@ -369,7 +369,7 @@ [redundancy output] (optimization' [redundancy output]) #let [redundant? (|> redundancy (dictionary.get register) - (maybe.default ..necessary!))]] + (maybe.else ..necessary!))]] (in [(dictionary.remove register redundancy) (#/.Control (if redundant? (#/.Branch (#/.Case input diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux b/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux index e304e237c..a54350ccf 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux @@ -469,7 +469,7 @@ (!failure ..full_name_parser where offset source_code)) (#.Right [source'' [(|> aliases (dictionary.get simple) - (maybe.default simple)) + (maybe.else simple)) complex]]))) <simple>))))) diff --git a/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux b/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux index 37e5f7cfa..c51151b68 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux @@ -76,7 +76,7 @@ (-> Graph Module Module Bit) (let [target_ancestry (|> ancestry (dictionary.get target) - (maybe.default ..fresh))] + (maybe.else ..fresh))] (set.member? target_ancestry source))) (type: #export Order diff --git a/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux b/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux index 6a25f1094..b1735f389 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux @@ -142,7 +142,7 @@ (Try java/util/jar/JarOutputStream)) (let [class_path (|> custom (maybe\map (|>> name.internal name.read)) - (maybe.default (runtime.class_name [module artifact])) + (maybe.else (runtime.class_name [module artifact])) (text.suffix (get@ #static.artifact_extension static)))] (do try.monad [_ (java/util/jar/JarOutputStream::putNextEntry (java/util/jar/JarEntry::new class_path) sink)] diff --git a/stdlib/source/library/lux/tool/compiler/phase.lux b/stdlib/source/library/lux/tool/compiler/phase.lux index 845ba3dba..0554592a0 100644 --- a/stdlib/source/library/lux/tool/compiler/phase.lux +++ b/stdlib/source/library/lux/tool/compiler/phase.lux @@ -25,7 +25,7 @@ [archive (#+ Archive)]]]) (type: #export (Operation s o) - (state.State' Try s o)) + (state.+State Try s o)) (def: #export monad (All [s] (Monad (Operation s))) |