From dbb658bd7976c073a2bf314f194b36b30c45784b Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 26 Nov 2020 19:37:11 -0400 Subject: Allow name formatting for JVM imports, similar to Lux module imports. --- stdlib/source/lux/control/concurrency/atom.lux | 22 ++-- stdlib/source/lux/control/concurrency/thread.lux | 118 +++++++++------------ stdlib/source/lux/data/binary.lux | 8 +- stdlib/source/lux/data/text/encoding.lux | 5 +- stdlib/source/lux/debug.lux | 23 ++-- stdlib/source/lux/host.old.lux | 77 +++++++++----- stdlib/source/lux/target/jvm/bytecode.lux | 6 +- stdlib/source/lux/target/jvm/constant.lux | 6 +- stdlib/source/lux/target/jvm/loader.lux | 20 ++-- .../lux/tool/compiler/language/lux/directive.lux | 6 +- .../language/lux/phase/generation/common-lisp.lux | 4 +- .../lux/phase/generation/common-lisp/case.lux | 20 ++-- .../lux/phase/generation/common-lisp/function.lux | 6 +- .../lux/phase/generation/common-lisp/loop.lux | 4 +- .../lux/phase/generation/common-lisp/runtime.lux | 23 ++-- .../language/lux/phase/generation/js/case.lux | 18 ++-- .../language/lux/phase/generation/js/function.lux | 8 +- .../language/lux/phase/generation/js/loop.lux | 10 +- .../language/lux/phase/generation/js/runtime.lux | 15 +-- .../language/lux/phase/generation/js/structure.lux | 6 +- .../language/lux/phase/generation/jvm/case.lux | 18 ++-- .../language/lux/phase/generation/jvm/function.lux | 12 +-- .../generation/jvm/function/field/constant.lux | 4 +- .../generation/jvm/function/field/variable.lux | 8 +- .../jvm/function/field/variable/foreign.lux | 2 +- .../jvm/function/field/variable/partial.lux | 8 +- .../lux/phase/generation/jvm/function/method.lux | 4 +- .../phase/generation/jvm/function/method/apply.lux | 18 ++-- .../phase/generation/jvm/function/method/init.lux | 6 +- .../phase/generation/jvm/function/method/new.lux | 3 +- .../phase/generation/jvm/function/method/reset.lux | 4 +- .../language/lux/phase/generation/jvm/loop.lux | 14 +-- .../language/lux/phase/generation/jvm/program.lux | 6 +- .../language/lux/phase/generation/jvm/runtime.lux | 16 +-- .../language/lux/phase/generation/jvm/value.lux | 4 +- .../compiler/language/lux/phase/generation/lua.lux | 8 +- .../language/lux/phase/generation/php/case.lux | 26 ++--- .../language/lux/phase/generation/php/function.lux | 4 +- .../language/lux/phase/generation/php/loop.lux | 4 +- .../language/lux/phase/generation/php/runtime.lux | 19 ++-- .../language/lux/phase/generation/python/case.lux | 30 +++--- .../lux/phase/generation/python/function.lux | 6 +- .../language/lux/phase/generation/python/loop.lux | 4 +- .../lux/phase/generation/python/runtime.lux | 26 +++-- .../lux/phase/generation/python/structure.lux | 8 +- .../language/lux/phase/generation/reference.lux | 6 +- stdlib/source/lux/world/console.lux | 16 +-- stdlib/source/lux/world/environment.lux | 81 ++++++++------ stdlib/source/lux/world/file.lux | 52 +++++---- stdlib/source/lux/world/shell.lux | 41 ++++--- stdlib/source/program/aedifex/command/auto.lux | 40 ++++--- stdlib/source/program/aedifex/command/build.lux | 3 +- stdlib/source/program/aedifex/hash.lux | 5 +- stdlib/source/program/aedifex/repository.lux | 38 ++++--- stdlib/source/program/aedifex/shell.lux | 23 ++-- stdlib/source/test/lux/abstract/codec.lux | 4 +- stdlib/source/test/lux/abstract/comonad/cofree.lux | 6 +- stdlib/source/test/lux/abstract/enum.lux | 10 +- stdlib/source/test/lux/abstract/equivalence.lux | 20 ++-- stdlib/source/test/lux/abstract/interval.lux | 8 +- stdlib/source/test/lux/abstract/monad.lux | 10 +- stdlib/source/test/lux/abstract/monad/free.lux | 4 +- stdlib/source/test/lux/abstract/order.lux | 14 +-- stdlib/source/test/lux/abstract/predicate.lux | 20 ++-- stdlib/source/test/lux/control/exception.lux | 8 +- stdlib/source/test/lux/control/parser.lux | 57 +++++----- stdlib/source/test/lux/control/parser/analysis.lux | 14 +-- stdlib/source/test/lux/control/parser/binary.lux | 49 +++++---- stdlib/source/test/lux/control/parser/cli.lux | 22 ++-- stdlib/source/test/lux/control/parser/code.lux | 4 +- stdlib/source/test/lux/control/parser/json.lux | 8 +- .../source/test/lux/control/parser/synthesis.lux | 45 +++++--- stdlib/source/test/lux/control/parser/text.lux | 32 +++--- stdlib/source/test/lux/control/parser/type.lux | 36 +++---- stdlib/source/test/lux/control/parser/xml.lux | 10 +- stdlib/source/test/lux/control/remember.lux | 6 +- stdlib/source/test/lux/control/writer.lux | 8 +- stdlib/source/test/lux/data.lux | 16 +-- .../test/lux/data/collection/set/ordered.lux | 14 +-- .../test/lux/data/collection/tree/finger.lux | 18 ++-- stdlib/source/test/lux/data/format/binary.lux | 35 ++++++ stdlib/source/test/lux/data/format/tar.lux | 26 ++--- stdlib/source/test/lux/data/format/xml.lux | 14 +-- stdlib/source/test/lux/data/identity.lux | 8 +- stdlib/source/test/lux/data/text/regex.lux | 12 +-- stdlib/source/test/lux/extension.lux | 4 +- stdlib/source/test/lux/host.old.lux | 13 ++- stdlib/source/test/lux/target/jvm.lux | 62 ++++++----- stdlib/source/test/lux/world.lux | 2 + stdlib/source/test/lux/world/environment.lux | 31 ++++++ stdlib/source/test/lux/world/file.lux | 6 +- 91 files changed, 907 insertions(+), 721 deletions(-) create mode 100644 stdlib/source/test/lux/data/format/binary.lux create mode 100644 stdlib/source/test/lux/world/environment.lux (limited to 'stdlib/source') diff --git a/stdlib/source/lux/control/concurrency/atom.lux b/stdlib/source/lux/control/concurrency/atom.lux index 54be96d76..04517cc3e 100644 --- a/stdlib/source/lux/control/concurrency/atom.lux +++ b/stdlib/source/lux/control/concurrency/atom.lux @@ -13,19 +13,15 @@ [type abstract]]) -(for {@.old - (host.import: (java/util/concurrent/atomic/AtomicReference a) - (new [a]) - (get [] a) - (compareAndSet [a a] boolean)) - - @.jvm - (host.import: (java/util/concurrent/atomic/AtomicReference a) - (new [a]) - (get [] a) - (compareAndSet [a a] boolean))} - - (as-is)) +(with-expansions [ (as-is (host.import: (java/util/concurrent/atomic/AtomicReference a) + ["#::." + (new [a]) + (get [] a) + (compareAndSet [a a] boolean)]))] + (for {@.old + @.jvm } + + (as-is))) (abstract: #export (Atom a) (for {@.old diff --git a/stdlib/source/lux/control/concurrency/thread.lux b/stdlib/source/lux/control/concurrency/thread.lux index 55b635672..10ec17815 100644 --- a/stdlib/source/lux/control/concurrency/thread.lux +++ b/stdlib/source/lux/control/concurrency/thread.lux @@ -15,88 +15,66 @@ [// ["." atom (#+ Atom)]]) -(for {@.old - (as-is (host.import: java/lang/Object) - - (host.import: java/lang/Runtime - (#static getRuntime [] java/lang/Runtime) - (availableProcessors [] int)) - - (host.import: java/lang/Runnable) - - (host.import: java/util/concurrent/TimeUnit - (#enum MILLISECONDS)) - - (host.import: java/util/concurrent/Executor - (execute [java/lang/Runnable] #io void)) +(with-expansions [ (as-is (host.import: java/lang/Object) - (host.import: (java/util/concurrent/ScheduledFuture a)) - - (host.import: java/util/concurrent/ScheduledThreadPoolExecutor - (new [int]) - (schedule [java/lang/Runnable long java/util/concurrent/TimeUnit] #io (java/util/concurrent/ScheduledFuture java/lang/Object)))) - - @.jvm - (as-is (host.import: java/lang/Object) + (host.import: java/lang/Runtime + ["#::." + (#static getRuntime [] java/lang/Runtime) + (availableProcessors [] int)]) - (host.import: java/lang/Runtime - (#static getRuntime [] java/lang/Runtime) - (availableProcessors [] int)) + (host.import: java/lang/Runnable) - (host.import: java/lang/Runnable) + (host.import: java/util/concurrent/TimeUnit + ["#::." + (#enum MILLISECONDS)]) + + (host.import: java/util/concurrent/Executor + ["#::." + (execute [java/lang/Runnable] #io void)]) - (host.import: java/util/concurrent/TimeUnit - (#enum MILLISECONDS)) - - (host.import: java/util/concurrent/Executor - (execute [java/lang/Runnable] #io void)) + (host.import: (java/util/concurrent/ScheduledFuture a)) - (host.import: (java/util/concurrent/ScheduledFuture a)) + (host.import: java/util/concurrent/ScheduledThreadPoolExecutor + ["#::." + (new [int]) + (schedule [java/lang/Runnable long java/util/concurrent/TimeUnit] #io (java/util/concurrent/ScheduledFuture java/lang/Object))]))] + (for {@.old (as-is ) + @.jvm (as-is ) - (host.import: java/util/concurrent/ScheduledThreadPoolExecutor - (new [int]) - (schedule [java/lang/Runnable long java/util/concurrent/TimeUnit] #io (java/util/concurrent/ScheduledFuture java/lang/Object)))) - - @.js - (as-is (host.import: (setTimeout [host.Function host.Number] #io Any)))} - - ## Default - (type: Thread - {#creation Nat - #delay Nat - #action (IO Any)}) - ) + @.js + (as-is (host.import: (setTimeout [host.Function host.Number] #io Any)))} + + ## Default + (type: Thread + {#creation Nat + #delay Nat + #action (IO Any)}) + )) (def: #export parallelism Nat - (for {@.old - (|> (java/lang/Runtime::getRuntime) - (java/lang/Runtime::availableProcessors) - .nat) + (with-expansions [ (|> (java/lang/Runtime::getRuntime) + (java/lang/Runtime::availableProcessors) + .nat)] + (for {@.old + @.jvm } + + ## Default + 1))) + +(with-expansions [ (as-is (def: runner + java/util/concurrent/ScheduledThreadPoolExecutor + (java/util/concurrent/ScheduledThreadPoolExecutor::new (.int ..parallelism))))] + (for {@.old + @.jvm - @.jvm - (|> (java/lang/Runtime::getRuntime) - (java/lang/Runtime::availableProcessors) - .nat)} + @.js + (as-is)} ## Default - 1)) - -(for {@.old - (def: runner - (java/util/concurrent/ScheduledThreadPoolExecutor::new (.int ..parallelism))) - - @.jvm - (def: runner - (java/util/concurrent/ScheduledThreadPoolExecutor::new (.int ..parallelism))) - - @.js - (as-is)} - - ## Default - (def: runner - (Atom (List Thread)) - (atom.atom (list)))) + (def: runner + (Atom (List Thread)) + (atom.atom (list))))) (def: #export (schedule milli-seconds action) (-> Nat (IO Any) (IO Any)) diff --git a/stdlib/source/lux/data/binary.lux b/stdlib/source/lux/data/binary.lux index 2d4fb0f63..12c50328b 100644 --- a/stdlib/source/lux/data/binary.lux +++ b/stdlib/source/lux/data/binary.lux @@ -41,11 +41,13 @@ (host.import: java/lang/Object) (host.import: java/lang/System - (#static arraycopy [java/lang/Object int java/lang/Object int int] #try void)) + ["#::." + (#static arraycopy [java/lang/Object int java/lang/Object int int] #try void)]) (host.import: java/util/Arrays - (#static copyOfRange [[byte] int int] [byte]) - (#static equals [[byte] [byte]] boolean)) + ["#::." + (#static copyOfRange [[byte] int int] [byte]) + (#static equals [[byte] [byte]] boolean)]) (def: byte-mask I64 diff --git a/stdlib/source/lux/data/text/encoding.lux b/stdlib/source/lux/data/text/encoding.lux index 4d0da57cd..140acf270 100644 --- a/stdlib/source/lux/data/text/encoding.lux +++ b/stdlib/source/lux/data/text/encoding.lux @@ -170,8 +170,9 @@ ) (with-expansions [ (as-is (host.import: java/lang/String - (new [[byte] java/lang/String]) - (getBytes [java/lang/String] [byte])))] + ["#::." + (new [[byte] java/lang/String]) + (getBytes [java/lang/String] [byte])]))] (for {@.old (as-is ) diff --git a/stdlib/source/lux/debug.lux b/stdlib/source/lux/debug.lux index 5c7b31833..4ddcd18dd 100644 --- a/stdlib/source/lux/debug.lux +++ b/stdlib/source/lux/debug.lux @@ -31,23 +31,28 @@ (with-expansions [ (as-is (import: java/lang/String) (import: (java/lang/Class a) - (getCanonicalName [] java/lang/String)) + ["#::." + (getCanonicalName [] java/lang/String)]) (import: java/lang/Object - (new []) - (toString [] java/lang/String) - (getClass [] (java/lang/Class java/lang/Object))) + ["#::." + (new []) + (toString [] java/lang/String) + (getClass [] (java/lang/Class java/lang/Object))]) (import: java/lang/Integer - (longValue [] long)) + ["#::." + (longValue [] long)]) (import: java/lang/Long - (intValue [] int)) + ["#::." + (intValue [] int)]) (import: java/lang/Number - (intValue [] int) - (longValue [] long) - (doubleValue [] double)))] + ["#::." + (intValue [] int) + (longValue [] long) + (doubleValue [] double)]))] (for {@.old (as-is ) diff --git a/stdlib/source/lux/host.old.lux b/stdlib/source/lux/host.old.lux index 70819c754..896e5758d 100644 --- a/stdlib/source/lux/host.old.lux +++ b/stdlib/source/lux/host.old.lux @@ -931,6 +931,13 @@ #import-field-type gtype})))) )) +(def: bundle + (-> (List Type-Parameter) (Parser [Text (List Import-Member-Declaration)])) + (|>> ..import-member-decl^ + p.some + (p.and s.text) + s.tuple)) + ## Generators (def: with-parens (-> JVM-Code JVM-Code) @@ -1486,8 +1493,14 @@ (list.zip/2 classes) (list\map (auto-convert-input mode)))) -(def: (member-def-interop type-params kind class [arg-function-inputs arg-classes arg-types] member method-prefix) - (-> (List Type-Parameter) Class-Kind Class-Declaration [(List [Bit Code]) (List Text) (List Code)] Import-Member-Declaration Text (Meta (List Code))) +(def: (import-name format class member) + (-> Text Text Text Text) + (|> format + (text.replace-all "#" class) + (text.replace-all "." member))) + +(def: (member-def-interop type-params kind class [arg-function-inputs arg-classes arg-types] member method-prefix import-format) + (-> (List Type-Parameter) Class-Kind Class-Declaration [(List [Bit Code]) (List Text) (List Code)] Import-Member-Declaration Text Text (Meta (List Code))) (let [[full-name class-tvars] class full-name (sanitize full-name) all-params (|> (member-type-vars class-tvars member) @@ -1508,7 +1521,7 @@ (` (All [(~+ =class-tvars)] (primitive (~ (code.text full-name)) [(~+ =class-tvars)])))))) getter-interop (: (-> Text Code) (function (_ name) - (let [getter-name (code.identifier ["" (format method-prefix member-separator name)])] + (let [getter-name (code.identifier ["" (..import-name import-format method-prefix name)])] (` (def: (~ getter-name) (~ enum-type) ((~ (code.text (format "jvm getstatic" ":" full-name ":" name)))))))))]] @@ -1516,7 +1529,7 @@ (#ConstructorDecl [commons _]) (do meta.monad - [#let [def-name (code.identifier ["" (format method-prefix member-separator (get@ #import-member-alias commons))]) + [#let [def-name (code.identifier ["" (..import-name import-format method-prefix (get@ #import-member-alias commons))]) jvm-extension (code.text (format "jvm new" ":" full-name ":" (text.join-with "," arg-classes))) jvm-interop (|> (` ((~ jvm-extension) (~+ (jvm-extension-inputs (get@ #import-member-mode commons) arg-classes arg-function-inputs)))) @@ -1529,7 +1542,7 @@ (#MethodDecl [commons method]) (with-gensyms [g!obj] (do meta.monad - [#let [def-name (code.identifier ["" (format method-prefix member-separator (get@ #import-member-alias commons))]) + [#let [def-name (code.identifier ["" (..import-name import-format method-prefix (get@ #import-member-alias commons))]) (^slots [#import-member-kind]) commons (^slots [#import-method-name]) method [jvm-op object-ast] (: [Text (List Code)] @@ -1571,8 +1584,8 @@ (|> class-tvars (list.filter free-type-param?) (list\map type-param->type-arg))) - getter-name (code.identifier ["" (format method-prefix member-separator import-field-name)]) - setter-name (code.identifier ["" (format method-prefix member-separator import-field-name "!")])] + getter-name (code.identifier ["" (..import-name import-format method-prefix import-field-name)]) + setter-name (code.identifier ["" (..import-name import-format method-prefix (format import-field-name "!"))])] getter-interop (with-gensyms [g!obj] (let [getter-call (if import-field-static? (` ((~ getter-name))) @@ -1615,12 +1628,12 @@ (wrap (list& getter-interop setter-interop))) ))) -(def: (member-import$ type-params kind class member) - (-> (List Type-Parameter) Class-Kind Class-Declaration Import-Member-Declaration (Meta (List Code))) +(def: (member-import$ type-params kind class [import-format member]) + (-> (List Type-Parameter) Class-Kind Class-Declaration [Text Import-Member-Declaration] (Meta (List Code))) (let [[method-prefix _] class] (do meta.monad [=args (member-def-arg-bindings type-params class member)] - (member-def-interop type-params kind class =args member method-prefix)))) + (member-def-interop type-params kind class =args member method-prefix import-format)))) (def: (interface? class) (All [a] (-> (primitive "java.lang.Class" [a]) Bit)) @@ -1644,13 +1657,14 @@ (syntax: #export (import: {class-decl ..class-decl^} - {members (p.some (..import-member-decl^ (product.right class-decl)))}) + {bundles (p.some (..bundle (product.right class-decl)))}) {#.doc (doc "Allows importing JVM classes, and using them as types." "Their methods, fields and enum options can also be imported." (import: java/lang/Object - (new []) - (equals [java/lang/Object] boolean) - (wait [int] #io #try void)) + ["#::." + (new []) + (equals [java/lang/Object] boolean) + (wait [int] #io #try void)]) "Special options can also be given for the return values." "#? means that the values will be returned inside a Maybe type. That way, null becomes #.None." @@ -1658,31 +1672,36 @@ "#io means the computation has side effects, and will be wrapped by the IO type." "These options must show up in the following order [#io #try #?] (although, each option can be used independently)." (import: java/lang/String - (new [[byte]]) - (#static valueOf [char] java/lang/String) - (#static valueOf #as int-valueOf [int] java/lang/String)) + ["#::." + (new [[byte]]) + (#static valueOf [char] java/lang/String) + (#static valueOf #as int-valueOf [int] java/lang/String)]) (import: (java/util/List e) - (size [] int) - (get [int] e)) + ["#::." + (size [] int) + (get [int] e)]) (import: (java/util/ArrayList a) - ([T] toArray [[T]] [T])) + ["#::." + ([T] toArray [[T]] [T])]) "The class-type that is generated is of the fully-qualified name." "This avoids a clash between the java.util.List type, and Lux's own List type." "All enum options to be imported must be specified." (import: java/lang/Character$UnicodeScript - (#enum ARABIC CYRILLIC LATIN)) + ["#::." + (#enum ARABIC CYRILLIC LATIN)]) "It should also be noted, the only types that may show up in method arguments or return values may be Java classes, arrays, primitives, void or type-parameters." "Lux types, such as Maybe cannot be named (otherwise, they'd be confused for Java classes)." (import: (lux/concurrency/promise/JvmPromise A) - (resolve [A] boolean) - (poll [] A) - (wasResolved [] boolean) - (waitOn [lux/Function] void) - (#static [A] make [A] (lux/concurrency/promise/JvmPromise A))) + ["#::." + (resolve [A] boolean) + (poll [] A) + (wasResolved [] boolean) + (waitOn [lux/Function] void) + (#static [A] make [A] (lux/concurrency/promise/JvmPromise A))]) "Also, the names of the imported members will look like Class::member" (java/lang/Object::new []) @@ -1692,7 +1711,11 @@ )} (do {! meta.monad} [kind (class-kind class-decl) - =members (monad.map ! (member-import$ (product.right class-decl) kind class-decl) members)] + =members (|> bundles + (list\map (function (_ [import-format members]) + (list\map (|>> [import-format]) members))) + list.concat + (monad.map ! (member-import$ (product.right class-decl) kind class-decl)))] (wrap (list& (class-import$ class-decl) (list\join =members))))) (syntax: #export (array {type (..generic-type^ (list))} diff --git a/stdlib/source/lux/target/jvm/bytecode.lux b/stdlib/source/lux/target/jvm/bytecode.lux index 008610b11..80121e692 100644 --- a/stdlib/source/lux/target/jvm/bytecode.lux +++ b/stdlib/source/lux/target/jvm/bytecode.lux @@ -457,10 +457,12 @@ (..bytecode $0 $1 @_ _.ldc-w/string [index])))) (import: java/lang/Float - (#static floatToRawIntBits #manual [float] int)) + ["#::." + (#static floatToRawIntBits #manual [float] int)]) (import: java/lang/Double - (#static doubleToRawLongBits #manual [double] int)) + ["#::." + (#static doubleToRawLongBits #manual [double] int)]) (template [ ] [(def: #export ( value) diff --git a/stdlib/source/lux/target/jvm/constant.lux b/stdlib/source/lux/target/jvm/constant.lux index 894de4367..c58608867 100644 --- a/stdlib/source/lux/target/jvm/constant.lux +++ b/stdlib/source/lux/target/jvm/constant.lux @@ -59,7 +59,8 @@ ) (import: java/lang/Float - (#static floatToRawIntBits #manual [float] int)) + ["#::." + (#static floatToRawIntBits #manual [float] int)]) (structure: #export float-equivalence (Equivalence java/lang/Float) @@ -74,7 +75,8 @@ ("jvm object cast" subject))}))) (import: java/lang/Double - (#static doubleToRawLongBits [double] long)) + ["#::." + (#static doubleToRawLongBits [double] long)]) (abstract: #export (Value kind) kind diff --git a/stdlib/source/lux/target/jvm/loader.lux b/stdlib/source/lux/target/jvm/loader.lux index 14c19bb86..74bfabc44 100644 --- a/stdlib/source/lux/target/jvm/loader.lux +++ b/stdlib/source/lux/target/jvm/loader.lux @@ -36,25 +36,31 @@ ["Error" error])) (import: java/lang/Object - (getClass [] (java/lang/Class java/lang/Object))) + ["#::." + (getClass [] (java/lang/Class java/lang/Object))]) (import: java/lang/String) (import: java/lang/reflect/Method - (invoke [java/lang/Object [java/lang/Object]] #try java/lang/Object)) + ["#::." + (invoke [java/lang/Object [java/lang/Object]] #try java/lang/Object)]) (import: (java/lang/Class a) - (getDeclaredMethod [java/lang/String [(java/lang/Class [? < java/lang/Object])]] java/lang/reflect/Method)) + ["#::." + (getDeclaredMethod [java/lang/String [(java/lang/Class [? < java/lang/Object])]] java/lang/reflect/Method)]) (import: java/lang/Integer - (#static TYPE (java/lang/Class java/lang/Integer))) + ["#::." + (#static TYPE (java/lang/Class java/lang/Integer))]) (import: java/lang/reflect/AccessibleObject - (setAccessible [boolean] void)) + ["#::." + (setAccessible [boolean] void)]) (import: java/lang/ClassLoader - (loadClass [java/lang/String] - #io #try (java/lang/Class java/lang/Object))) + ["#::." + (loadClass [java/lang/String] + #io #try (java/lang/Class java/lang/Object))]) (with-expansions [ (as-is (java/lang/Class java/lang/Object))] (def: java/lang/ClassLoader::defineClass diff --git a/stdlib/source/lux/tool/compiler/language/lux/directive.lux b/stdlib/source/lux/tool/compiler/language/lux/directive.lux index 11dc98bef..788b8fc4a 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/directive.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/directive.lux @@ -4,7 +4,7 @@ [monad (#+ do)]] [data [collection - ["." list ("#@." monoid)]]]] + ["." list ("#\." monoid)]]]] [// ["." analysis] ["." synthesis] @@ -44,8 +44,8 @@ (def: #export (merge-requirements left right) (-> Requirements Requirements Requirements) - {#imports (list@compose (get@ #imports left) (get@ #imports right)) - #referrals (list@compose (get@ #referrals left) (get@ #referrals right))}) + {#imports (list\compose (get@ #imports left) (get@ #imports right)) + #referrals (list\compose (get@ #referrals left) (get@ #referrals right))}) (template [ ] [(type: #export ( anchor expression directive) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp.lux index ad04cefdb..975301cef 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp.lux @@ -6,7 +6,7 @@ [runtime (#+ Phase)] ["." primitive] ["." structure] - ["." reference ("#@." system)] + ["." reference ("#\." system)] ["." case] ["." loop] ["." function] @@ -34,7 +34,7 @@ (structure.tuple generate members) (#synthesis.Reference value) - (reference@reference value) + (reference\reference value) (^ (synthesis.branch/case case)) (case.case generate case) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/case.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/case.lux index dcd47a26d..6c6858ea9 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/case.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/case.lux @@ -9,7 +9,7 @@ [number ["n" nat]] [collection - ["." list ("#@." functor fold)] + ["." list ("#\." functor fold)] ["." set]]] [target ["_" common-lisp (#+ Expression Var/1)]]] @@ -19,7 +19,7 @@ ["#." primitive] ["#/" // ["#." reference] - ["#/" // ("#@." monad) + ["#/" // ("#\." monad) [synthesis ["." case]] ["#/" // #_ @@ -46,7 +46,7 @@ (Operation (Expression Any))) (do ////.monad [valueG (generate valueS)] - (wrap (list@fold (function (_ side source) + (wrap (list\fold (function (_ side source) (.let [method (.case side (^template [ ] [( lefts) @@ -137,14 +137,14 @@ (:: ////.monad map (_.return-from ..@done) (generate bodyS)) #/////synthesis.Pop - (////@wrap ..pop!) + (////\wrap ..pop!) (#/////synthesis.Bind register) - (////@wrap (_.setq (..register register) ..peek)) + (////\wrap (_.setq (..register register) ..peek)) (^template [ <=>] [(^ ( value)) - (////@wrap (_.if (|> value (<=> ..peek)) + (////\wrap (_.if (|> value (<=> ..peek)) _.nil fail!))]) ([/////synthesis.path/bit //primitive.bit _.equal] @@ -154,7 +154,7 @@ (^template [ ] [(^ ( idx)) - (////@wrap ( false idx)) + (////\wrap ( false idx)) (^ ( idx nextP)) (|> nextP @@ -164,11 +164,11 @@ [/////synthesis.side/right /////synthesis.simple-right-side ..right-choice]) (^ (/////synthesis.member/left 0)) - (////@wrap (..push! (_.elt/2 [..peek (_.int +0)]))) + (////\wrap (..push! (_.elt/2 [..peek (_.int +0)]))) (^template [ ] [(^ ( lefts)) - (////@wrap (|> ..peek ( (_.int (.int lefts))) ..push!))]) + (////\wrap (|> ..peek ( (_.int (.int lefts))) ..push!))]) ([/////synthesis.member/left //runtime.tuple//left] [/////synthesis.member/right //runtime.tuple//right]) @@ -176,7 +176,7 @@ (.let [[extra-pops nextP'] (case.count-pops nextP)] (do ////.monad [next! (pattern-matching' generate nextP')] - (////@wrap ($_ _.progn + (////\wrap ($_ _.progn (..multi-pop! (n.+ 2 extra-pops)) next!)))) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/function.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/function.lux index 196938917..8853de638 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/function.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/function.lux @@ -7,7 +7,7 @@ [data ["." product] [collection - ["." list ("#@." functor fold)]]] + ["." list ("#\." functor fold)]]] [target ["_" common-lisp (#+ Expression)]]] ["." // #_ @@ -43,7 +43,7 @@ (do {! ////.monad} [@closure (:: ! map _.var (///.gensym "closure"))] (wrap (_.labels (list [@closure [(|> (list.enumeration inits) - (list@map (|>> product.left ..capture)) + (list\map (|>> product.left ..capture)) _.args) function-definition]]) (_.funcall/+ [(_.function/1 @closure) inits])))))) @@ -68,7 +68,7 @@ @self (_.var function-name) initialize-self! [(//case.register 0) (_.function/1 @self)] initialize! [(|> (list.indices arity) - (list@map ..input) + (list\map ..input) _.args) @curried]]] (with-closure function-name closureG+ diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/loop.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/loop.lux index 3c3232e64..e3c6d4279 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/loop.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/loop.lux @@ -9,7 +9,7 @@ [text ["%" format (#+ format)]] [collection - ["." list ("#@." functor)]]] + ["." list ("#\." functor)]]] [target ["_" common-lisp (#+ Expression)]]] ["." // #_ @@ -29,7 +29,7 @@ (generate bodyS))] (wrap (_.labels (list [@scope {#_.input (|> initsS+ list.enumeration - (list@map (|>> product.left (n.+ start) //case.register)) + (list\map (|>> product.left (n.+ start) //case.register)) _.args) #_.output bodyG}]) (_.funcall/+ [(_.function/1 @scope) initsG+]))))) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/runtime.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/runtime.lux index dc8fe6e92..2d9017bcb 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/runtime.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/runtime.lux @@ -12,7 +12,7 @@ ["." text ["%" format (#+ format)]] [collection - ["." list ("#@." functor)]]] + ["." list ("#\." functor)]]] ["." macro ["." code] [syntax (#+ syntax:)]] @@ -84,7 +84,7 @@ (syntax: #export (with-vars {vars (s.tuple (p.some s.local-identifier))} body) (wrap (list (` (let [(~+ (|> vars - (list@map (function (_ var) + (list\map (function (_ var) (list (code.local-identifier var) (` (_.var (~ (code.text (/////name.normalize var)))))))) list.concat))] @@ -109,8 +109,8 @@ (#.Right [name inputs]) (let [code-nameC (code.local-identifier (format "@" name)) runtime-nameC (` (runtime-name (~ (code.text name)))) - inputsC (list@map code.local-identifier inputs) - inputs-typesC (list@map (function.constant (` (_.Expression Any))) + inputsC (list\map code.local-identifier inputs) + inputs-typesC (list\map (function.constant (` (_.Expression Any))) inputs)] (wrap (list (` (def: #export ((~ (code.local-identifier name)) (~+ inputsC)) (-> (~+ inputs-typesC) (_.Computation Any)) @@ -146,7 +146,8 @@ (def: runtime//lux ($_ _.progn @lux//try - @lux//program-args)) + @lux//program-args + )) (def: last-index (|>> _.length/1 (_.- (_.int +1)))) @@ -215,7 +216,8 @@ ($_ _.progn @tuple//left @tuple//right - @sum//get)) + @sum//get + )) (runtime: (i64//logic-right-shift shift input) (_.if (_.= (_.int +0) shift) @@ -226,7 +228,8 @@ (def: runtime//i64 ($_ _.progn - @i64//logic-right-shift)) + @i64//logic-right-shift + )) (runtime: (text//clip from to text) (_.subseq/3 [text from to])) @@ -241,7 +244,8 @@ (def: runtime//text ($_ _.progn @text//index - @text//clip)) + @text//clip + )) (runtime: (io//exit code) ($_ _.progn @@ -262,7 +266,8 @@ (def: runtime//io ($_ _.progn @io//exit - @io//current-time)) + @io//current-time + )) (def: runtime ($_ _.progn diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/case.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/case.lux index 50730cdda..ce9625452 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/case.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/case.lux @@ -10,7 +10,7 @@ [number ["n" nat]] [collection - ["." list ("#@." functor fold)]]] + ["." list ("#\." functor fold)]]] [target ["_" js (#+ Expression Computation Var Statement)]]] ["." // #_ @@ -27,7 +27,7 @@ ["//#" /// #_ [reference [variable (#+ Register)]] - ["#." phase ("#@." monad)] + ["#." phase ("#\." monad)] [meta [archive (#+ Archive)]]]]]]]) @@ -74,7 +74,7 @@ (Generator [(List Member) Synthesis]) (do ///////phase.monad [valueO (generate archive valueS)] - (wrap (list@fold (function (_ side source) + (wrap (list\fold (function (_ side source) (.let [method (.case side (^template [ ] [( lefts) @@ -168,7 +168,7 @@ [/////synthesis.simple-right-side ..right-choice]) (^ (/////synthesis.member/left 0)) - (///////phase@wrap (#.Some (push-cursor! (_.at (_.i32 +0) ..peek-cursor)))) + (///////phase\wrap (#.Some (push-cursor! (_.at (_.i32 +0) ..peek-cursor)))) ## Extra optimization (^ (/////synthesis.path/seq @@ -209,7 +209,7 @@ next!))))) _ - (///////phase@wrap #.None))) + (///////phase\wrap #.None))) (def: (pattern-matching' statement expression archive) (-> Phase! Phase Archive @@ -224,10 +224,10 @@ #.None (.case pathP #/////synthesis.Pop - (///////phase@wrap pop-cursor!) + (///////phase\wrap pop-cursor!) (#/////synthesis.Bind register) - (///////phase@wrap (_.define (..register register) ..peek-cursor)) + (///////phase\wrap (_.define (..register register) ..peek-cursor)) (#/////synthesis.Bit-Fork when thenP elseP) (do {! ///////phase.monad} @@ -274,13 +274,13 @@ (^template [ ] [(^ ( idx)) - (///////phase@wrap ( false idx))]) + (///////phase\wrap ( false idx))]) ([/////synthesis.side/left ..left-choice] [/////synthesis.side/right ..right-choice]) (^template [ ] [(^ ( lefts)) - (///////phase@wrap (push-cursor! ( (_.i32 (.int lefts)) ..peek-cursor)))]) + (///////phase\wrap (push-cursor! ( (_.i32 (.int lefts)) ..peek-cursor)))]) ([/////synthesis.member/left //runtime.tuple//left] [/////synthesis.member/right //runtime.tuple//right]) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/function.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/function.lux index 0f311d61b..12e328a11 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/function.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/function.lux @@ -9,7 +9,7 @@ [text ["%" format (#+ format)]] [collection - ["." list ("#@." functor fold)]]] + ["." list ("#\." functor fold)]]] [target ["_" js (#+ Expression Computation Var Statement)]]] ["." // #_ @@ -26,7 +26,7 @@ [arity (#+ Arity)] [reference [variable (#+ Register Variable)]] - ["#." phase ("#@." monad)]]]]]) + ["#." phase ("#\." monad)]]]]]) (def: #export (apply generate archive [functionS argsS+]) (Generator (Application Synthesis)) @@ -47,7 +47,7 @@ (|>> (///reference.foreign //reference.system) :assume))] [(_.function! @self (|> (list.enumeration inits) - (list@map (|>> product.left capture))) + (list\map (|>> product.left capture))) (_.return (_.function @self (list) function-body))) (_.apply/* @self inits)]))) @@ -78,7 +78,7 @@ apply-poly (.function (_ args func) (|> func (_.do "apply" (list _.null args)))) initialize-self! (_.define (//case.register 0) @self) - initialize! (list@fold (.function (_ post pre!) + initialize! (list\fold (.function (_ post pre!) ($_ _.then pre! (_.define (..input post) (_.at (_.i32 (.int post)) @@arguments)))) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/loop.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/loop.lux index 07169e856..5e810a551 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/loop.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/loop.lux @@ -9,7 +9,7 @@ [number ["n" nat]] [collection - ["." list ("#@." functor fold)]]] + ["." list ("#\." functor fold)]]] [target ["_" js (#+ Computation Var Expression Statement)]]] ["." // #_ @@ -31,13 +31,13 @@ (-> Bit Register (List Expression) Statement Statement) (|> bindings list.enumeration - (list@map (function (_ [register value]) + (list\map (function (_ [register value]) (let [variable (//case.register (n.+ offset register))] (if initial? (_.define variable value) (_.set variable value))))) list.reverse - (list@fold _.then body))) + (list\fold _.then body))) (def: #export (scope! statement expression archive [start initsS+ bodyS]) (Generator! (Scope Synthesis)) @@ -75,7 +75,7 @@ #let [closure (_.closure (|> initsS+ list.enumeration - (list@map (|>> product.left (n.+ start) //case.register))) + (list\map (|>> product.left (n.+ start) //case.register))) (_.with-label (_.label @scope) (_.do-while (_.boolean true) body!)))]] @@ -93,6 +93,6 @@ (..setup false offset (|> argsO+ list.enumeration - (list@map (function (_ [idx _]) + (list\map (function (_ [idx _]) (_.at (_.i32 (.int idx)) @temp)))) (_.continue-at (_.label @scope))))))) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux index f73decb82..632cc91c2 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux @@ -10,11 +10,11 @@ ["." product] [number (#+ hex) ["." i64]] - ["." text ("#@." hash) + ["." text ("#\." hash) ["%" format (#+ format)] ["." encoding]] [collection - ["." list ("#@." functor)] + ["." list ("#\." functor)] ["." row]]] ["." macro ["." code] @@ -89,7 +89,7 @@ [ids (monad.seq ! (list.repeat (list.size vars) macro.count))] (wrap (list (` (let [(~+ (|> vars (list.zip/2 ids) - (list@map (function (_ [id var]) + (list\map (function (_ [id var]) (list (code.local-identifier var) (` (_.var (~ (code.text (format "v" (%.nat id))))))))) list.concat))] @@ -99,7 +99,7 @@ (-> Text [Code Code]) (let [identifier (format ..prefix "_" (%.nat $.version) - "_" (%.nat (text@hash name)))] + "_" (%.nat (text\hash name)))] [(` (_.var (~ (code.text identifier)))) (code.local-identifier identifier)])) @@ -130,8 +130,8 @@ (let [[runtime-nameC runtime-nameC!] (..runtime-name name) nameC (code.local-identifier name) code-nameC (code.local-identifier (format "@" name)) - inputsC (list@map code.local-identifier inputs) - inputs-typesC (list@map (function.constant (` _.Expression)) inputs)] + inputsC (list\map code.local-identifier inputs) + inputs-typesC (list\map (function.constant (` _.Expression)) inputs)] (wrap (list (` (def: ((~ runtime-nameC!) (~+ inputsC)) (-> (~+ inputs-typesC) Computation) (_.apply/* (~ runtime-nameC) (list (~+ inputsC))))) @@ -751,7 +751,8 @@ Statement ($_ _.then @array//write - @array//delete)) + @array//delete + )) (def: runtime Statement diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/structure.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/structure.lux index acd36a5ba..a90b81f7d 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/structure.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/structure.lux @@ -11,13 +11,13 @@ [analysis (#+ Variant Tuple)] ["#." synthesis (#+ Synthesis)] ["//#" /// - ["#." phase ("#@." monad)]]]]) + ["#." phase ("#\." monad)]]]]) (def: #export (tuple generate archive elemsS+) (Generator (Tuple Synthesis)) (case elemsS+ #.Nil - (///////phase@wrap //runtime.unit) + (///////phase\wrap //runtime.unit) (#.Cons singletonS #.Nil) (generate archive singletonS) @@ -32,6 +32,6 @@ (let [tag (if right? (inc lefts) lefts)] - (///////phase@map (//runtime.variant (_.i32 (.int tag)) + (///////phase\map (//runtime.variant (_.i32 (.int tag)) (//runtime.flag right?)) (generate archive valueS)))) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux index 7e7cccc72..010f97349 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux @@ -9,10 +9,10 @@ ["." i32] ["n" nat]] [collection - ["." list ("#@." fold)]]] + ["." list ("#\." fold)]]] [target [jvm - ["_" bytecode (#+ Label Bytecode) ("#@." monad)] + ["_" bytecode (#+ Label Bytecode) ("#\." monad)] ["." type (#+ Type) [category (#+ Method)]]]]] ["." // #_ @@ -24,7 +24,7 @@ ["." synthesis (#+ Path Synthesis)] ["." generation] [/// - ["." phase ("operation@." monad)] + ["." phase ("operation\." monad)] [reference [variable (#+ Register)]]]]]) @@ -37,7 +37,7 @@ (def: (pop-alt stack-depth) (-> Nat (Bytecode Any)) (.case stack-depth - 0 (_@wrap []) + 0 (_\wrap []) 1 _.pop 2 _.pop2 _ ## (n.> 2) @@ -92,10 +92,10 @@ (-> Nat Label Label (Generator Path)) (.case path #synthesis.Pop - (operation@wrap ..pop) + (operation\wrap ..pop) (#synthesis.Bind register) - (operation@wrap ($_ _.compose + (operation\wrap ($_ _.compose ..peek (_.astore register))) @@ -109,7 +109,7 @@ (^template [ ] [(^ ( lefts)) - (operation@wrap + (operation\wrap (do _.monad [@success _.new-label @fail _.new-label] @@ -132,7 +132,7 @@ (^template [ ] [(^ ( lefts)) - (operation@wrap ($_ _.compose + (operation\wrap ($_ _.compose ..peek ( lefts) //runtime.push))]) @@ -240,7 +240,7 @@ (Generator [(List synthesis.Member) Synthesis]) (do phase.monad [recordG (phase archive recordS)] - (wrap (list@fold (function (_ step so-far) + (wrap (list\fold (function (_ step so-far) (.let [next (.case step (#.Left lefts) (..left-projection lefts) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux index a2c46f8fd..a456644b8 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux @@ -7,17 +7,17 @@ ["." i32] ["n" nat]] [collection - ["." list ("#@." monoid functor)] + ["." list ("#\." monoid functor)] ["." row]] ["." format #_ ["#" binary]]] [target [jvm ["." version] - ["." modifier (#+ Modifier) ("#@." monoid)] + ["." modifier (#+ Modifier) ("#\." monoid)] ["." field (#+ Field)] ["." method (#+ Method)] - ["_" bytecode (#+ Label Bytecode) ("#@." monad)] + ["_" bytecode (#+ Label Bytecode) ("#\." monad)] ["." class (#+ Class)] ["." type (#+ Type) [category (#+ Return' Value')] @@ -65,7 +65,7 @@ (let [classT (type.class class (list)) fields (: (List (Resource Field)) (list& /arity.constant - (list@compose (/foreign.variables environment) + (list\compose (/foreign.variables environment) (/partial.variables arity)))) methods (: (List (Resource Method)) (list& (/init.method classT environment arity) @@ -73,7 +73,7 @@ (if (arity.multiary? arity) (|> (n.min arity /arity.maximum) list.indices - (list@map (|>> inc (/apply.method classT environment arity @begin body))) + (list\map (|>> inc (/apply.method classT environment arity @begin body))) (list& (/implementation.method arity @begin body))) (list (/implementation.method' //runtime.apply::name arity @begin body)))))] (do phase.monad @@ -82,7 +82,7 @@ (def: modifier (Modifier Class) - ($_ modifier@compose + ($_ modifier\compose class.public class.final)) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant.lux index dd8144ea8..f3b4a4720 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant.lux @@ -6,7 +6,7 @@ [target [jvm ["." field (#+ Field)] - ["." modifier (#+ Modifier) ("#@." monoid)] + ["." modifier (#+ Modifier) ("#\." monoid)] [type (#+ Type) [category (#+ Value)]] [constant @@ -14,7 +14,7 @@ (def: modifier (Modifier Field) - ($_ modifier@compose + ($_ modifier\compose field.public field.static field.final diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable.lux index 13865b17e..478f9d454 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable.lux @@ -2,11 +2,11 @@ [lux (#- Type type) [data [collection - ["." list ("#@." functor)] + ["." list ("#\." functor)] ["." row]]] [target [jvm - ["." modifier (#+ Modifier) ("#@." monoid)] + ["." modifier (#+ Modifier) ("#\." monoid)] ["." field (#+ Field)] ["_" bytecode (#+ Bytecode)] [type (#+ Type) @@ -38,7 +38,7 @@ (def: modifier (Modifier Field) - ($_ modifier@compose + ($_ modifier\compose field.private field.final )) @@ -51,5 +51,5 @@ (-> (-> Register Text) Nat (List (Resource Field))) (|> amount list.indices - (list@map (function (_ register) + (list\map (function (_ register) (..variable (naming register) ..type))))) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/foreign.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/foreign.lux index cbea98db2..1c6bf6455 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/foreign.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/foreign.lux @@ -2,7 +2,7 @@ [lux (#- Type) [data [collection - ["." list ("#@." functor)] + ["." list] ["." row]]] [target [jvm diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/partial.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/partial.lux index 57271de30..ff1599a0c 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/partial.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/partial.lux @@ -6,12 +6,12 @@ [number ["n" nat]] [collection - ["." list ("#@." functor)] + ["." list ("#\." functor)] ["." row]]] [target [jvm ["." field (#+ Field)] - ["_" bytecode (#+ Label Bytecode) ("#@." monad)] + ["_" bytecode (#+ Label Bytecode) ("#\." monad)] [type (#+ Type) [category (#+ Class)]] [constant @@ -35,7 +35,7 @@ (|> _.aconst-null (list.repeat amount) (monad.seq _.monad)) - (_@wrap []))) + (_\wrap []))) (def: #export (get class register) (-> (Type Class) Register (Bytecode Any)) @@ -55,4 +55,4 @@ ($_ _.compose /count.initial (initial (n.- ///arity.minimum arity))) - (_@wrap []))) + (_\wrap []))) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method.lux index 2fd419d18..a6de97cc3 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method.lux @@ -2,12 +2,12 @@ [lux #* [target [jvm - ["." modifier (#+ Modifier) ("#@." monoid)] + ["." modifier (#+ Modifier) ("#\." monoid)] ["." method (#+ Method)]]]]) (def: #export modifier (Modifier Method) - ($_ modifier@compose + ($_ modifier\compose method.public method.strict )) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux index 9e88895f5..581cce970 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux @@ -10,10 +10,10 @@ ["i" int] ["." i32]] [collection - ["." list ("#@." monoid functor)]]] + ["." list ("#\." monoid functor)]]] [target [jvm - ["_" bytecode (#+ Label Bytecode) ("#@." monad)] + ["_" bytecode (#+ Label Bytecode) ("#\." monad)] ["." method (#+ Method)] [constant [pool (#+ Resource)]] @@ -58,7 +58,7 @@ (|> amount list.indices (monad.map _.monad (|>> (n.+ offset) _.aload))) - (_@wrap []) + (_\wrap []) )) (def: (apply offset amount) @@ -71,7 +71,7 @@ (if (n.> ///arity.maximum amount) (apply (n.+ ///arity.maximum offset) (n.- ///arity.maximum amount)) - (_@wrap [])) + (_\wrap [])) ))) (def: this-offset 1) @@ -96,12 +96,12 @@ @labelsT (|> _.new-label (list.repeat (dec num-partials)) (monad.seq _.monad)) - #let [cases (|> (list@compose (#.Cons [@labelsH @labelsT]) + #let [cases (|> (list\compose (#.Cons [@labelsH @labelsT]) (list @default)) list.enumeration - (list@map (function (_ [stage @case]) + (list\map (function (_ [stage @case]) (let [current-partials (|> (list.indices stage) - (list@map (///partial.get class)) + (list\map (///partial.get class)) (monad.seq _.monad)) already-partial? (n.> 0 stage) exact-match? (i.= over-extent (.int stage)) @@ -113,7 +113,7 @@ ////reference.this (if already-partial? (_.invokevirtual class //reset.name (//reset.type class)) - (_@wrap [])) + (_\wrap [])) current-partials (..inputs ..this-offset apply-arity) (_.invokevirtual class //implementation.name (//implementation.type function-arity)) @@ -133,7 +133,7 @@ ## (i.< over-extent (.int stage)) (let [current-environment (|> (list.indices (list.size environment)) - (list@map (///foreign.get class)) + (list\map (///foreign.get class)) (monad.seq _.monad)) missing-partials (|> _.aconst-null (list.repeat (|> num-partials (n.- apply-arity) (n.- stage))) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/init.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/init.lux index 8649123ff..fe8b824c9 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/init.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/init.lux @@ -8,7 +8,7 @@ [number ["n" nat]] [collection - ["." list ("#@." monoid functor)]]] + ["." list ("#\." monoid functor)]]] [target [jvm ["_" bytecode (#+ Bytecode)] @@ -48,7 +48,7 @@ (def: #export (type environment arity) (-> (Environment Synthesis) Arity (Type category.Method)) - (type.method [(list@compose (///foreign.closure environment) + (type.method [(list\compose (///foreign.closure environment) (if (arity.multiary? arity) (list& ///arity.type (..partials arity)) (list))) @@ -72,7 +72,7 @@ (-> Register Register) (Bytecode Any)) (|> (list.indices amount) - (list@map (function (_ register) + (list\map (function (_ register) (put register (_.aload (offset register))))) (monad.seq _.monad))) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/new.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/new.lux index 1800064a2..7bf1b0bd8 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/new.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/new.lux @@ -6,10 +6,9 @@ [number ["n" nat]] [collection - ["." list ("#@." monoid)]]] + ["." list]]] [target [jvm - ["." modifier (#+ Modifier) ("#@." monoid)] ["." field (#+ Field)] ["." method (#+ Method)] ["_" bytecode (#+ Bytecode)] diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/reset.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/reset.lux index 7373bf984..9793da801 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/reset.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/reset.lux @@ -2,7 +2,7 @@ [lux (#- Type type) [data [collection - ["." list ("#@." functor)]]] + ["." list ("#\." functor)]]] [target [jvm ["." method (#+ Method)] @@ -35,7 +35,7 @@ (-> (Type Class) (Environment Synthesis) (List (Bytecode Any))) (|>> list.size list.indices - (list@map (///foreign.get class)))) + (list\map (///foreign.get class)))) (def: #export (method class environment arity) (-> (Type Class) (Environment Synthesis) Arity (Resource Method)) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux index 8eaafb3a5..2640f28ce 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux @@ -9,10 +9,10 @@ [number ["n" nat]] [collection - ["." list ("#@." functor)]]] + ["." list ("#\." functor)]]] [target [jvm - ["_" bytecode (#+ Label Bytecode) ("#@." monad)]]]] + ["_" bytecode (#+ Label Bytecode) ("#\." monad)]]]] ["." // #_ ["#." runtime (#+ Operation Phase Generator)] ["#." value] @@ -34,7 +34,7 @@ false)) (def: no-op - (_@wrap [])) + (_\wrap [])) (def: #export (recur translate archive updatesS) (Generator (List Synthesis)) @@ -42,7 +42,7 @@ [[@begin offset] generation.anchor updatesG (|> updatesS list.enumeration - (list@map (function (_ [index updateS]) + (list\map (function (_ [index updateS]) [(n.+ offset index) updateS])) (monad.map ! (function (_ [register updateS]) (if (invariant? register updateS) @@ -62,11 +62,11 @@ ## will refer to the new value of X, instead of the old value, as ## should be the case. (|> updatesG - (list@map product.left) + (list\map product.left) (monad.seq _.monad)) (|> updatesG list.reverse - (list@map product.right) + (list\map product.right) (monad.seq _.monad)) (_.goto @begin))))) @@ -78,7 +78,7 @@ iterationG (generation.with-anchor [@begin offset] (translate archive iterationS)) #let [initializationG (|> (list.enumeration initsI+) - (list@map (function (_ [index initG]) + (list\map (function (_ [index initG]) ($_ _.compose initG (_.astore (n.+ offset index))))) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/program.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/program.lux index c5f10a9a6..6166f14c1 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/program.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/program.lux @@ -12,7 +12,7 @@ [target [jvm ["_" bytecode (#+ Bytecode)] - ["." modifier (#+ Modifier) ("#@." monoid)] + ["." modifier (#+ Modifier) ("#\." monoid)] ["." method (#+ Method)] ["." version] ["." class (#+ Class)] @@ -34,7 +34,7 @@ (def: main::modifier (Modifier Method) - ($_ modifier@compose + ($_ modifier\compose method.public method.static method.strict @@ -42,7 +42,7 @@ (def: program::modifier (Modifier Class) - ($_ modifier@compose + ($_ modifier\compose class.public class.final )) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux index 679599858..57d45f6c3 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux @@ -12,7 +12,7 @@ ["." i64] ["n" nat]] [collection - ["." list ("#@." functor)] + ["." list ("#\." functor)] ["." row]] ["." format #_ ["#" binary]] @@ -21,7 +21,7 @@ [target ["." jvm #_ ["_" bytecode (#+ Label Bytecode)] - ["." modifier (#+ Modifier) ("#@." monoid)] + ["." modifier (#+ Modifier) ("#\." monoid)] ["." field (#+ Field)] ["." method (#+ Method)] ["#/." version] @@ -95,7 +95,7 @@ (def: modifier (Modifier Method) - ($_ modifier@compose + ($_ modifier\compose method.public method.static method.strict @@ -506,7 +506,7 @@ (Operation Any) (let [class (..reflection ..class) modifier (: (Modifier Class) - ($_ modifier@compose + ($_ modifier\compose class.public class.final)) bytecode (<| (format.run class.writer) @@ -538,7 +538,7 @@ (let [apply::method+ (|> (enum.range n.enum (inc //function/arity.minimum) //function/arity.maximum) - (list@map (function (_ arity) + (list\map (function (_ arity) (method.method method.public ..apply::name (..apply::type arity) (list) (#.Some @@ -552,7 +552,7 @@ (_.aload arity) (_.invokevirtual //function.class ..apply::name (..apply::type //function/arity.minimum)) _.areturn)))))) - (list& (method.method (modifier@compose method.public method.abstract) + (list& (method.method (modifier\compose method.public method.abstract) ..apply::name (..apply::type //function/arity.minimum) (list) #.None))) @@ -568,12 +568,12 @@ (_.putfield //function.class //function/count.field //function/count.type) _.return)))) modifier (: (Modifier Class) - ($_ modifier@compose + ($_ modifier\compose class.public class.abstract)) class (..reflection //function.class) partial-count (: (Resource Field) - (field.field (modifier@compose field.public field.final) + (field.field (modifier\compose field.public field.final) //function/count.field //function/count.type (row.row))) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/value.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/value.lux index 462c625c9..206af53b8 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/value.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/value.lux @@ -3,7 +3,7 @@ [target [jvm ["_" bytecode (#+ Bytecode)] - ["." type (#+ Type) ("#@." equivalence) + ["." type (#+ Type) ("#\." equivalence) [category (#+ Primitive)] ["." box]]]]]) @@ -13,7 +13,7 @@ [(def: ( type) (-> (Type Primitive) Text) (`` (cond (~~ (template [ ] - [(type@= type) ] + [(type\= type) ] [type.boolean ] [type.byte ] diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua.lux index c6cd63bf3..f28998159 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua.lux @@ -6,7 +6,7 @@ [runtime (#+ Phase)] ["#." primitive] ["#." structure] - ["#." reference ("#@." system)] + ["#." reference ("#\." system)] ["#." case] ["#." loop] ["#." function] @@ -16,14 +16,14 @@ [analysis (#+)] ["." synthesis] ["//#" /// #_ - ["#." phase ("#@." monad)]]]]]) + ["#." phase ("#\." monad)]]]]]) (def: #export (generate archive synthesis) Phase (case synthesis (^template [ ] [(^ ( value)) - (//////phase@wrap ( value))]) + (//////phase\wrap ( value))]) ([synthesis.bit /primitive.bit] [synthesis.i64 /primitive.i64] [synthesis.f64 /primitive.f64] @@ -36,7 +36,7 @@ (/structure.tuple generate archive members) (#synthesis.Reference value) - (/reference@reference archive value) + (/reference\reference archive value) (^ (synthesis.branch/case case)) (/case.case generate archive case) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/case.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/case.lux index 738912f52..5ef6bb4b3 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/case.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/case.lux @@ -12,7 +12,7 @@ ["n" nat] ["i" int]] [collection - ["." list ("#@." functor fold)] + ["." list ("#\." functor fold)] ["." set]]] [target ["_" php (#+ Var Expression Statement)]]] @@ -22,7 +22,7 @@ ["#." primitive] ["#/" // ["#." reference] - ["#/" // ("#@." monad) + ["#/" // ("#\." monad) [synthesis ["." case]] ["#/" // #_ @@ -51,7 +51,7 @@ (Operation (Expression Any))) (do ////.monad [valueG (generate valueS)] - (wrap (list@fold (function (_ side source) + (wrap (list\fold (function (_ side source) (.let [method (.case side (^template [ ] [( lefts) @@ -143,14 +143,14 @@ (:: ////.monad map _.return (generate bodyS)) #/////synthesis.Pop - (////@wrap ..pop!) + (////\wrap ..pop!) (#/////synthesis.Bind register) - (////@wrap (_.; (_.set (..register register) ..peek))) + (////\wrap (_.; (_.set (..register register) ..peek))) (^template [ ] [(^ ( value)) - (////@wrap (_.when (|> value (_.= ..peek) _.not) + (////\wrap (_.when (|> value (_.= ..peek) _.not) fail!))]) ([/////synthesis.path/bit //primitive.bit] [/////synthesis.path/i64 //primitive.i64] @@ -159,7 +159,7 @@ (^template [ ] [(^ ( idx)) - (////@wrap ( false idx)) + (////\wrap ( false idx)) (^ ( idx nextP)) (|> nextP @@ -169,18 +169,18 @@ [/////synthesis.side/right /////synthesis.simple-right-side ..right-choice]) (^ (/////synthesis.member/left 0)) - (////@wrap (|> ..peek (_.nth (_.int +0)) ..push!)) + (////\wrap (|> ..peek (_.nth (_.int +0)) ..push!)) (^template [ ] [(^ ( lefts)) - (////@wrap (|> ..peek ( (_.int (.int lefts))) ..push!))]) + (////\wrap (|> ..peek ( (_.int (.int lefts))) ..push!))]) ([/////synthesis.member/left //runtime.tuple//left] [/////synthesis.member/right //runtime.tuple//right]) (^ (/////synthesis.!bind-top register thenP)) (do ////.monad [then! (pattern-matching' generate thenP)] - (////@wrap ($_ _.then + (////\wrap ($_ _.then (_.; (_.set (..register register) ..peek-and-pop)) then!))) @@ -188,7 +188,7 @@ ## (.let [[extra-pops nextP'] (case.count-pops nextP)] ## (do ////.monad ## [next! (pattern-matching' generate nextP')] - ## (////@wrap ($_ _.then + ## (////\wrap ($_ _.then ## (..multi-pop! (n.+ 2 extra-pops)) ## next!)))) @@ -226,7 +226,7 @@ #let [@dependencies+ (|> (case.storage pathP) (get@ #case.dependencies) set.to-list - (list@map (function (_ variable) + (list\map (function (_ variable) [#0 (.case variable (#reference.Local register) (..register register) @@ -245,5 +245,5 @@ (_.; (_.set @caseG @caseL)))] _ (///.execute! directive) _ (///.save! @case directive)] - (wrap (_.apply/* (list& initG (list@map product.right @dependencies+)) + (wrap (_.apply/* (list& initG (list\map product.right @dependencies+)) @caseG)))) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/function.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/function.lux index 58fb0a4b9..e021f5234 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/function.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/function.lux @@ -8,7 +8,7 @@ ["." product] ["." text] [collection - ["." list ("#@." functor fold)]]] + ["." list ("#\." functor fold)]]] [target ["_" php (#+ Argument Expression Statement)]]] ["." // #_ @@ -55,7 +55,7 @@ @selfG (_.global function-name) @selfL (_.var function-name) initialize-self! (_.; (_.set (//case.register 0) @selfL)) - initialize! (list@fold (.function (_ post pre!) + initialize! (list\fold (.function (_ post pre!) ($_ _.then pre! (_.; (_.set (..input post) (_.nth (|> post .int _.int) @curried))))) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/loop.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/loop.lux index 000789484..f94470be8 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/loop.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/loop.lux @@ -9,7 +9,7 @@ [text ["%" format (#+ format)]] [collection - ["." list ("#@." functor)]]] + ["." list ("#\." functor)]]] [target ["_" php (#+ Expression)]]] ["." // #_ @@ -35,7 +35,7 @@ (_.closure (list (_.reference @loopL)) (|> initsS+ list.enumeration - (list@map (|>> product.left (n.+ start) //case.register [#0]))) + (list\map (|>> product.left (n.+ start) //case.register [#0]))) (_.return bodyO))) (_.; (_.set @loopG @loopL)))] _ (///.execute! directive) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux index c7a8a4eeb..88a8897f2 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux @@ -12,7 +12,7 @@ ["." text ["%" format (#+ format)]] [collection - ["." list ("#@." functor)]]] + ["." list ("#\." functor)]]] ["." macro ["." code] [syntax (#+ syntax:)]] @@ -91,7 +91,7 @@ (syntax: #export (with-vars {vars (s.tuple (p.some s.local-identifier))} body) (wrap (list (` (let [(~+ (|> vars - (list@map (function (_ var) + (list\map (function (_ var) (list (code.local-identifier var) (` (_.var (~ (code.text (/////name.normalize var)))))))) list.concat))] @@ -116,8 +116,8 @@ (#.Right [name inputs]) (let [code-nameC (code.local-identifier (format "@" name)) runtime-nameC (` (runtime-name (~ (code.text name)))) - inputsC (list@map code.local-identifier inputs) - inputs-typesC (list@map (function.constant (` (_.Expression Any))) + inputsC (list\map code.local-identifier inputs) + inputs-typesC (list\map (function.constant (` (_.Expression Any))) inputs)] (wrap (list (` (def: #export ((~ (code.local-identifier name)) (~+ inputsC)) (-> (~+ inputs-typesC) (_.Computation Any)) @@ -133,7 +133,7 @@ (_.set (~ g!L)) (_.closure (list (_.reference (~ g!L))) (list (~+ (|> inputsC - (list@map (function (_ inputC) + (list\map (function (_ inputC) (` [#0 (~ inputC)])))))) (~ code))) (_.; (_.set (~ g!G) (~ g!L))) @@ -161,7 +161,8 @@ Statement ($_ _.then @lux//try - @lux//program-args)) + @lux//program-args + )) (runtime: (io//throw! message) ($_ _.then @@ -171,7 +172,8 @@ (def: runtime//io Statement ($_ _.then - @io//throw!)) + @io//throw! + )) (def: tuple-size _.count/1) @@ -245,7 +247,8 @@ ($_ _.then @tuple//left @tuple//right - @sum//get)) + @sum//get + )) (runtime: (i64//logic-right-shift param subject) (let [mask (|> (_.int +1) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/case.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/case.lux index e25155d4a..4d5fc7f06 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/case.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/case.lux @@ -11,7 +11,7 @@ ["n" nat] ["i" int]] [collection - ["." list ("#@." functor fold)] + ["." list ("#\." functor fold)] ["." set]]] [target ["_" python (#+ Expression SVar Statement)]]] @@ -28,7 +28,7 @@ ["#." generation] ["//#" /// #_ ["#." reference (#+ Register)] - ["#." phase ("#@." monad)] + ["#." phase ("#\." monad)] [meta [archive (#+ Archive)]]]]]]]) @@ -52,7 +52,7 @@ (Generator [Synthesis (List (Either Nat Nat))]) (do ///////phase.monad [valueO (generate archive valueS)] - (wrap (list@fold (function (_ side source) + (wrap (list\fold (function (_ side source) (.let [method (.case side (^template [ ] [( lefts) @@ -138,17 +138,17 @@ (-> Phase Archive Path (Operation (Statement Any))) (.case pathP (^ (/////synthesis.path/then bodyS)) - (///////phase@map _.return (generate archive bodyS)) + (///////phase\map _.return (generate archive bodyS)) #/////synthesis.Pop - (///////phase@wrap ..pop!) + (///////phase\wrap ..pop!) (#/////synthesis.Bind register) - (///////phase@wrap (_.set (list (..register register)) ..peek)) + (///////phase\wrap (_.set (list (..register register)) ..peek)) (^template [ ] [(^ ( value)) - (///////phase@wrap (_.when (|> value (_.= ..peek) _.not) + (///////phase\wrap (_.when (|> value (_.= ..peek) _.not) fail-pm!))]) ([/////synthesis.path/bit //primitive.bit] [/////synthesis.path/i64 //primitive.i64] @@ -157,28 +157,28 @@ (^template [ ] [(^ ( idx)) - (///////phase@wrap ( false idx)) + (///////phase\wrap ( false idx)) (^ ( idx nextP)) (|> nextP (pattern-matching' generate archive) - (///////phase@map (_.then ( true idx))))]) + (///////phase\map (_.then ( true idx))))]) ([/////synthesis.side/left /////synthesis.simple-left-side ..left-choice] [/////synthesis.side/right /////synthesis.simple-right-side ..right-choice]) (^ (/////synthesis.member/left 0)) - (///////phase@wrap (|> ..peek (_.nth (_.int +0)) ..push!)) + (///////phase\wrap (|> ..peek (_.nth (_.int +0)) ..push!)) (^template [ ] [(^ ( lefts)) - (///////phase@wrap (|> ..peek ( (_.int (.int lefts))) ..push!))]) + (///////phase\wrap (|> ..peek ( (_.int (.int lefts))) ..push!))]) ([/////synthesis.member/left //runtime.tuple//left] [/////synthesis.member/right //runtime.tuple//right]) (^ (/////synthesis.!bind-top register thenP)) (do ///////phase.monad [then! (pattern-matching' generate archive thenP)] - (///////phase@wrap ($_ _.then + (///////phase\wrap ($_ _.then (_.set (list (..register register)) ..peek-and-pop) then!))) @@ -186,7 +186,7 @@ (.let [[extra-pops nextP'] (case.count-pops nextP)] (do ///////phase.monad [next! (pattern-matching' generate archive nextP')] - (///////phase@wrap ($_ _.then + (///////phase\wrap ($_ _.then (..multi-pop! (n.+ 2 extra-pops)) next!)))) @@ -210,7 +210,7 @@ (def: (gensym prefix) (-> Text (Operation SVar)) - (///////phase@map (|>> %.nat (format prefix) _.var) /////generation.next)) + (///////phase\map (|>> %.nat (format prefix) _.var) /////generation.next)) (def: #export (case generate archive [valueS pathP]) (Generator [Synthesis Path]) @@ -222,7 +222,7 @@ #let [@dependencies+ (|> (case.storage pathP) (get@ #case.dependencies) set.to-list - (list@map (function (_ variable) + (list\map (function (_ variable) (.case variable (#///////reference.Local register) (..register register) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/function.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/function.lux index 043941530..28e8867a0 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/function.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/function.lux @@ -7,7 +7,7 @@ [data ["." product] [collection - ["." list ("#@." functor fold)]]] + ["." list ("#\." functor fold)]]] [target ["_" python (#+ Expression Statement)]]] ["." // #_ @@ -49,7 +49,7 @@ [@closure (:: ! map _.var (/////generation.gensym "closure")) #let [directive (_.def @closure (|> (list.enumeration inits) - (list@map (|>> product.left ..capture))) + (list\map (|>> product.left ..capture))) ($_ _.then function-definition (_.return (_.var function-name))))] @@ -79,7 +79,7 @@ apply-poly (.function (_ args func) (_.apply-poly (list) args func)) initialize-self! (_.set (list (//case.register 0)) @self) - initialize! (list@fold (.function (_ post pre!) + initialize! (list\fold (.function (_ post pre!) ($_ _.then pre! (_.set (list (..input post)) (_.nth (|> post .int _.int) @curried)))) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/loop.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/loop.lux index 49fd86575..e8f2bd5f7 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/loop.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/loop.lux @@ -9,7 +9,7 @@ [text ["%" format (#+ format)]] [collection - ["." list ("#@." functor)]]] + ["." list ("#\." functor)]]] [target ["_" python (#+ Expression SVar)]]] ["." // #_ @@ -34,7 +34,7 @@ (generate archive bodyS)) #let [directive (_.def @loop (|> initsS+ list.enumeration - (list@map (|>> product.left (n.+ start) //case.register))) + (list\map (|>> product.left (n.+ start) //case.register))) (_.return bodyO))] _ (/////generation.execute! directive) _ (/////generation.save! (_.code @loop) directive)] diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux index aa49950f0..7469aaa7d 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux @@ -12,7 +12,7 @@ ["." text ["%" format (#+ format)]] [collection - ["." list ("#@." functor)]]] + ["." list ("#\." functor)]]] ["." macro ["." code] [syntax (#+ syntax:)]] @@ -90,7 +90,7 @@ (syntax: #export (with-vars {vars (s.tuple (p.some s.local-identifier))} body) (wrap (list (` (let [(~+ (|> vars - (list@map (function (_ var) + (list\map (function (_ var) (list (code.local-identifier var) (` (_.var (~ (code.text (///reference.sanitize var)))))))) list.concat))] @@ -118,8 +118,8 @@ (let [nameC (code.local-identifier name) code-nameC (code.local-identifier (format "@" name)) runtime-nameC (` (runtime-name (~ (code.text name)))) - inputsC (list@map code.local-identifier inputs) - inputs-typesC (list@map (function.constant (` (_.Expression Any))) + inputsC (list\map code.local-identifier inputs) + inputs-typesC (list\map (function.constant (` (_.Expression Any))) inputs)] (wrap (list (` (def: #export ((~ nameC) (~+ inputsC)) (-> (~+ inputs-typesC) (Computation Any)) @@ -153,7 +153,8 @@ (Statement Any) ($_ _.then @lux//try - @lux//program-args)) + @lux//program-args + )) (runtime: (io//log! message) ($_ _.then @@ -185,7 +186,8 @@ @io//log! @io//throw! @io//exit! - @io//current-time!)) + @io//current-time! + )) (def: last-index (|>> _.len/1 (_.- (_.int +1)))) @@ -247,7 +249,8 @@ ($_ _.then @tuple//left @tuple//right - @sum//get)) + @sum//get + )) (def: full-64-bits Literal @@ -279,7 +282,8 @@ (Statement Any) ($_ _.then @i64//64 - @i64//logic-right-shift)) + @i64//logic-right-shift + )) (runtime: (frac//decode input) (with-vars [ex] @@ -291,7 +295,8 @@ (def: runtime//frac (Statement Any) ($_ _.then - @frac//decode)) + @frac//decode + )) (runtime: (text//index subject param start) (with-vars [idx] @@ -321,7 +326,8 @@ ($_ _.then @text//index @text//clip - @text//char)) + @text//char + )) (def: runtime (Statement Any) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/structure.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/structure.lux index b564b1d3c..c5edce4a7 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/structure.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/structure.lux @@ -11,13 +11,13 @@ [analysis (#+ Variant Tuple)] ["#." synthesis (#+ Synthesis)] ["//#" /// #_ - ["#." phase ("#@." monad)]]]]) + ["#." phase ("#\." monad)]]]]) (def: #export (tuple generate archive elemsS+) (Generator (Tuple Synthesis)) (case elemsS+ #.Nil - (///////phase@wrap (//primitive.text /////synthesis.unit)) + (///////phase\wrap (//primitive.text /////synthesis.unit)) (#.Cons singletonS #.Nil) (generate archive singletonS) @@ -25,12 +25,12 @@ _ (|> elemsS+ (monad.map ///////phase.monad (generate archive)) - (///////phase@map _.list)))) + (///////phase\map _.list)))) (def: #export (variant generate archive [lefts right? valueS]) (Generator (Variant Synthesis)) (let [tag (if right? (inc lefts) lefts)] - (///////phase@map (//runtime.variant tag right?) + (///////phase\map (//runtime.variant tag right?) (generate archive valueS)))) diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/reference.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/reference.lux index a28e1918f..b587d2963 100644 --- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/reference.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/reference.lux @@ -9,7 +9,7 @@ ["//#" /// #_ ["." reference (#+ Reference) ["." variable (#+ Register Variable)]] - ["." phase ("#@." monad)] + ["." phase ("#\." monad)] [meta [archive (#+ Archive)]]]]) @@ -30,7 +30,7 @@ (All [anchor expression directive] (-> (System expression) Archive Name (////generation.Operation anchor expression directive expression))) - (phase@map (|>> ..artifact (:: system constant)) + (phase\map (|>> ..artifact (:: system constant)) (////generation.remember archive name))) (template [ ] @@ -62,4 +62,4 @@ (..constant system archive value) (#reference.Variable value) - (phase@wrap (..variable system value)))) + (phase\wrap (..variable system value)))) diff --git a/stdlib/source/lux/world/console.lux b/stdlib/source/lux/world/console.lux index 7498b3665..5aafb88d1 100644 --- a/stdlib/source/lux/world/console.lux +++ b/stdlib/source/lux/world/console.lux @@ -59,18 +59,22 @@ (with-expansions [ (as-is (import: java/lang/String) (import: java/io/Console - (readLine [] #io #try java/lang/String)) + ["#::." + (readLine [] #io #try java/lang/String)]) (import: java/io/InputStream - (read [] #io #try int)) + ["#::." + (read [] #io #try int)]) (import: java/io/PrintStream - (print [java/lang/String] #io #try void)) + ["#::." + (print [java/lang/String] #io #try void)]) (import: java/lang/System - (#static console [] #io #? java/io/Console) - (#static in java/io/InputStream) - (#static out java/io/PrintStream)) + ["#::." + (#static console [] #io #? java/io/Console) + (#static in java/io/InputStream) + (#static out java/io/PrintStream)]) (def: #export default (IO (Try (Console IO))) diff --git a/stdlib/source/lux/world/environment.lux b/stdlib/source/lux/world/environment.lux index 09475a548..f86b0c262 100644 --- a/stdlib/source/lux/world/environment.lux +++ b/stdlib/source/lux/world/environment.lux @@ -1,52 +1,67 @@ (.module: [lux #* + ["@" target] [host (#+ import:)] + [control + ["." io (#+ IO)]] [data ["." text] - [format - [context (#+ Context)]] [collection - ["." dictionary]]] - [io (#- run)]]) + ["." dictionary (#+ Dictionary)]]]]) + +(type: #export Property + Text) + +(type: #export Environment + (Dictionary Property Text)) ## Do not trust the values of environment variables ## https://wiki.sei.cmu.edu/confluence/display/java/ENV02-J.+Do+not+trust+the+values+of+environment+variables -(import: java/lang/String) +(with-expansions [ (as-is (import: java/lang/String) -(import: (java/util/Map$Entry k v) - (getKey [] k) - (getValue [] v)) + (import: (java/util/Map$Entry k v) + ["#::." + (getKey [] k) + (getValue [] v)]) -(import: (java/util/Iterator a) - (hasNext [] boolean) - (next [] a)) + (import: (java/util/Iterator a) + ["#::." + (hasNext [] boolean) + (next [] a)]) -(import: (java/util/Set a) - (iterator [] (Iterator a))) + (import: (java/util/Set a) + ["#::." + (iterator [] (java/util/Iterator a))]) -(import: (java/util/Map k v) - (entrySet [] (Set (Map$Entry k v)))) + (import: (java/util/Map k v) + ["#::." + (entrySet [] (java/util/Set (java/util/Map$Entry k v)))]) -(import: java/lang/System - (#static getenv [] (Map String String))) + (import: java/lang/System + ["#::." + (#static getenv [] (java/util/Map java/lang/String java/lang/String))]) -(def: (consume-iterator f iterator) - (All [a b] (-> (-> a b) (Iterator a) (List b))) - (if (Iterator::hasNext iterator) - (#.Cons (f (Iterator::next iterator)) - (consume-iterator f iterator)) - #.Nil)) + (def: (consume f iterator) + (All [a b] (-> (-> a b) (java/util/Iterator a) (List b))) + (if (java/util/Iterator::hasNext iterator) + (#.Cons (f (java/util/Iterator::next iterator)) + (consume f iterator)) + #.Nil)) -(def: (entry-to-kv entry) - (All [k v] (-> (Map$Entry k v) [k v])) - [(Map$Entry::getKey entry) - (Map$Entry::getValue entry)]) + (def: (to-kv entry) + (All [k v] (-> (java/util/Map$Entry k v) [k v])) + [(java/util/Map$Entry::getKey entry) + (java/util/Map$Entry::getValue entry)]))] + (for {@.old (as-is ) + @.jvm (as-is )})) (def: #export read - (IO Context) - (io (|> (System::getenv) - Map::entrySet - Set::iterator - (consume-iterator entry-to-kv) - (dictionary.from-list text.hash)))) + (IO Environment) + (with-expansions [ (as-is (io.io (|> (java/lang/System::getenv) + java/util/Map::entrySet + java/util/Set::iterator + (..consume ..to-kv) + (dictionary.from-list text.hash))))] + (for {@.old + @.jvm }))) diff --git a/stdlib/source/lux/world/file.lux b/stdlib/source/lux/world/file.lux index 00b259c40..cb03aec35 100644 --- a/stdlib/source/lux/world/file.lux +++ b/stdlib/source/lux/world/file.lux @@ -220,23 +220,24 @@ (import: java/lang/String) (`` (import: java/io/File - (new [java/lang/String]) - (~~ (template [] - [( [] #io #try boolean)] - - [createNewFile] [mkdir] - [exists] [delete] - [isFile] [isDirectory] - [canRead] [canWrite] [canExecute])) - - (getName [] java/lang/String) - (length [] #io #try long) - (listFiles [] #io #try #? [java/io/File]) - (getAbsolutePath [] #io #try java/lang/String) - (renameTo [java/io/File] #io #try boolean) - (lastModified [] #io #try long) - (setLastModified [long] #io #try boolean) - (#static separator java/lang/String))) + ["#::." + (new [java/lang/String]) + (~~ (template [] + [( [] #io #try boolean)] + + [createNewFile] [mkdir] + [exists] [delete] + [isFile] [isDirectory] + [canRead] [canWrite] [canExecute])) + + (getName [] java/lang/String) + (length [] #io #try long) + (listFiles [] #io #try #? [java/io/File]) + (getAbsolutePath [] #io #try java/lang/String) + (renameTo [java/io/File] #io #try boolean) + (lastModified [] #io #try long) + (setLastModified [long] #io #try boolean) + (#static separator java/lang/String)])) (template: (!delete path exception) (do io.monad @@ -249,20 +250,25 @@ (wrap (exception.throw exception [path]))))) (import: java/lang/AutoCloseable - (close [] #io #try void)) + ["#::." + (close [] #io #try void)]) (import: java/io/OutputStream - (write [[byte]] #io #try void) - (flush [] #io #try void)) + ["#::." + (write [[byte]] #io #try void) + (flush [] #io #try void)]) (import: java/io/FileOutputStream - (new [java/io/File boolean] #io #try)) + ["#::." + (new [java/io/File boolean] #io #try)]) (import: java/io/InputStream - (read [[byte]] #io #try int)) + ["#::." + (read [[byte]] #io #try int)]) (import: java/io/FileInputStream - (new [java/io/File] #io #try)) + ["#::." + (new [java/io/File] #io #try)]) (`` (structure: (file path) (-> Path (File IO)) diff --git a/stdlib/source/lux/world/shell.lux b/stdlib/source/lux/world/shell.lux index 47215c295..70e6bd8a0 100644 --- a/stdlib/source/lux/world/shell.lux +++ b/stdlib/source/lux/world/shell.lux @@ -178,7 +178,8 @@ (..policy sanitize-command sanitize-argument))) (with-expansions [ (as-is (import: java/lang/String - (toLowerCase [] java/lang/String)) + ["#::." + (toLowerCase [] java/lang/String)]) (def: (jvm::arguments-array arguments) (-> (List Argument) (Array java/lang/String)) @@ -189,7 +190,8 @@ arguments))) (import: (java/util/Map k v) - (put [k v] v)) + ["#::." + (put [k v] v)]) (def: (jvm::load-environment input target) (-> Environment @@ -202,26 +204,31 @@ (dictionary.entries input))) (import: java/io/Reader - (read [] #io #try int)) + ["#::." + (read [] #io #try int)]) (import: java/io/BufferedReader - (new [java/io/Reader]) - (readLine [] #io #try java/lang/String)) + ["#::." + (new [java/io/Reader]) + (readLine [] #io #try java/lang/String)]) (import: java/io/InputStream) (import: java/io/InputStreamReader - (new [java/io/InputStream])) + ["#::." + (new [java/io/InputStream])]) (import: java/io/OutputStream - (write [[byte]] #io #try void)) + ["#::." + (write [[byte]] #io #try void)]) (import: java/lang/Process - (getInputStream [] #io #try java/io/InputStream) - (getErrorStream [] #io #try java/io/InputStream) - (getOutputStream [] #io #try java/io/OutputStream) - (destroy [] #io #try void) - (waitFor [] #io #try int)) + ["#::." + (getInputStream [] #io #try java/io/InputStream) + (getErrorStream [] #io #try java/io/InputStream) + (getOutputStream [] #io #try java/io/OutputStream) + (destroy [] #io #try void) + (waitFor [] #io #try int)]) (def: (default-process process) (-> java/lang/Process (IO (Try (Process IO)))) @@ -262,12 +269,14 @@ )))))))) (import: java/lang/ProcessBuilder - (new [[java/lang/String]]) - (environment [] #io #try (java/util/Map java/lang/String java/lang/String)) - (start [] #io #try java/lang/Process)) + ["#::." + (new [[java/lang/String]]) + (environment [] #io #try (java/util/Map java/lang/String java/lang/String)) + (start [] #io #try java/lang/Process)]) (import: java/lang/System - (#static getProperty [java/lang/String] #io #try java/lang/String)) + ["#::." + (#static getProperty [java/lang/String] #io #try java/lang/String)]) )] (for {@.old (as-is ) @.jvm (as-is )})) diff --git a/stdlib/source/program/aedifex/command/auto.lux b/stdlib/source/program/aedifex/command/auto.lux index 8150fa1f6..0fc223376 100644 --- a/stdlib/source/program/aedifex/command/auto.lux +++ b/stdlib/source/program/aedifex/command/auto.lux @@ -22,20 +22,25 @@ ["#." command (#+ Command)]]]) (import: java/nio/file/WatchKey - (reset [] #io boolean)) + ["#::." + (reset [] #io boolean)]) (import: java/util/concurrent/TimeUnit - (#enum SECONDS)) + ["#::." + (#enum SECONDS)]) (import: java/nio/file/WatchService - (poll [long java/util/concurrent/TimeUnit] #io #try #? java/nio/file/WatchKey) - (poll #as fetch [] #io #try #? java/nio/file/WatchKey)) + ["#::." + (poll [long java/util/concurrent/TimeUnit] #io #try #? java/nio/file/WatchKey) + (poll #as fetch [] #io #try #? java/nio/file/WatchKey)]) (import: java/nio/file/FileSystem - (newWatchService [] #io #try java/nio/file/WatchService)) + ["#::." + (newWatchService [] #io #try java/nio/file/WatchService)]) (import: java/nio/file/FileSystems - (#static getDefault [] java/nio/file/FileSystem)) + ["#::." + (#static getDefault [] java/nio/file/FileSystem)]) (import: java/lang/Object) @@ -44,20 +49,23 @@ (import: (java/nio/file/WatchEvent$Kind a)) (import: java/nio/file/StandardWatchEventKinds - (#static ENTRY_CREATE (java/nio/file/WatchEvent$Kind java/nio/file/Path)) - (#static ENTRY_MODIFY (java/nio/file/WatchEvent$Kind java/nio/file/Path)) - (#static ENTRY_DELETE (java/nio/file/WatchEvent$Kind java/nio/file/Path))) + ["#::." + (#static ENTRY_CREATE (java/nio/file/WatchEvent$Kind java/nio/file/Path)) + (#static ENTRY_MODIFY (java/nio/file/WatchEvent$Kind java/nio/file/Path)) + (#static ENTRY_DELETE (java/nio/file/WatchEvent$Kind java/nio/file/Path))]) (import: java/nio/file/Path - (register [java/nio/file/WatchService [(java/nio/file/WatchEvent$Kind ?)]] #io #try java/nio/file/WatchKey)) + ["#::." + (register [java/nio/file/WatchService [(java/nio/file/WatchEvent$Kind ?)]] #io #try java/nio/file/WatchKey)]) (import: java/io/File - (new [java/lang/String]) - (exists [] #io #try boolean) - (isDirectory [] #io #try boolean) - (listFiles [] #io #try [java/io/File]) - (getAbsolutePath [] #io #try java/lang/String) - (toPath [] java/nio/file/Path)) + ["#::." + (new [java/lang/String]) + (exists [] #io #try boolean) + (isDirectory [] #io #try boolean) + (listFiles [] #io #try [java/io/File]) + (getAbsolutePath [] #io #try java/lang/String) + (toPath [] java/nio/file/Path)]) (def: (targets path) (-> Path (Action (List Path))) diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux index 623a20841..b3a096ea8 100644 --- a/stdlib/source/program/aedifex/command/build.lux +++ b/stdlib/source/program/aedifex/command/build.lux @@ -97,7 +97,8 @@ ## https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html (import: java/lang/System - (#static getProperty [java/lang/String] #io #? java/lang/String)) + ["#::." + (#static getProperty [java/lang/String] #io #? java/lang/String)]) (def: #export working-directory (IO (Try Text)) diff --git a/stdlib/source/program/aedifex/hash.lux b/stdlib/source/program/aedifex/hash.lux index 35e3f17a8..a484b9a0d 100644 --- a/stdlib/source/program/aedifex/hash.lux +++ b/stdlib/source/program/aedifex/hash.lux @@ -25,8 +25,9 @@ (import: java/lang/String) (import: java/security/MessageDigest - (#static getInstance [java/lang/String] java/security/MessageDigest) - (digest [[byte]] [byte])) + ["#::." + (#static getInstance [java/lang/String] java/security/MessageDigest) + (digest [[byte]] [byte])]) (abstract: #export SHA-1 Any) (abstract: #export MD5 Any) diff --git a/stdlib/source/program/aedifex/repository.lux b/stdlib/source/program/aedifex/repository.lux index 5c622d84b..d2ba2c226 100644 --- a/stdlib/source/program/aedifex/repository.lux +++ b/stdlib/source/program/aedifex/repository.lux @@ -95,37 +95,45 @@ (import: java/lang/String) (import: java/lang/AutoCloseable - (close [] #io #try void)) + ["#::." + (close [] #io #try void)]) (import: java/io/OutputStream - (flush [] #io #try void) - (write [[byte]] #io #try void)) + ["#::." + (flush [] #io #try void) + (write [[byte]] #io #try void)]) (import: java/net/URLConnection - (setDoOutput [boolean] #io #try void) - (setRequestProperty [java/lang/String java/lang/String] #io #try void) - (getOutputStream [] #io #try java/io/OutputStream)) + ["#::." + (setDoOutput [boolean] #io #try void) + (setRequestProperty [java/lang/String java/lang/String] #io #try void) + (getOutputStream [] #io #try java/io/OutputStream)]) (import: java/net/HttpURLConnection - (setRequestMethod [java/lang/String] #io #try void) - (getResponseCode [] #io #try int)) + ["#::." + (setRequestMethod [java/lang/String] #io #try void) + (getResponseCode [] #io #try int)]) (import: java/net/URL - (new [java/lang/String]) - (openConnection [] #io #try java/net/URLConnection) - (openStream [] #io #try java/io/InputStream)) + ["#::." + (new [java/lang/String]) + (openConnection [] #io #try java/net/URLConnection) + (openStream [] #io #try java/io/InputStream)]) (import: java/util/Base64$Encoder - (encodeToString [[byte]] java/lang/String)) + ["#::." + (encodeToString [[byte]] java/lang/String)]) (import: java/util/Base64 - (#static getEncoder [] java/util/Base64$Encoder)) + ["#::." + (#static getEncoder [] java/util/Base64$Encoder)]) (import: java/io/InputStream) (import: java/io/BufferedInputStream - (new [java/io/InputStream]) - (read [[byte] int int] #io #try int)) + ["#::." + (new [java/io/InputStream]) + (read [[byte] int int] #io #try int)]) (exception: #export (failure {code Int}) (exception.report diff --git a/stdlib/source/program/aedifex/shell.lux b/stdlib/source/program/aedifex/shell.lux index 0215c08da..e70571667 100644 --- a/stdlib/source/program/aedifex/shell.lux +++ b/stdlib/source/program/aedifex/shell.lux @@ -26,23 +26,28 @@ (import: java/io/Reader) (import: java/io/InputStreamReader - (new [java/io/InputStream])) + ["#::." + (new [java/io/InputStream])]) (import: java/io/BufferedReader - (new [java/io/Reader]) - (readLine [] #io #try java/lang/String)) + ["#::." + (new [java/io/Reader]) + (readLine [] #io #try java/lang/String)]) (import: java/lang/Process - (getInputStream [] java/io/InputStream) - (getErrorStream [] java/io/InputStream) - (waitFor [] #io #try int)) + ["#::." + (getInputStream [] java/io/InputStream) + (getErrorStream [] java/io/InputStream) + (waitFor [] #io #try int)]) (import: java/io/File - (new [java/lang/String])) + ["#::." + (new [java/lang/String])]) (import: java/lang/Runtime - (#static getRuntime [] #io java/lang/Runtime) - (exec [java/lang/String #? [java/lang/String] java/io/File] #io #try java/lang/Process)) + ["#::." + (#static getRuntime [] #io java/lang/Runtime) + (exec [java/lang/String #? [java/lang/String] java/io/File] #io #try java/lang/Process)]) (template [] [(exception: #export ( {working-directory Text} {command Text} {error Text}) diff --git a/stdlib/source/test/lux/abstract/codec.lux b/stdlib/source/test/lux/abstract/codec.lux index 3d7a22bc6..ca45c3c25 100644 --- a/stdlib/source/test/lux/abstract/codec.lux +++ b/stdlib/source/test/lux/abstract/codec.lux @@ -6,7 +6,7 @@ [control ["." try]] [data - ["." bit ("#@." equivalence)] + ["." bit ("#\." equivalence)] [format ["." json (#+ JSON)]]] [math @@ -40,7 +40,7 @@ (_.cover [/.compose] (case (|> expected (:: ..codec encode) (:: ..codec decode)) (#try.Success actual) - (bit@= expected actual) + (bit\= expected actual) (#try.Failure error) false))))) diff --git a/stdlib/source/test/lux/abstract/comonad/cofree.lux b/stdlib/source/test/lux/abstract/comonad/cofree.lux index 6cf767e65..0c75e9f74 100644 --- a/stdlib/source/test/lux/abstract/comonad/cofree.lux +++ b/stdlib/source/test/lux/abstract/comonad/cofree.lux @@ -13,7 +13,7 @@ [data [collection ["." list] - ["." sequence (#+ Sequence) ("#@." comonad)]]] + ["." sequence (#+ Sequence) ("#\." comonad)]]] [math ["." random]]] {1 @@ -21,12 +21,12 @@ (def: (injection value) (Injection (/.CoFree Sequence)) - [value (sequence@map injection (sequence.repeat value))]) + [value (sequence\map injection (sequence.repeat value))]) (def: (interpret [head tail]) (All [a] (-> (/.CoFree Sequence a) (Sequence a))) (|> tail - (sequence@map (:: (/.comonad sequence.functor) unwrap)) + (sequence\map (:: (/.comonad sequence.functor) unwrap)) [head] //.pending)) diff --git a/stdlib/source/test/lux/abstract/enum.lux b/stdlib/source/test/lux/abstract/enum.lux index 17e1d0cce..c79a7e4c0 100644 --- a/stdlib/source/test/lux/abstract/enum.lux +++ b/stdlib/source/test/lux/abstract/enum.lux @@ -5,11 +5,11 @@ [monad (#+ do)]] [data ["." product] - ["." maybe ("#@." functor)] + ["." maybe ("#\." functor)] [number ["n" nat]] [collection - ["." list ("#@." fold)]]] + ["." list ("#\." fold)]]] [math ["." random (#+ Random)]]] {1 @@ -30,14 +30,14 @@ ($_ _.and (_.cover [/.range] (let [expected-size (|> end (n.- start) inc) - expected-start? (|> range list.head (maybe@map (n.= start)) (maybe.default false)) - expected-end? (|> range list.last (maybe@map (n.= end)) (maybe.default false)) + expected-start? (|> range list.head (maybe\map (n.= start)) (maybe.default false)) + expected-end? (|> range list.last (maybe\map (n.= end)) (maybe.default false)) can-be-backwards? (:: (list.equivalence n.equivalence) = (/.range n.enum start end) (list.reverse (/.range n.enum end start))) every-element-is-a-successor? (case range (#.Cons head tail) - (|> (list@fold (function (_ next [verdict prev]) + (|> (list\fold (function (_ next [verdict prev]) [(and verdict (n.= next (:: n.enum succ prev))) next]) diff --git a/stdlib/source/test/lux/abstract/equivalence.lux b/stdlib/source/test/lux/abstract/equivalence.lux index ee097034f..ae065c031 100644 --- a/stdlib/source/test/lux/abstract/equivalence.lux +++ b/stdlib/source/test/lux/abstract/equivalence.lux @@ -8,7 +8,7 @@ [functor ["$." contravariant]]]}] [data - ["." bit ("#@." equivalence)] + ["." bit ("#\." equivalence)] [number ["n" nat] ["i" int]]] @@ -29,11 +29,11 @@ #let [equivalence (: (Equivalence (Equivalence Nat)) (structure (def: (= left right) - (and (bit@= (:: left = leftN leftN) + (and (bit\= (:: left = leftN leftN) (:: right = leftN leftN)) - (bit@= (:: left = rightN rightN) + (bit\= (:: left = rightN rightN) (:: right = rightN rightN)) - (bit@= (:: left = leftN rightN) + (bit\= (:: left = leftN rightN) (:: right = leftN rightN))))))]] (<| (_.covering /._) ($_ _.and @@ -41,20 +41,20 @@ ($contravariant.spec equivalence n.equivalence /.functor)) (_.cover [/.sum] (let [equivalence (/.sum n.equivalence i.equivalence)] - (and (bit@= (:: n.equivalence = leftN leftN) + (and (bit\= (:: n.equivalence = leftN leftN) (:: equivalence = (#.Left leftN) (#.Left leftN))) - (bit@= (:: n.equivalence = leftN rightN) + (bit\= (:: n.equivalence = leftN rightN) (:: equivalence = (#.Left leftN) (#.Left rightN))) - (bit@= (:: i.equivalence = leftI leftI) + (bit\= (:: i.equivalence = leftI leftI) (:: equivalence = (#.Right leftI) (#.Right leftI))) - (bit@= (:: i.equivalence = leftI rightI) + (bit\= (:: i.equivalence = leftI rightI) (:: equivalence = (#.Right leftI) (#.Right rightI)))))) (_.cover [/.product] (let [equivalence (/.product n.equivalence i.equivalence)] - (and (bit@= (and (:: n.equivalence = leftN leftN) + (and (bit\= (and (:: n.equivalence = leftN leftN) (:: i.equivalence = leftI leftI)) (:: equivalence = [leftN leftI] [leftN leftI])) - (bit@= (and (:: n.equivalence = leftN rightN) + (bit\= (and (:: n.equivalence = leftN rightN) (:: i.equivalence = leftI rightI)) (:: equivalence = [leftN leftI] [rightN rightI]))))) (_.cover [/.rec] diff --git a/stdlib/source/test/lux/abstract/interval.lux b/stdlib/source/test/lux/abstract/interval.lux index 7aea3a1c5..0c8355a49 100644 --- a/stdlib/source/test/lux/abstract/interval.lux +++ b/stdlib/source/test/lux/abstract/interval.lux @@ -18,7 +18,7 @@ [math ["." random (#+ Random)]]] {1 - ["." / (#+ Interval) ("#@." equivalence)]}) + ["." / (#+ Interval) ("\." equivalence)]}) (template [ ] [(def: #export @@ -94,7 +94,7 @@ right-outer ..outer] ($_ _.and (_.test "The union of an interval to itself yields the same interval." - (/@= some-interval (/.union some-interval some-interval))) + (\= some-interval (/.union some-interval some-interval))) (_.test "The union of 2 inner intervals is another inner interval." (/.inner? (/.union left-inner right-inner))) (_.test "The union of 2 outer intervals yields an inner interval when their complements don't overlap, and an outer when they do." @@ -115,7 +115,7 @@ right-outer ..outer] ($_ _.and (_.test "The intersection of an interval to itself yields the same interval." - (/@= some-interval (/.intersection some-interval some-interval))) + (\= some-interval (/.intersection some-interval some-interval))) (_.test "The intersection of 2 inner intervals yields an inner interval when they overlap, and an outer when they don't." (if (/.overlaps? left-inner right-inner) (/.inner? (/.intersection left-inner right-inner)) @@ -130,7 +130,7 @@ [some-interval ..interval] ($_ _.and (_.test "The complement of a complement is the same as the original." - (/@= some-interval (|> some-interval /.complement /.complement))) + (\= some-interval (|> some-interval /.complement /.complement))) (_.test "The complement of an interval does not overlap it." (not (/.overlaps? some-interval (/.complement some-interval)))) ))) diff --git a/stdlib/source/test/lux/abstract/monad.lux b/stdlib/source/test/lux/abstract/monad.lux index 61ee28f0e..14529fdc5 100644 --- a/stdlib/source/test/lux/abstract/monad.lux +++ b/stdlib/source/test/lux/abstract/monad.lux @@ -5,7 +5,7 @@ [number ["n" nat]] [collection - ["." list ("#@." functor fold)]]] + ["." list ("#\." functor fold)]]] [math ["." random]] ["_" test (#+ Test)]] @@ -33,15 +33,15 @@ (:: identity.monad wrap mono))))) (_.cover [/.seq] (:: (list.equivalence n.equivalence) = - (list@map inc poly) + (list\map inc poly) (|> poly - (list@map (|>> inc (:: identity.monad wrap))) + (list\map (|>> inc (:: identity.monad wrap))) (: (List (Identity Nat))) (/.seq identity.monad) (: (Identity (List Nat)))))) (_.cover [/.map] (:: (list.equivalence n.equivalence) = - (list@map inc poly) + (list\map inc poly) (|> poly (/.map identity.monad (|>> inc (:: identity.monad wrap))) (: (Identity (List Nat)))))) @@ -52,7 +52,7 @@ (/.filter identity.monad (|>> n.even? (:: identity.monad wrap))) (: (Identity (List Nat)))))) (_.cover [/.fold] - (n.= (list@fold n.+ 0 poly) + (n.= (list\fold n.+ 0 poly) (|> poly (/.fold identity.monad (function (_ part whole) diff --git a/stdlib/source/test/lux/abstract/monad/free.lux b/stdlib/source/test/lux/abstract/monad/free.lux index 366948cdb..48c960d19 100644 --- a/stdlib/source/test/lux/abstract/monad/free.lux +++ b/stdlib/source/test/lux/abstract/monad/free.lux @@ -12,7 +12,7 @@ ["$." monad]]}] [data [collection - ["." list ("#@." functor)]]] + ["." list ("#\." functor)]]] [math ["." random]]] {1 @@ -30,7 +30,7 @@ (#/.Effect effect) (|> effect - (list@map interpret) + (list\map interpret) list.concat))) (def: comparison diff --git a/stdlib/source/test/lux/abstract/order.lux b/stdlib/source/test/lux/abstract/order.lux index d0bbab29b..f330d88ae 100644 --- a/stdlib/source/test/lux/abstract/order.lux +++ b/stdlib/source/test/lux/abstract/order.lux @@ -8,7 +8,7 @@ [functor ["$." contravariant]]]}] [data - ["." bit ("#@." equivalence)] + ["." bit ("#\." equivalence)] [number ["n" nat]]] [math @@ -27,11 +27,11 @@ #let [equivalence (: (Equivalence (/.Order Nat)) (structure (def: (= leftO rightO) - (and (bit@= (:: leftO < left left) + (and (bit\= (:: leftO < left left) (:: rightO < left left)) - (bit@= (:: leftO < right right) + (bit\= (:: leftO < right right) (:: rightO < right right)) - (bit@= (:: leftO < left right) + (bit\= (:: leftO < left right) (:: rightO < left right))))))]]) ($_ _.and (_.with-cover [/.functor] @@ -40,16 +40,16 @@ (n.< (/.max n.order left right) (/.min n.order left right))) (_.cover [/.Comparison /.>] - (not (bit@= (n.< left right) + (not (bit\= (n.< left right) (/.> n.order left right)))) (_.cover [/.<=] (and (/.<= n.order left left) (/.<= n.order right right) - (bit@= (:: n.order < left right) + (bit\= (:: n.order < left right) (/.<= n.order left right)))) (_.cover [/.>=] (and (/.>= n.order left left) (/.>= n.order right right) - (bit@= (/.> n.order left right) + (bit\= (/.> n.order left right) (/.>= n.order left right)))) ))) diff --git a/stdlib/source/test/lux/abstract/predicate.lux b/stdlib/source/test/lux/abstract/predicate.lux index cf7f4f074..8bf5c05f0 100644 --- a/stdlib/source/test/lux/abstract/predicate.lux +++ b/stdlib/source/test/lux/abstract/predicate.lux @@ -12,7 +12,7 @@ [control ["." function]] [data - ["." bit ("#@." equivalence)] + ["." bit ("#\." equivalence)] [number ["n" nat]] [collection @@ -37,7 +37,7 @@ #let [equivalence (: (Equivalence (/.Predicate Nat)) (structure (def: (= left right) - (bit@= (left sample) + (bit\= (left sample) (right sample)))))]]) (_.with-cover [/.Predicate]) ($_ _.and @@ -54,24 +54,24 @@ ($monoid.spec equivalence /.intersection generator)))) (_.cover [/.none] - (bit@= false (/.none sample))) + (bit\= false (/.none sample))) (_.cover [/.all] - (bit@= true (/.all sample))) + (bit\= true (/.all sample))) (_.cover [/.unite] - (bit@= (/.all sample) + (bit\= (/.all sample) ((/.unite /.none /.all) sample))) (_.cover [/.intersect] - (bit@= (/.none sample) + (bit\= (/.none sample) ((/.intersect /.none /.all) sample))) (_.cover [/.complement] - (and (not (bit@= (/.none sample) + (and (not (bit\= (/.none sample) ((/.complement /.none) sample))) - (not (bit@= (/.all sample) + (not (bit\= (/.all sample) ((/.complement /.all) sample))))) (_.cover [/.difference] (let [/2? (multiple? 2) /3? (multiple? 3)] - (bit@= (and (/2? sample) + (bit\= (and (/2? sample) (not (/3? sample))) ((/.difference /3? /2?) sample)))) (_.cover [/.rec] @@ -86,6 +86,6 @@ (#.Cons head tail) (or (even? head) (recur tail)))))))] - (bit@= (list.any? even? samples) + (bit\= (list.any? even? samples) (any-even? samples)))) ))) diff --git a/stdlib/source/test/lux/control/exception.lux b/stdlib/source/test/lux/control/exception.lux index db97197e3..2075913a5 100644 --- a/stdlib/source/test/lux/control/exception.lux +++ b/stdlib/source/test/lux/control/exception.lux @@ -5,7 +5,7 @@ [data [number ["n" nat]] - ["." text ("#@." equivalence) + ["." text ("#\." equivalence) ["%" format (#+ format)]]] [math ["." random]] @@ -50,7 +50,7 @@ false (#try.Failure message) - (text@= message (/.construct ..an-exception [])))) + (text\= message (/.construct ..an-exception [])))) (_.cover [/.match?] (/.match? ..an-exception (/.construct ..an-exception []))) @@ -61,7 +61,7 @@ (#try.Failure message) (and (not assertion-succeeded?) - (text@= message (/.construct ..an-exception []))))) + (text\= message (/.construct ..an-exception []))))) (_.cover [/.catch] (and (n.= expected (|> (/.throw ..an-exception []) @@ -96,7 +96,7 @@ (#try.Failure _) false) (case (/.with ..an-exception [] (#try.Failure "")) (#try.Success _) false - (#try.Failure message) (text@= message (/.construct ..an-exception []))) + (#try.Failure message) (text\= message (/.construct ..an-exception []))) (case (/.with ..an-exception [] (: (Try Nat) (/.throw ..another-exception []))) diff --git a/stdlib/source/test/lux/control/parser.lux b/stdlib/source/test/lux/control/parser.lux index a8c91fbaf..9acf45684 100644 --- a/stdlib/source/test/lux/control/parser.lux +++ b/stdlib/source/test/lux/control/parser.lux @@ -16,10 +16,10 @@ [data [number ["n" nat]] - ["." text ("#@." equivalence) + ["." text ("#\." equivalence) ["%" format (#+ format)]] [collection - ["." list ("#@." functor)]]] + ["." list ("#\." functor)]]] [math ["." random]] [macro @@ -32,7 +32,7 @@ (All [a] (-> Text (Try a) Bit)) (case input (#try.Failure actual) - (text@= expected actual) + (text\= expected actual) _ #0)) @@ -92,16 +92,16 @@ (match #.None #1)))) (_.cover [/.some] - (and (|> (list@map code.nat expected+) + (and (|> (list\map code.nat expected+) (/.run (/.some s.nat)) (match actual (:: (list.equivalence n.equivalence) = expected+ actual))) - (|> (list@map (|>> .int code.int) expected+) + (|> (list\map (|>> .int code.int) expected+) (/.run (/.some s.nat)) (match #.Nil #1)))) (_.cover [/.many] - (and (|> (list@map code.nat expected+) + (and (|> (list\map code.nat expected+) (/.run (/.many s.nat)) (match actual (:: (list.equivalence n.equivalence) = expected+ actual))) @@ -109,7 +109,7 @@ (/.run (/.many s.nat)) (match (list actual) (n.= expected0 actual))) - (|> (list@map (|>> .int code.int) expected+) + (|> (list\map (|>> .int code.int) expected+) (/.run (/.many s.nat)) fails?))) (_.cover [/.filter] @@ -174,64 +174,64 @@ separator (random.ascii 1)] ($_ _.and (_.cover [/.exactly] - (and (|> (list@map code.nat expected+) + (and (|> (list\map code.nat expected+) (/.run (/.exactly times s.nat)) (match actual (:: (list.equivalence n.equivalence) = (list.take times expected+) actual))) - (|> (list@map code.nat expected+) + (|> (list\map code.nat expected+) (/.run (/.exactly (inc variadic) s.nat)) fails?))) (_.cover [/.at-least] - (and (|> (list@map code.nat expected+) + (and (|> (list\map code.nat expected+) (/.run (/.at-least times s.nat)) (match actual (:: (list.equivalence n.equivalence) = expected+ actual))) - (|> (list@map code.nat expected+) + (|> (list\map code.nat expected+) (/.run (/.at-least (inc variadic) s.nat)) fails?))) (_.cover [/.at-most] - (and (|> (list@map code.nat expected+) + (and (|> (list\map code.nat expected+) (/.run (/.at-most times s.nat)) (match actual (:: (list.equivalence n.equivalence) = (list.take times expected+) actual))) - (|> (list@map code.nat expected+) + (|> (list\map code.nat expected+) (/.run (/.at-most (inc variadic) s.nat)) (match actual (:: (list.equivalence n.equivalence) = expected+ actual))))) (_.cover [/.between] - (and (|> (list@map code.nat expected+) + (and (|> (list\map code.nat expected+) (/.run (/.between times variadic s.nat)) (match actual (:: (list.equivalence n.equivalence) = expected+ actual))) - (|> (list@map code.nat (list.take times expected+)) + (|> (list\map code.nat (list.take times expected+)) (/.run (/.between times variadic s.nat)) (match actual (:: (list.equivalence n.equivalence) = (list.take times expected+) actual))))) (_.cover [/.sep-by] - (|> (list.interpose (code.text separator) (list@map code.nat expected+)) + (|> (list.interpose (code.text separator) (list\map code.nat expected+)) (/.run (/.sep-by (s.this! (code.text separator)) s.nat)) (match actual (:: (list.equivalence n.equivalence) = expected+ actual)))) (_.cover [/.remaining] - (|> (list@map code.nat expected+) + (|> (list\map code.nat expected+) (/.run /.remaining) (match actual (:: (list.equivalence code.equivalence) = - (list@map code.nat expected+) + (list\map code.nat expected+) actual)))) (_.cover [/.default] (and (|> (/.run (/.default wrong (:: /.monad wrap expected)) (list)) @@ -298,14 +298,19 @@ (list (code.nat odd))) fails?))) (_.cover [/.speculative] - (and (|> (/.run (/.and (/.speculative even^) nat^) - (list (code.nat even))) - (match [speculation actual] - (and (n.= speculation actual) - (n.= expected actual)))) - (|> (/.run (/.and (/.speculative even^) nat^) - (list (code.nat odd))) - fails?))) + (let [happy-path! + (|> (/.run (/.and (/.speculative even^) nat^) + (list (code.nat even))) + (match [speculation actual] + (and (n.= speculation actual) + (n.= even actual)))) + + sad-path! + (|> (/.run (/.and (/.speculative even^) nat^) + (list (code.nat odd))) + fails?)] + (and happy-path! + sad-path!))) (_.cover [/.codec] (|> (/.run (/.codec n.decimal s.text) (list (code.text (%.nat expected)))) diff --git a/stdlib/source/test/lux/control/parser/analysis.lux b/stdlib/source/test/lux/control/parser/analysis.lux index dca66b9ef..f09967760 100644 --- a/stdlib/source/test/lux/control/parser/analysis.lux +++ b/stdlib/source/test/lux/control/parser/analysis.lux @@ -9,9 +9,9 @@ ["." exception] ["<>" parser]] [data - ["." name ("#@." equivalence)] - ["." bit ("#@." equivalence)] - ["." text ("#@." equivalence)] + ["." name ("#\." equivalence)] + ["." bit ("#\." equivalence)] + ["." text ("#\." equivalence)] [number ["n" nat] ["i" int] @@ -79,15 +79,15 @@ (/.run ( expected)) (!expect (#try.Success _)))))] - [/.bit /.bit! random.bit analysis.bit bit@=] + [/.bit /.bit! random.bit analysis.bit bit\=] [/.nat /.nat! random.nat analysis.nat n.=] [/.int /.int! random.int analysis.int i.=] [/.frac /.frac! random.safe-frac analysis.frac f.=] [/.rev /.rev! random.rev analysis.rev r.=] - [/.text /.text! (random.unicode 10) analysis.text text@=] + [/.text /.text! (random.unicode 10) analysis.text text\=] [/.local /.local! random.nat analysis.variable/local n.=] [/.foreign /.foreign! random.nat analysis.variable/foreign n.=] - [/.constant /.constant! ..constant analysis.constant name@=] + [/.constant /.constant! ..constant analysis.constant name\=] )) (do {! random.monad} [expected random.bit] @@ -95,7 +95,7 @@ (|> (list (analysis.tuple (list (analysis.bit expected)))) (/.run (/.tuple /.bit)) (case> (#try.Success actual) - (bit@= expected actual) + (bit\= expected actual) (#try.Failure _) false)))) diff --git a/stdlib/source/test/lux/control/parser/binary.lux b/stdlib/source/test/lux/control/parser/binary.lux index b02a94f0f..9e4c06f18 100644 --- a/stdlib/source/test/lux/control/parser/binary.lux +++ b/stdlib/source/test/lux/control/parser/binary.lux @@ -16,7 +16,7 @@ ["." maybe] ["." bit] ["." name] - ["." text ("#@." equivalence) + ["." text ("#\." equivalence) ["." encoding] ["%" format (#+ format)]] ["." format #_ @@ -55,7 +55,7 @@ encoding.to-utf8 encoding.from-utf8 (case> (#try.Success converted) - (text@= value converted) + (text\= value converted) (#try.Failure error) false))) @@ -74,7 +74,7 @@ (def: (= [expected-module expected-line expected-column] [sample-module sample-line sample-column]) - (and (text@= expected-module sample-module) + (and (text\= expected-module sample-module) (n.= expected-line sample-line) (n.= expected-column sample-column)))) @@ -128,7 +128,7 @@ [(do {! random.monad} [expected (:: ! map (i64.and (i64.mask )) random.nat)] - (_.cover [ ] + (_.cover [ ] (|> (format.run expected) (/.run ) (!expect (^multi (#try.Success actual) @@ -147,7 +147,7 @@ (~~ (template [ ] [(do {! random.monad} [expected (:: ! map encoding.to-utf8 (random.ascii ..segment-size))] - (_.cover [] + (_.cover [ ] (|> (format.run expected) (/.run ) (!expect (^multi (#try.Success actual) @@ -165,7 +165,7 @@ (~~ (template [ ] [(do {! random.monad} [expected (random.ascii ..segment-size)] - (_.cover [] + (_.cover [ ] (|> (format.run expected) (/.run ) (!expect (^multi (#try.Success actual) @@ -175,7 +175,7 @@ [/.utf8/16 format.utf8/16] [/.utf8/32 format.utf8/32] [/.utf8/64 format.utf8/64] - [/.text format.utf8/64] + [/.text format.text] ))))) (def: row @@ -184,7 +184,7 @@ (~~ (template [ ] [(do {! random.monad} [expected (random.row ..segment-size random.nat)] - (_.cover [] + (_.cover [ ] (|> expected (format.run ( format.nat)) (/.run ( /.nat)) @@ -203,7 +203,7 @@ (~~ (template [ ] [(do {! random.monad} [expected ] - (_.cover [] + (_.cover [ ] (|> expected (format.run ) (/.run ) @@ -216,7 +216,7 @@ [/.rev format.rev random.rev rev.equivalence])) (do {! random.monad} [expected random.frac] - (_.cover [/.frac] + (_.cover [/.frac format.frac] (|> expected (format.run format.frac) (/.run /.frac) @@ -242,7 +242,7 @@ (~~ (template [ ] [(do {! random.monad} [expected ] - (_.cover [] + (_.cover [ ] (|> expected (format.run ) (/.run ) @@ -253,20 +253,20 @@ [/.code format.code random-code code.equivalence] [/.type format.type random-type type.equivalence] )) - (~~ (template [ ] + (~~ (template [ ] [(do {! random.monad} [expected ] - (_.cover [] + (_.cover [ ] (|> expected (format.run ) (/.run ) (!expect (^multi (#try.Success actual) (:: = expected actual))))))] - [/.maybe (/.maybe /.nat) (format.maybe format.nat) (random.maybe random.nat) (maybe.equivalence n.equivalence)] - [/.list (/.list /.nat) (format.list format.nat) (random.list ..segment-size random.nat) (list.equivalence n.equivalence)] - [/.set (/.set n.hash /.nat) (format.set format.nat) (random.set n.hash ..segment-size random.nat) set.equivalence] - [/.name /.name format.name ..random-name name.equivalence])) + [/.maybe (/.maybe /.nat) format.maybe (format.maybe format.nat) (random.maybe random.nat) (maybe.equivalence n.equivalence)] + [/.list (/.list /.nat) format.list (format.list format.nat) (random.list ..segment-size random.nat) (list.equivalence n.equivalence)] + [/.set (/.set n.hash /.nat) format.set (format.set format.nat) (random.set n.hash ..segment-size random.nat) set.equivalence] + [/.name /.name format.name format.name ..random-name name.equivalence])) (do {! random.monad} [expected (:: ! map (list.repeat ..segment-size) random.nat)] (_.cover [/.set-elements-are-not-unique] @@ -277,7 +277,7 @@ (exception.match? /.set-elements-are-not-unique error)))))) (do {! random.monad} [expected (random.or random.bit random.nat)] - (_.cover [/.or] + (_.cover [/.or format.or] (|> expected (format.run (format.or format.bit format.nat)) (/.run (: (/.Parser (Either Bit Nat)) @@ -300,9 +300,10 @@ (exception.match? /.invalid-tag error)))))) (do {! random.monad} [expected (random.list ..segment-size random.nat)] - (_.cover [/.rec] + (_.cover [/.rec format.rec format.and format.any] (|> expected - (format.run (format.list format.nat)) + (format.run (format.rec (|>> (format.and format.nat) + (format.or format.any)))) (/.run (: (/.Parser (List Nat)) (/.rec (function (_ recur) @@ -320,8 +321,9 @@ (<| (_.covering /._) (_.with-cover [/.Parser]) (`` ($_ _.and - (_.cover [/.run /.any] - (|> (binary.create 0) + (_.cover [/.run /.any + format.no-op format.instance] + (|> (format.instance format.no-op) (/.run /.any) (!expect (#try.Success _)))) (do {! random.monad} @@ -333,8 +335,9 @@ (exception.match? /.binary-was-not-fully-read error)))))) (do {! random.monad} [expected (:: ! map encoding.to-utf8 (random.ascii ..segment-size))] - (_.cover [/.segment] + (_.cover [/.segment format.segment format.run] (|> expected + (format.run (format.segment ..segment-size)) (/.run (/.segment ..segment-size)) (!expect (^multi (#try.Success actual) (:: binary.equivalence = expected actual)))))) diff --git a/stdlib/source/test/lux/control/parser/cli.lux b/stdlib/source/test/lux/control/parser/cli.lux index 7d90eb49d..1222b9de1 100644 --- a/stdlib/source/test/lux/control/parser/cli.lux +++ b/stdlib/source/test/lux/control/parser/cli.lux @@ -8,8 +8,8 @@ ["<>" parser]] [data [number - ["n" nat ("#@." decimal)]] - ["." text ("#@." equivalence)] + ["n" nat ("#\." decimal)]] + ["." text ("#\." equivalence)] [collection ["." list]]] [math @@ -30,8 +30,8 @@ (<| (_.covering /._) (_.with-cover [/.Parser]) (do {! random.monad} - [expected (:: ! map n@encode random.nat) - #let [random-dummy (random.filter (|>> (text@= expected) not) + [expected (:: ! map n\encode random.nat) + #let [random-dummy (random.filter (|>> (text\= expected) not) (random.unicode 5))] dummy random-dummy short (random.unicode 1) @@ -42,12 +42,12 @@ (_.cover [/.run /.any] (|> (/.run /.any (list expected)) (!expect (^multi (#try.Success actual) - (text@= expected actual))))) + (text\= expected actual))))) (_.cover [/.parse] - (|> (/.run (/.parse n@decode) (list expected)) + (|> (/.run (/.parse n\decode) (list expected)) (!expect (^multi (#try.Success actual) - (text@= expected - (n@encode actual)))))) + (text\= expected + (n\encode actual)))))) (_.cover [/.this] (and (|> (/.run (/.this expected) (list expected)) (!expect (#try.Success _))) @@ -66,16 +66,16 @@ (_.cover [/.named] (|> (/.run (/.named dummy /.any) (list dummy expected)) (!expect (^multi (#try.Success actual) - (text@= expected actual))))) + (text\= expected actual))))) (_.cover [/.parameter] (and (|> (/.run (/.parameter [short long] /.any) (list short expected)) (!expect (^multi (#try.Success actual) - (text@= expected actual)))) + (text\= expected actual)))) (|> (/.run (/.parameter [short long] /.any) (list long expected)) (!expect (^multi (#try.Success actual) - (text@= expected actual)))) + (text\= expected actual)))) (|> (/.run (/.parameter [short long] /.any) (list dummy expected)) (!expect (#try.Failure _))))) diff --git a/stdlib/source/test/lux/control/parser/code.lux b/stdlib/source/test/lux/control/parser/code.lux index a4f25df4d..521704dec 100644 --- a/stdlib/source/test/lux/control/parser/code.lux +++ b/stdlib/source/test/lux/control/parser/code.lux @@ -10,7 +10,7 @@ [data ["." bit] ["." name] - ["." text ("#@." equivalence)] + ["." text] [number ["." nat] ["." int] @@ -19,7 +19,7 @@ [collection ["." list]]] [macro - ["." code ("#@." equivalence)]] + ["." code]] [math ["." random (#+ Random)]]] {1 diff --git a/stdlib/source/test/lux/control/parser/json.lux b/stdlib/source/test/lux/control/parser/json.lux index 4b3bfeb7d..27c508bd5 100644 --- a/stdlib/source/test/lux/control/parser/json.lux +++ b/stdlib/source/test/lux/control/parser/json.lux @@ -16,10 +16,10 @@ ["n" nat] ["." frac]] [collection - ["." list ("#@." functor)] + ["." list ("#\." functor)] ["." set] ["." dictionary] - ["." row (#+ row) ("#@." functor)]] + ["." row (#+ row) ("#\." functor)]] [format ["." json]]] [math @@ -107,7 +107,7 @@ (:: ! map row.from-list))] (_.cover [/.array] (|> (/.run (/.array (<>.some /.string)) - (#json.Array (row@map (|>> #json.String) expected))) + (#json.Array (row\map (|>> #json.String) expected))) (!expect (^multi (#try.Success actual) (:: (row.equivalence text.equivalence) = expected (row.from-list actual))))))) (do {! random.monad} @@ -154,7 +154,7 @@ (|> (/.run (/.dictionary /.string) (#json.Object (|> values - (list@map (|>> #json.String)) + (list\map (|>> #json.String)) (list.zip/2 keys) (dictionary.from-list text.hash)))) (!expect (^multi (#try.Success actual) diff --git a/stdlib/source/test/lux/control/parser/synthesis.lux b/stdlib/source/test/lux/control/parser/synthesis.lux index 4d6a359da..da6e3247f 100644 --- a/stdlib/source/test/lux/control/parser/synthesis.lux +++ b/stdlib/source/test/lux/control/parser/synthesis.lux @@ -19,7 +19,7 @@ ["n" nat] ["." frac]] [collection - ["." list ("#@." functor)]]] + ["." list ("#\." functor)]]] [tool [compiler [reference (#+) @@ -57,10 +57,6 @@ (:: ! map (|>> synthesis.variable)) (random.list size)))) -(def: valid-frac - (Random Frac) - (random.filter (|>> frac.not-a-number? not) random.frac)) - (def: simple Test (`` ($_ _.and @@ -82,7 +78,7 @@ [/.bit /.bit! random.bit synthesis.bit bit.equivalence] [/.i64 /.i64! (:: ! map .i64 random.nat) synthesis.i64 i64.equivalence] - [/.f64 /.f64! ..valid-frac synthesis.f64 frac.equivalence] + [/.f64 /.f64! random.safe-frac synthesis.f64 frac.equivalence] [/.text /.text! (random.unicode 1) synthesis.text text.equivalence] [/.local /.local! random.nat synthesis.variable/local n.equivalence] [/.foreign /.foreign! random.nat synthesis.variable/foreign n.equivalence] @@ -96,7 +92,7 @@ (do {! random.monad} [expected-bit random.bit expected-i64 (:: ! map .i64 random.nat) - expected-f64 ..valid-frac + expected-f64 random.safe-frac expected-text (random.unicode 1)] (_.cover [/.tuple] (and (|> (/.run (/.tuple ($_ <>.and /.bit /.i64 /.f64 /.text)) @@ -117,7 +113,7 @@ [arity random.nat expected-environment ..random-environment expected-body (random.unicode 1)] - (_.cover [/.function /.wrong-arity] + (_.cover [/.function] (and (|> (/.run (/.function arity /.text) (list (synthesis.function/abstraction [expected-environment arity (synthesis.text expected-body)]))) (!expect (^multi (#try.Success [actual-environment actual-body]) @@ -128,11 +124,36 @@ (|> (/.run (/.function arity /.text) (list (synthesis.text expected-body))) (!expect (^multi (#try.Failure error) - (exception.match? /.cannot-parse error)))) - (|> (/.run (/.function (inc arity) /.text) - (list (synthesis.function/abstraction [expected-environment arity (synthesis.text expected-body)]))) + (exception.match? /.cannot-parse error))))))) + (do {! random.monad} + [arity random.nat + expected-environment ..random-environment + expected-body (random.unicode 1)] + (_.cover [/.wrong-arity] + (|> (/.run (/.function (inc arity) /.text) + (list (synthesis.function/abstraction [expected-environment arity (synthesis.text expected-body)]))) + (!expect (^multi (#try.Failure error) + (exception.match? /.wrong-arity error)))))) + (do {! random.monad} + [arity (:: ! map (|>> (n.% 10) inc) random.nat) + expected-offset random.nat + expected-inits (random.list arity random.bit) + expected-body (random.unicode 1)] + (_.cover [/.loop] + (and (|> (/.run (/.loop (<>.many /.bit) /.text) + (list (synthesis.loop/scope [expected-offset + (list\map (|>> synthesis.bit) expected-inits) + (synthesis.text expected-body)]))) + (!expect (^multi (#try.Success [actual-offset actual-inits actual-body]) + (and (:: n.equivalence = expected-offset actual-offset) + (:: (list.equivalence bit.equivalence) = + expected-inits + actual-inits) + (:: text.equivalence = expected-body actual-body))))) + (|> (/.run (/.loop (<>.many /.bit) /.text) + (list (synthesis.text expected-body))) (!expect (^multi (#try.Failure error) - (exception.match? /.wrong-arity error))))))) + (exception.match? /.cannot-parse error))))))) )) (def: #export test diff --git a/stdlib/source/test/lux/control/parser/text.lux b/stdlib/source/test/lux/control/parser/text.lux index 206b93b12..2575509de 100644 --- a/stdlib/source/test/lux/control/parser/text.lux +++ b/stdlib/source/test/lux/control/parser/text.lux @@ -9,14 +9,14 @@ ["." function]] [data ["." maybe] - ["." text ("#@." equivalence) + ["." text ("#\." equivalence) ["." unicode] ["%" format (#+ format)]] [number ["n" nat]] [collection ["." set] - ["." list ("#@." functor)] + ["." list ("#\." functor)] [tree ["." finger]]]] [math @@ -58,7 +58,7 @@ (-> Text (/.Parser Text) Bit) (|> expected (/.run parser) - (:: try.functor map (text@= expected)) + (:: try.functor map (text\= expected)) (try.default false))) (def: (should-pass! expected parser) @@ -139,12 +139,12 @@ (wrap text.carriage-return) (wrap text.form-feed)) invalid (|> (random.unicode 1) (random.filter (function (_ char) - (not (or (text@= text.tab char) - (text@= text.vertical-tab char) - (text@= text.space char) - (text@= text.new-line char) - (text@= text.carriage-return char) - (text@= text.form-feed char))))))] + (not (or (text\= text.tab char) + (text\= text.vertical-tab char) + (text\= text.space char) + (text\= text.new-line char) + (text\= text.carriage-return char) + (text\= text.form-feed char))))))] (_.cover [/.space] (and (..should-pass expected /.space) (..should-fail invalid /.space)))) @@ -153,7 +153,7 @@ options (|> (random.char unicode.full) (random.set n.hash num-options) (:: ! map (|>> set.to-list - (list@map text.from-code) + (list\map text.from-code) (text.join-with "")))) expected (:: ! map (function (_ value) (|> options @@ -179,7 +179,7 @@ options (|> (random.char unicode.full) (random.set n.hash num-options) (:: ! map (|>> set.to-list - (list@map text.from-code) + (list\map text.from-code) (text.join-with "")))) invalid (:: ! map (function (_ value) (|> options @@ -306,7 +306,7 @@ [#let [size 10] expected (random.unicode size) dummy (|> (random.unicode size) - (random.filter (|>> (text@= expected) not)))] + (random.filter (|>> (text\= expected) not)))] (_.cover [/.this /.cannot-match] (and (|> (/.run (/.this expected) expected) @@ -364,13 +364,13 @@ _ /.any post /.get-input _ /.any] - (wrap (and (text@= input pre) - (text@= right post))))) + (wrap (and (text\= input pre) + (text\= right post))))) (!expect (#try.Success #1))))) (do {! random.monad} [left (random.unicode 1) right (random.unicode 1) - expected (random.filter (|>> (text@= right) not) + expected (random.filter (|>> (text\= right) not) (random.unicode 1))] (_.cover [/.enclosed] (|> (format left expected right) @@ -391,7 +391,7 @@ (|> (list (code.text expected)) (.run (/.embed /.octal .text)) (!expect (^multi (#try.Success actual) - (text@= expected actual)))))) + (text\= expected actual)))))) (do {! random.monad} [invalid (random.ascii/upper-alpha 1) expected (random.filter (|>> (unicode.within? unicode.basic-latin/upper-alpha) diff --git a/stdlib/source/test/lux/control/parser/type.lux b/stdlib/source/test/lux/control/parser/type.lux index 10925cb12..729551843 100644 --- a/stdlib/source/test/lux/control/parser/type.lux +++ b/stdlib/source/test/lux/control/parser/type.lux @@ -7,12 +7,12 @@ ["." try] ["." exception]] [data - ["." name ("#@." equivalence)] + ["." name ("#\." equivalence)] [number ["n" nat]]] [math ["." random (#+ Random)]] - ["." type ("#@." equivalence)]] + ["." type ("#\." equivalence)]] {1 ["." / ["/#" //]]}) @@ -36,7 +36,7 @@ (<| (_.with-cover [/.types-do-not-match]) (do {! random.monad} [expected ..primitive - dummy (random.filter (|>> (type@= expected) not) + dummy (random.filter (|>> (type\= expected) not) ..primitive)]) ($_ _.and (_.cover [/.exactly] @@ -79,9 +79,9 @@ (and (|> (/.run ( ($_ //.and /.any /.any /.any)) ( (list expected-left expected-middle expected-right))) (!expect (^multi (#try.Success [actual-left actual-middle actual-right]) - (and (type@= expected-left actual-left) - (type@= expected-middle actual-middle) - (type@= expected-right actual-right))))) + (and (type\= expected-left actual-left) + (type\= expected-middle actual-middle) + (type\= expected-right actual-right))))) (|> (/.run ( ($_ //.and /.any /.any /.any)) ( (list expected-left expected-middle expected-right))) (!expect (^multi (#try.Failure error) @@ -95,9 +95,9 @@ (and (|> (/.run (/.function ($_ //.and /.any /.any) /.any) (type.function (list expected-left expected-middle) expected-right)) (!expect (^multi (#try.Success [[actual-left actual-middle] actual-right]) - (and (type@= expected-left actual-left) - (type@= expected-middle actual-middle) - (type@= expected-right actual-right))))) + (and (type\= expected-left actual-left) + (type\= expected-middle actual-middle) + (type\= expected-right actual-right))))) (|> (/.run (/.function ($_ //.and /.any /.any) /.any) (type.variant (list expected-left expected-middle expected-right))) (!expect (^multi (#try.Failure error) @@ -106,9 +106,9 @@ (and (|> (/.run (/.apply ($_ //.and /.any /.any /.any)) (type.application (list expected-middle expected-right) expected-left)) (!expect (^multi (#try.Success [actual-left actual-middle actual-right]) - (and (type@= expected-left actual-left) - (type@= expected-middle actual-middle) - (type@= expected-right actual-right))))) + (and (type\= expected-left actual-left) + (type\= expected-middle actual-middle) + (type\= expected-right actual-right))))) (|> (/.run (/.apply ($_ //.and /.any /.any /.any)) (type.variant (list expected-left expected-middle expected-right))) (!expect (^multi (#try.Failure error) @@ -125,7 +125,7 @@ (_.cover [/.run /.any] (|> (/.run /.any expected) (!expect (^multi (#try.Success actual) - (type@= expected actual)))))) + (type\= expected actual)))))) (do {! random.monad} [expected ..primitive] (_.cover [/.peek /.unconsumed-input] @@ -135,7 +135,7 @@ (wrap actual)) expected) (!expect (^multi (#try.Success actual) - (type@= expected actual)))) + (type\= expected actual)))) (|> (/.run /.peek expected) (!expect (^multi (#try.Failure error) (exception.match? /.unconsumed-input error))))))) @@ -165,7 +165,7 @@ (is? /.fresh environment)))))) (do {! random.monad} [expected ..primitive - dummy (random.filter (|>> (type@= expected) not) + dummy (random.filter (|>> (type\= expected) not) ..primitive)] (_.cover [/.local] (|> (/.run (do //.monad @@ -174,7 +174,7 @@ /.any)) dummy) (!expect (^multi (#try.Success actual) - (type@= expected actual)))))) + (type\= expected actual)))))) (do {! random.monad} [expected random.nat] (_.cover [/.existential /.not-existential] @@ -190,8 +190,8 @@ (|> (/.run /.named (#.Named expected-name expected-type)) (!expect (^multi (#try.Success [actual-name actual-type]) - (and (name@= expected-name actual-name) - (type@= expected-type actual-type))))))) + (and (name\= expected-name actual-name) + (type\= expected-type actual-type))))))) ..aggregate ..matches ))) diff --git a/stdlib/source/test/lux/control/parser/xml.lux b/stdlib/source/test/lux/control/parser/xml.lux index db7a51d39..70e881cd2 100644 --- a/stdlib/source/test/lux/control/parser/xml.lux +++ b/stdlib/source/test/lux/control/parser/xml.lux @@ -7,7 +7,7 @@ ["." try] ["." exception]] [data - ["." text ("#@." equivalence)] + ["." text ("#\." equivalence)] ["." name] [format ["." xml]] @@ -19,10 +19,10 @@ ["." random (#+ Random)]] [macro ["." template]] - ["." type ("#@." equivalence)]] + ["." type ("#\." equivalence)]] {1 ["." / - ["/#" // ("#@." monad)]]}) + ["/#" // ("#\." monad)]]}) (template: (!expect ) (case @@ -62,9 +62,9 @@ (_.cover [/.run /.text] (|> (/.run /.text (#xml.Text expected)) (!expect (^multi (#try.Success actual) - (text@= expected actual)))))) + (text\= expected actual)))))) (!failure /.unconsumed-inputs - [[(//@wrap expected) + [[(//\wrap expected) (#xml.Text expected)]]) (do {! random.monad} [expected (random.ascii/alpha 1)] diff --git a/stdlib/source/test/lux/control/remember.lux b/stdlib/source/test/lux/control/remember.lux index f9b261c9f..5de61eed9 100644 --- a/stdlib/source/test/lux/control/remember.lux +++ b/stdlib/source/test/lux/control/remember.lux @@ -14,7 +14,7 @@ ["." text ["%" format (#+ format)]]] [math - ["." random (#+ Random) ("#@." monad)]] + ["." random (#+ Random) ("#\." monad)]] [time ["." date (#+ Date)] ["." instant] @@ -27,8 +27,8 @@ ["." /]}) (def: deadline (Random Date) random.date) -(def: message (Random Text) (random@map %.nat random.nat)) -(def: focus (Random Code) (random@map code.text (random.ascii/upper-alpha 10))) +(def: message (Random Text) (random\map %.nat random.nat)) +(def: focus (Random Code) (random\map code.text (random.ascii/upper-alpha 10))) (def: (to-remember macro deadline message focus) (-> Name Date Text (Maybe Code) Code) diff --git a/stdlib/source/test/lux/control/writer.lux b/stdlib/source/test/lux/control/writer.lux index 30150dc43..070d51888 100644 --- a/stdlib/source/test/lux/control/writer.lux +++ b/stdlib/source/test/lux/control/writer.lux @@ -16,7 +16,7 @@ ["." product] [number ["n" nat]] - ["." text ("#@." equivalence) + ["." text ("#\." equivalence) ["%" format (#+ format)]]] [math ["." random]]] @@ -49,13 +49,13 @@ ($monad.spec (..injection text.monoid) ..comparison (/.monad text.monoid))) (_.cover [/.write] - (text@= log + (text\= log (product.left (/.write log)))) (_.cover [/.with /.lift] (let [lift (/.lift text.monoid io.monad) - (^open "io@.") io.monad] + (^open "io\.") io.monad] (|> (io.run (do (/.with text.monoid io.monad) - [a (lift (io@wrap left)) + [a (lift (io\wrap left)) b (wrap right)] (wrap (n.+ a b)))) product.right diff --git a/stdlib/source/test/lux/data.lux b/stdlib/source/test/lux/data.lux index c65567c23..74a295777 100644 --- a/stdlib/source/test/lux/data.lux +++ b/stdlib/source/test/lux/data.lux @@ -17,10 +17,11 @@ ["#." sum] ["#." color ["#/." named]] - [format - ["#." json] - ["#." tar] - ["#." xml]] + ["#." format #_ + ["#/." binary] + ["#/." json] + ["#/." tar] + ["#/." xml]] [number ["#." i8] ["#." i16] @@ -51,9 +52,10 @@ (def: format ($_ _.and - /json.test - /tar.test - /xml.test + /format/binary.test + /format/json.test + /format/tar.test + /format/xml.test )) (def: #export test diff --git a/stdlib/source/test/lux/data/collection/set/ordered.lux b/stdlib/source/test/lux/data/collection/set/ordered.lux index 7257a7f7b..1734d80c4 100644 --- a/stdlib/source/test/lux/data/collection/set/ordered.lux +++ b/stdlib/source/test/lux/data/collection/set/ordered.lux @@ -8,13 +8,13 @@ [/ ["$." equivalence]]}] [data - ["." bit ("#@." equivalence)] + ["." bit ("#\." equivalence)] [number ["n" nat]] [collection ["." list]]] [math - ["." random (#+ Random) ("#@." monad)]]] + ["." random (#+ Random) ("#\." monad)]]] {1 ["." / (#+ Set) ["." //]]}) @@ -27,7 +27,7 @@ (All [a] (-> Nat (Order a) (Random a) (Random (Set a)))) (case size 0 - (random@wrap (/.new &order)) + (random\wrap (/.new &order)) _ (do random.monad @@ -48,7 +48,7 @@ random.nat) #let [listL (//.to-list usetL)] listR (|> (random.set n.hash sizeR random.nat) (:: ! map //.to-list)) - #let [(^open "/@.") /.equivalence + #let [(^open "/\.") /.equivalence setL (/.from-list n.order listL) setR (/.from-list n.order listR) empty (/.new n.order)]] @@ -59,7 +59,7 @@ (_.cover [/.size] (n.= sizeL (/.size setL))) (_.cover [/.empty?] - (bit@= (n.= 0 (/.size setL)) + (bit\= (n.= 0 (/.size setL)) (/.empty? setL))) (_.cover [/.new] (/.empty? (/.new n.order))) @@ -70,7 +70,7 @@ (_.cover [/.from-list] (|> setL /.to-list (/.from-list n.order) - (/@= setL))) + (/\= setL))) (~~ (template [ ] [(_.cover [] (case ( setL) @@ -118,7 +118,7 @@ (/.super? empty setL) symmetry! - (bit@= (/.super? setL setR) + (bit\= (/.super? setL setR) (/.sub? setR setL))] (and self! empty! diff --git a/stdlib/source/test/lux/data/collection/tree/finger.lux b/stdlib/source/test/lux/data/collection/tree/finger.lux index a0dfabb54..7c93fb0c1 100644 --- a/stdlib/source/test/lux/data/collection/tree/finger.lux +++ b/stdlib/source/test/lux/data/collection/tree/finger.lux @@ -4,8 +4,8 @@ [abstract [monad (#+ do)]] [data - ["." maybe ("#@." functor)] - ["." text ("#@." equivalence monoid)] + ["." maybe ("#\." functor)] + ["." text ("#\." equivalence monoid)] [number ["n" nat]]] [math @@ -29,7 +29,7 @@ (_.with-cover [/.Tree]) (do {! random.monad} [tag-left (random.ascii/alpha-num 1) - tag-right (random.filter (|>> (text@= tag-left) not) + tag-right (random.filter (|>> (text\= tag-left) not) (random.ascii/alpha-num 1)) expected-left random.nat expected-right random.nat] @@ -38,9 +38,9 @@ (exec (/.builder text.monoid) true)) (_.cover [/.tag] - (and (text@= tag-left + (and (text\= tag-left (/.tag (:: ..builder leaf tag-left expected-left))) - (text@= (text@compose tag-left tag-right) + (text\= (text\compose tag-left tag-right) (/.tag (:: ..builder branch (:: ..builder leaf tag-left expected-left) (:: ..builder leaf tag-right expected-right)))))) @@ -77,13 +77,13 @@ (let [can-find-correct-one! (|> (:: ..builder leaf tag-left expected-left) (/.search (text.contains? tag-left)) - (maybe@map (n.= expected-left)) + (maybe\map (n.= expected-left)) (maybe.default false)) cannot-find-incorrect-one! (|> (:: ..builder leaf tag-right expected-right) (/.search (text.contains? tag-left)) - (maybe@map (n.= expected-left)) + (maybe\map (n.= expected-left)) (maybe.default false) not) @@ -92,7 +92,7 @@ (:: ..builder leaf tag-left expected-left) (:: ..builder leaf tag-right expected-right)) (/.search (text.contains? tag-left)) - (maybe@map (n.= expected-left)) + (maybe\map (n.= expected-left)) (maybe.default false)) can-find-right! @@ -100,7 +100,7 @@ (:: ..builder leaf tag-left expected-left) (:: ..builder leaf tag-right expected-right)) (/.search (text.contains? tag-right)) - (maybe@map (n.= expected-right)) + (maybe\map (n.= expected-right)) (maybe.default false))] (and can-find-correct-one! cannot-find-incorrect-one! diff --git a/stdlib/source/test/lux/data/format/binary.lux b/stdlib/source/test/lux/data/format/binary.lux new file mode 100644 index 000000000..9b00113f0 --- /dev/null +++ b/stdlib/source/test/lux/data/format/binary.lux @@ -0,0 +1,35 @@ +(.module: + [lux #* + ["_" test (#+ Test)] + [abstract + [equivalence (#+ Equivalence)] + [monad (#+ do)] + {[0 #spec] + [/ + ["$." monoid]]}] + [data + ["." binary ("#\." equivalence)]] + [math + ["." random (#+ Random)]]] + {1 + ["." /]}) + +(structure: equivalence + (Equivalence /.Specification) + + (def: (= reference subject) + (binary\= (/.instance reference) + (/.instance subject)))) + +(def: random + (Random /.Specification) + (:: random.monad map /.nat random.nat)) + +(def: #export test + Test + (<| (_.covering /._) + (_.with-cover [/.Mutation /.Specification /.Writer]) + ($_ _.and + (_.with-cover [/.monoid] + ($monoid.spec ..equivalence /.monoid ..random)) + ))) diff --git a/stdlib/source/test/lux/data/format/tar.lux b/stdlib/source/test/lux/data/format/tar.lux index 0e274a6e6..9c83040fa 100644 --- a/stdlib/source/test/lux/data/format/tar.lux +++ b/stdlib/source/test/lux/data/format/tar.lux @@ -11,8 +11,8 @@ [data ["." product] ["." maybe] - ["." binary ("#@." equivalence)] - ["." text ("#@." equivalence) + ["." binary ("#\." equivalence)] + ["." text ("#\." equivalence) ["." encoding] ["." unicode] ["%" format (#+ format)]] @@ -21,7 +21,7 @@ ["i" int]] [collection ["." row] - ["." list ("#@." fold)]] + ["." list ("#\." fold)]] ["." format #_ ["#" binary]]] [time @@ -44,7 +44,7 @@ (_.cover [/.path /.from-path] (case (/.path expected) (#try.Success actual) - (text@= expected + (text\= expected (/.from-path actual)) (#try.Failure error) @@ -77,7 +77,7 @@ (_.cover [/.name /.from-name] (case (/.name expected) (#try.Success actual) - (text@= expected + (text\= expected (/.from-name actual)) (#try.Failure error) @@ -170,7 +170,7 @@ (.run /.parser))] (wrap (case (row.to-list tar) (^ (list ( actual-path))) - (text@= (/.from-path expected-path) + (text\= (/.from-path expected-path) (/.from-path actual-path)) _ @@ -201,11 +201,11 @@ (^ (list ( [actual-path actual-moment actual-mode actual-ownership actual-content]))) (let [seconds (: (-> Instant Int) (|>> instant.relative (duration.query duration.second)))] - (and (text@= (/.from-path expected-path) + (and (text\= (/.from-path expected-path) (/.from-path actual-path)) (i.= (seconds expected-moment) (seconds actual-moment)) - (binary@= (/.data expected-content) + (binary\= (/.data expected-content) (/.data actual-content)))) _ @@ -239,7 +239,7 @@ (do {! random.monad} [path (random.ascii/lower-alpha 10) modes (random.list 4 ..random-mode) - #let [expected-mode (list@fold /.and /.none modes)]] + #let [expected-mode (list\fold /.and /.none modes)]] (`` ($_ _.and (_.cover [/.and] (|> (do try.monad @@ -347,9 +347,9 @@ (.run /.parser))] (wrap (case (row.to-list tar) (^ (list (#/.Normal [_ _ _ actual-ownership _]))) - (and (text@= (/.from-name expected) + (and (text\= (/.from-name expected) (/.from-name (get@ [#/.user #/.name] actual-ownership))) - (text@= (/.from-name /.anonymous) + (text\= (/.from-name /.anonymous) (/.from-name (get@ [#/.group #/.name] actual-ownership)))) _ @@ -371,11 +371,11 @@ (.run /.parser))] (wrap (case (row.to-list tar) (^ (list (#/.Normal [_ _ _ actual-ownership _]))) - (and (text@= (/.from-name /.anonymous) + (and (text\= (/.from-name /.anonymous) (/.from-name (get@ [#/.user #/.name] actual-ownership))) (n.= (/.from-small /.no-id) (/.from-small (get@ [#/.user #/.id] actual-ownership))) - (text@= (/.from-name /.anonymous) + (text\= (/.from-name /.anonymous) (/.from-name (get@ [#/.group #/.name] actual-ownership))) (n.= (/.from-small /.no-id) (/.from-small (get@ [#/.group #/.id] actual-ownership)))) diff --git a/stdlib/source/test/lux/data/format/xml.lux b/stdlib/source/test/lux/data/format/xml.lux index e0a1a5c05..531326d92 100644 --- a/stdlib/source/test/lux/data/format/xml.lux +++ b/stdlib/source/test/lux/data/format/xml.lux @@ -16,14 +16,14 @@ [data ["." name] ["." maybe] - ["." text ("#@." equivalence)] + ["." text ("#\." equivalence)] [number ["n" nat]] [collection ["." dictionary] - ["." list ("#@." functor)]]] + ["." list ("#\." functor)]]] [math - ["r" random (#+ Random) ("#@." monad)]]] + ["r" random (#+ Random) ("#\." monad)]]] {1 ["." / (#+ XML)]}) @@ -42,7 +42,7 @@ (def: (size bottom top) (-> Nat Nat (Random Nat)) (let [constraint (|>> (n.% top) (n.max bottom))] - (r@map constraint r.nat))) + (r\map constraint r.nat))) (def: (text bottom top) (-> Nat Nat (Random Text)) @@ -82,21 +82,21 @@ value (..text 1 10) #let [node (#/.Node tag (dictionary.put attribute value /.attrs) - (list@map (|>> #/.Text) children))]] + (list\map (|>> #/.Text) children))]] ($_ _.and (_.test "Can parse text." (E.default #0 (do E.monad [output (.run .text (#/.Text text))] - (wrap (text@= text output))))) + (wrap (text\= text output))))) (_.test "Can parse attributes." (E.default #0 (do E.monad [output (.run (p.before .ignore (.attribute attribute)) node)] - (wrap (text@= value output))))) + (wrap (text\= value output))))) (_.test "Can parse nodes." (E.default #0 (do E.monad diff --git a/stdlib/source/test/lux/data/identity.lux b/stdlib/source/test/lux/data/identity.lux index cc2ccf096..4601aaf0b 100644 --- a/stdlib/source/test/lux/data/identity.lux +++ b/stdlib/source/test/lux/data/identity.lux @@ -2,19 +2,13 @@ [lux #* ["_" test (#+ Test)] [abstract - [equivalence (#+)] - [functor (#+)] - comonad [monad (#+ do)] {[0 #spec] [/ ["$." functor (#+ Injection Comparison)] ["$." apply] ["$." monad] - ["$." comonad]]}] - [data - ["." text ("#@." monoid equivalence) - ["%" format (#+ format)]]]] + ["$." comonad]]}]] {1 ["." / (#+ Identity)]}) diff --git a/stdlib/source/test/lux/data/text/regex.lux b/stdlib/source/test/lux/data/text/regex.lux index bef97b853..83d2cfcc4 100644 --- a/stdlib/source/test/lux/data/text/regex.lux +++ b/stdlib/source/test/lux/data/text/regex.lux @@ -11,7 +11,7 @@ ["s" code]]] [data [number (#+ hex)] - ["." text ("#@." equivalence)]] + ["." text ("#\." equivalence)]] [math ["r" random]] ["." meta] @@ -25,7 +25,7 @@ (|> input (.run regex) (case> (#try.Success parsed) - (text@= parsed input) + (text\= parsed input) _ #0))) @@ -35,7 +35,7 @@ (|> input (.run regex) (case> (#try.Success parsed) - (text@= test parsed) + (text\= test parsed) _ false))) @@ -283,9 +283,9 @@ (/.^regex "(.{3})-(.{3})-(.{4})" [_ match1 match2 match3]) (_.test "Can pattern-match using regular-expressions." - (and (text@= sample1 match1) - (text@= sample2 match2) - (text@= sample3 match3))) + (and (text\= sample1 match1) + (text\= sample2 match2) + (text\= sample3 match3))) _ (_.test "Cannot pattern-match using regular-expressions." diff --git a/stdlib/source/test/lux/extension.lux b/stdlib/source/test/lux/extension.lux index 154cb8ea2..f5ba58758 100644 --- a/stdlib/source/test/lux/extension.lux +++ b/stdlib/source/test/lux/extension.lux @@ -12,7 +12,7 @@ ["" analysis] ["" synthesis]]] [data - ["." text ("#@." equivalence) + ["." text ("#\." equivalence) ["%" format (#+ format)]] [collection ["." row]]] @@ -99,7 +99,7 @@ [(_.cover [] (for {@.old false} - (text@= (`` ((~~ (static )))) + (text\= (`` ((~~ (static )))) )))] [/.analysis: ..my-analysis] diff --git a/stdlib/source/test/lux/host.old.lux b/stdlib/source/test/lux/host.old.lux index e0f2a3757..fdb5d0c30 100644 --- a/stdlib/source/test/lux/host.old.lux +++ b/stdlib/source/test/lux/host.old.lux @@ -20,17 +20,20 @@ (import: java/lang/String) (import: java/lang/Exception - (new [java/lang/String])) + ["#::." + (new [java/lang/String])]) (import: java/lang/Runnable) (import: (java/lang/Class a) - (getName [] java/lang/String)) + ["#::." + (getName [] java/lang/String)]) (import: java/lang/System - (#static out java/io/PrintStream) - (#static currentTimeMillis [] #io long) - (#static getenv [java/lang/String] #io #? java/lang/String)) + ["#::." + (#static out java/io/PrintStream) + (#static currentTimeMillis [] #io long) + (#static getenv [java/lang/String] #io #? java/lang/String)]) (class: #final (TestClass A) [java/lang/Runnable] ## Fields diff --git a/stdlib/source/test/lux/target/jvm.lux b/stdlib/source/test/lux/target/jvm.lux index 2fbfc92b9..be11f3f6e 100644 --- a/stdlib/source/test/lux/target/jvm.lux +++ b/stdlib/source/test/lux/target/jvm.lux @@ -12,14 +12,14 @@ ["." atom]]] [data ["." maybe] - ["." bit ("#@." equivalence)] + ["." bit ("#\." equivalence)] [number ["." i32 (#+ I32)] ["." i64] ["n" nat] ["i" int] ["f" frac]] - ["." text ("#@." equivalence) + ["." text ("#\." equivalence) ["%" format (#+ format)]] ["." format #_ ["#" binary]] @@ -28,15 +28,15 @@ ["." dictionary] ["." row] ["." set] - ["." list ("#@." functor)]]] + ["." list ("#\." functor)]]] [math - ["." random (#+ Random) ("#@." monad)]] + ["." random (#+ Random) ("#\." monad)]] ["_" test (#+ Test)]] {1 ["." / #_ ["#." loader (#+ Library)] ["#." version] - ["#." modifier ("#@." monoid)] + ["#." modifier ("#\." monoid)] ["#." field] ["#." method (#+ Method)] ["#." class] @@ -54,7 +54,7 @@ ["." category (#+ Value Object Class)]]]}) (def: method-modifier - ($_ /modifier@compose + ($_ /modifier\compose /method.public /method.static)) @@ -65,19 +65,23 @@ (import: java/lang/Long) (import: java/lang/Float) (import: java/lang/Double - (#static compare [double double] int)) + ["#::." + (#static compare [double double] int)]) (import: java/lang/Character) (import: java/lang/String) (import: java/lang/reflect/Method - (invoke [java/lang/Object [java/lang/Object]] #try java/lang/Object)) + ["#::." + (invoke [java/lang/Object [java/lang/Object]] #try java/lang/Object)]) (import: (java/lang/Class c) - (getDeclaredMethod [java/lang/String [(java/lang/Class [? < java/lang/Object])]] java/lang/reflect/Method)) + ["#::." + (getDeclaredMethod [java/lang/String [(java/lang/Class [? < java/lang/Object])]] java/lang/reflect/Method)]) (import: java/lang/Object - (getClass [] (java/lang/Class java/lang/Object)) - (toString [] java/lang/String)) + ["#::." + (getClass [] (java/lang/Class java/lang/Object)) + (toString [] java/lang/String)]) (def: class-name (Random Text) @@ -795,7 +799,7 @@ (<| (_.lift "INVOKEVIRTUAL") (do random.monad [expected ..$Double::random]) - (..bytecode (|>> (:coerce Bit) (bit@= (f.not-a-number? (:coerce Frac expected))))) + (..bytecode (|>> (:coerce Bit) (bit\= (f.not-a-number? (:coerce Frac expected))))) (do /.monad [_ (/.double (:coerce Frac expected)) _ ..$Double::wrap @@ -864,7 +868,7 @@ _ /.lload-1 _ (/.putfield $Self object-field /type.long)] /.return))) - (/method.method ($_ /modifier@compose + (/method.method ($_ /modifier\compose /method.public /method.static) static-method @@ -948,7 +952,7 @@ ($_ _.and (_.context "boolean" (array (/.newarray /instruction.t-boolean) $Boolean::random $Boolean::literal [/.bastore /.baload $Boolean::wrap] - (function (_ expected) (|>> (:coerce Bit) (bit@= (:coerce Bit expected)))))) + (function (_ expected) (|>> (:coerce Bit) (bit\= (:coerce Bit expected)))))) (_.context "byte" (array (/.newarray /instruction.t-byte) $Byte::random $Byte::literal [/.bastore /.baload $Byte::wrap] (function (_ expected) @@ -1007,7 +1011,7 @@ (|>> (:coerce java/lang/Character) "jvm object cast" ("jvm char =" ("jvm object cast" (:coerce java/lang/Character expected))))})))) (_.context "object" (array (/.anewarray ..$String) $String::random $String::literal [/.aastore /.aaload /.nop] - (function (_ expected) (|>> (:coerce Text) (text@= (:coerce Text expected)))))) + (function (_ expected) (|>> (:coerce Text) (text\= (:coerce Text expected)))))) (<| (_.context "multi") (do {! random.monad} [#let [size (:: ! map (|>> (n.% 5) (n.+ 1)) @@ -1210,7 +1214,7 @@ (<| (_.context "object") (let [test (: (-> java/lang/String Any Bit) (function (_ expected actual) - (|> actual (:coerce Text) (text@= (:coerce Text expected)))))] + (|> actual (:coerce Text) (text\= (:coerce Text expected)))))] ($_ _.and (_.lift "ASTORE_0/ALOAD_0" (store-and-load ..$String::random ..$String::literal /.nop [(function.constant /.astore-0) (function.constant /.aload-0)] test)) @@ -1229,7 +1233,7 @@ (do random.monad [expected/1 $String::random #let [object-test (: (-> Any Bit) - (|>> (:coerce Text) (text@= (:coerce Text expected/1))))] + (|>> (:coerce Text) (text\= (:coerce Text expected/1))))] dummy/1 $String::random #let [single ($_ _.and (<| (_.lift "DUP & POP") @@ -1318,7 +1322,7 @@ primitive-method-name (random.ascii/upper-alpha 10) #let [primitive-method-type (/type.method [(list) (get@ #unboxed primitive) (list)])] object-method-name (|> (random.ascii/upper-alpha 10) - (random.filter (|>> (text@= primitive-method-name) not))) + (random.filter (|>> (text\= primitive-method-name) not))) expected (get@ #random primitive) #let [$Self (/type.class class-name (list))]] (wrap (case (do try.monad @@ -1366,7 +1370,7 @@ (_.lift "LRETURN" (primitive-return ..$Long::primitive /.lreturn #.None (!::= java/lang/Long "jvm leq" "jvm long ="))) (_.lift "FRETURN" (primitive-return ..$Float::primitive /.freturn #.None (!::= java/lang/Float "jvm feq" "jvm float ="))) (_.lift "DRETURN" (primitive-return ..$Double::primitive /.dreturn #.None (!::= java/lang/Double "jvm deq" "jvm double ="))) - (_.lift "ARETURN" (primitive-return ..$String::primitive /.areturn #.None (function (_ expected actual) (text@= (:coerce Text expected) (:coerce Text actual))))) + (_.lift "ARETURN" (primitive-return ..$String::primitive /.areturn #.None (function (_ expected actual) (text\= (:coerce Text expected) (:coerce Text actual))))) (_.lift "RETURN" (primitive-return (: (Primitive java/lang/String) {#unboxed /type.void #boxed ..$String @@ -1375,7 +1379,7 @@ #literal (function.constant /.nop)}) /.return (#.Some ..$String::literal) - (function (_ expected actual) (text@= (:coerce Text expected) (:coerce Text actual))))) + (function (_ expected actual) (text\= (:coerce Text expected) (:coerce Text actual))))) ))) (def: branching @@ -1506,7 +1510,7 @@ @wrong /.new-label @return /.new-label _ (..$Integer::literal (host.long-to-int (:coerce java/lang/Long choice))) - _ (/.lookupswitch @wrong (list@map (function (_ option) + _ (/.lookupswitch @wrong (list\map (function (_ option) [(|> option /signed.s4 try.assume) (if (i.= choice option) @right @wrong)]) options)) @@ -1580,11 +1584,11 @@ (do random.monad [abstract-class ..class-name interface-class (|> ..class-name - (random.filter (|>> (text@= abstract-class) not))) + (random.filter (|>> (text\= abstract-class) not))) concrete-class (|> ..class-name (random.filter (function (_ class) - (not (or (text@= abstract-class class) - (text@= interface-class class)))))) + (not (or (text\= abstract-class class) + (text\= interface-class class)))))) part0 ..$Long::random part1 ..$Long::random part2 ..$Long::random @@ -1621,17 +1625,17 @@ [_ (..$Long::literal value)] /.lreturn))))) - interface-bytecode (|> (/class.class /version.v6_0 ($_ /modifier@compose /class.public /class.abstract /class.interface) + interface-bytecode (|> (/class.class /version.v6_0 ($_ /modifier\compose /class.public /class.abstract /class.interface) (/name.internal interface-class) (/name.internal "java.lang.Object") (list) (list) - (list (/method.method ($_ /modifier@compose /method.public /method.abstract) + (list (/method.method ($_ /modifier\compose /method.public /method.abstract) interface-method method::type (list) #.None)) (row.row)) try.assume (format.run /class.writer)) - abstract-bytecode (|> (/class.class /version.v6_0 ($_ /modifier@compose /class.public /class.abstract) + abstract-bytecode (|> (/class.class /version.v6_0 ($_ /modifier\compose /class.public /class.abstract) (/name.internal abstract-class) (/name.internal "java.lang.Object") (list) @@ -1646,7 +1650,7 @@ /.return))) (method inherited-method part0) (method overriden-method fake-part2) - (/method.method ($_ /modifier@compose /method.public /method.abstract) + (/method.method ($_ /modifier\compose /method.public /method.abstract) abstract-method method::type (list) #.None)) (row.row)) try.assume @@ -1673,7 +1677,7 @@ (method overriden-method part2) (method abstract-method part3) (method interface-method part4) - (/method.method ($_ /modifier@compose + (/method.method ($_ /modifier\compose /method.public /method.static) static-method diff --git a/stdlib/source/test/lux/world.lux b/stdlib/source/test/lux/world.lux index a01bdb929..e7aa38aa1 100644 --- a/stdlib/source/test/lux/world.lux +++ b/stdlib/source/test/lux/world.lux @@ -2,6 +2,7 @@ [lux #* ["_" test (#+ Test)]] ["." / #_ + ["#." environment] ["#." file] ["#." shell] ["#." console]]) @@ -9,6 +10,7 @@ (def: #export test Test ($_ _.and + /environment.test /file.test /shell.test /console.test diff --git a/stdlib/source/test/lux/world/environment.lux b/stdlib/source/test/lux/world/environment.lux new file mode 100644 index 000000000..2ab284132 --- /dev/null +++ b/stdlib/source/test/lux/world/environment.lux @@ -0,0 +1,31 @@ +(.module: + [lux #* + ["_" test (#+ Test)] + [abstract + [monad (#+ do)]] + [control + [concurrency + ["." promise]]] + [data + ["." text] + [collection + ["." dictionary] + ["." list]]] + [math + ["." random]]] + {1 + ["." /]}) + +(def: #export test + Test + (<| (_.covering /._) + (_.with-cover [/.Environment /.Property]) + (do random.monad + [_ (wrap [])] + (wrap (do promise.monad + [environment (promise.future /.read)] + (_.claim [/.read] + (and (not (dictionary.empty? environment)) + (|> environment + dictionary.keys + (list.every? (|>> text.empty? not)))))))))) diff --git a/stdlib/source/test/lux/world/file.lux b/stdlib/source/test/lux/world/file.lux index 55cfe94bc..fa1edcfe8 100644 --- a/stdlib/source/test/lux/world/file.lux +++ b/stdlib/source/test/lux/world/file.lux @@ -1,7 +1,7 @@ (.module: [lux #* ["%" data/text/format (#+ format)] - ["r" math/random (#+ Random) ("#@." monad)] + ["r" math/random (#+ Random) ("#\." monad)] ["_" test (#+ Test)] [abstract/monad (#+ do)] [control @@ -34,7 +34,7 @@ (def: (creation-and-deletion number) (-> Nat Test) - (r@wrap (do promise.monad + (r\wrap (do promise.monad [#let [path (format "temp_file_" (%.nat number))] result (promise.future (do (try.with io.monad) @@ -53,7 +53,7 @@ (def: (read-and-write number data) (-> Nat Binary Test) - (r@wrap (do promise.monad + (r\wrap (do promise.monad [#let [path (format "temp_file_" (%.nat number))] result (promise.future (do (try.with io.monad) -- cgit v1.2.3