From 39325bb36c6f6459c861ef12f9e99b9e66b52594 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 8 Jul 2022 17:18:30 -0400 Subject: Moved "lux/static" to "lux/meta/static". --- lux-lua/source/program.lux | 22 ++-- lux-python/source/program.lux | 22 ++-- stdlib/source/documentation/lux/meta/static.lux | 56 +++++++++ stdlib/source/documentation/lux/static.lux | 56 --------- stdlib/source/library/lux/ffi/export.js.lux | 2 +- stdlib/source/library/lux/ffi/export.lua.lux | 2 +- stdlib/source/library/lux/ffi/export.py.lux | 2 +- stdlib/source/library/lux/ffi/export.rb.lux | 4 +- stdlib/source/library/lux/math.lux | 2 +- .../library/lux/meta/compiler/default/platform.lux | 2 +- .../lux/meta/compiler/meta/packager/scheme.lux | 2 +- stdlib/source/library/lux/meta/static.lux | 140 +++++++++++++++++++++ stdlib/source/library/lux/static.lux | 140 --------------------- stdlib/source/test/lux.lux | 4 +- stdlib/source/test/lux/ffi.jvm.lux | 2 +- stdlib/source/test/lux/ffi/export.js.lux | 5 +- stdlib/source/test/lux/ffi/export.jvm.lux | 2 +- stdlib/source/test/lux/ffi/export.lua.lux | 5 +- stdlib/source/test/lux/ffi/export.py.lux | 5 +- stdlib/source/test/lux/ffi/export.rb.lux | 5 +- stdlib/source/test/lux/meta.lux | 2 + .../lux/meta/compiler/language/lux/analysis.lux | 2 +- stdlib/source/test/lux/meta/macro.lux | 2 +- stdlib/source/test/lux/meta/static.lux | 93 ++++++++++++++ stdlib/source/test/lux/meta/target/js.lux | 2 +- stdlib/source/test/lux/meta/target/lua.lux | 2 +- stdlib/source/test/lux/meta/target/python.lux | 2 +- stdlib/source/test/lux/meta/version.lux | 2 +- stdlib/source/test/lux/static.lux | 93 -------------- 29 files changed, 342 insertions(+), 338 deletions(-) create mode 100644 stdlib/source/documentation/lux/meta/static.lux delete mode 100644 stdlib/source/documentation/lux/static.lux create mode 100644 stdlib/source/library/lux/meta/static.lux delete mode 100644 stdlib/source/library/lux/static.lux create mode 100644 stdlib/source/test/lux/meta/static.lux delete mode 100644 stdlib/source/test/lux/static.lux diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux index e08b2c4cb..824b2b33b 100644 --- a/lux-lua/source/program.lux +++ b/lux-lua/source/program.lux @@ -3,7 +3,6 @@ [lux (.except) [program (.only program:)] ["[0]" ffi] - ["[0]" static] [abstract ["[0]" monad (.only do)]] [control @@ -22,20 +21,18 @@ [collection ["[0]" array (.only Array)] ["[0]" list (.use "[1]#[0]" monad)]]] - [macro - ["^" pattern] - ["[0]" local] - ["[0]" code]] [math [number (.only hex) ["n" nat] ["[0]" i64]]] - ["[0]" world - ["[0]" file] - ["[1]/[0]" program]] - ["@" target (.only) - ["_" lua]] [meta + ["[0]" static] + [macro + ["^" pattern] + ["[0]" local] + ["[0]" code]] + ["@" target (.only) + ["_" lua]] ["[0]" compiler ["[0]" phase (.only Operation Phase)] [reference @@ -64,7 +61,10 @@ ["[0]" context] [archive (.only Archive)] ["[0]" packager - ["[1]" script]]]]]]] + ["[1]" script]]]]] + ["[0]" world + ["[0]" file] + ["[1]/[0]" program]]]] [program ["/" compositor]]) diff --git a/lux-python/source/program.lux b/lux-python/source/program.lux index 208a3550a..a14949e61 100644 --- a/lux-python/source/program.lux +++ b/lux-python/source/program.lux @@ -4,7 +4,6 @@ [program (.only program:)] ["[0]" ffi (.only import)] ["[0]" debug] - ["[0]" static] [abstract ["[0]" monad (.only do)]] [control @@ -24,20 +23,18 @@ [collection ["[0]" array (.only Array)] ["[0]" list (.use "[1]#[0]" functor)]]] - [macro - ["^" pattern] - ["[0]" template] - ["[0]" code]] [math [number ["n" nat] ["[0]" i64]]] - ["[0]" world - ["[0]" file] - ["[1]/[0]" program]] - ["@" target (.only) - ["_" python]] [meta + ["[0]" static] + [macro + ["^" pattern] + ["[0]" template] + ["[0]" code]] + ["@" target (.only) + ["_" python]] ["[0]" compiler ["[0]" phase (.only Operation Phase) (.use "[1]#[0]" monad)] [reference @@ -68,7 +65,10 @@ [archive (.only Archive) ["[0]" unit]] ["[0]" packager - ["[1]" script]]]]]]] + ["[1]" script]]]]] + ["[0]" world + ["[0]" file] + ["[1]/[0]" program]]]] [program ["/" compositor]]) diff --git a/stdlib/source/documentation/lux/meta/static.lux b/stdlib/source/documentation/lux/meta/static.lux new file mode 100644 index 000000000..9ae73aae8 --- /dev/null +++ b/stdlib/source/documentation/lux/meta/static.lux @@ -0,0 +1,56 @@ +(.require + [library + [lux (.except nat int rev) + ["$" documentation] + [data + [text + ["%" \\format (.only format)]] + [collection + ["[0]" list]]]]] + [\\library + ["[0]" /]]) + +(`` (.def .public documentation + (.List $.Module) + ($.module /._ + "" + [(,, (with_template [ ] + [($.documentation + (%.code (' ( + (is + (value generating expression))))))] + + [/.nat .Nat] + [/.int .Int] + [/.rev .Rev] + [/.frac .Frac] + [/.text .Text] + )) + + ($.documentation /.literal + "" + [(/.literal + (is (-> ??? Code) + format) + (is ??? + (value generating expression)))]) + + (,, (with_template [ ] + [($.documentation + (%.code (' (is + ()))))] + + [/.random_nat .Nat] + [/.random_int .Int] + [/.random_rev .Rev] + [/.random_frac .Frac] + )) + + ($.documentation /.random + "" + [(/.random + (is (-> ??? Code) + format) + (is (Random ???) + (random data generator)))])] + []))) diff --git a/stdlib/source/documentation/lux/static.lux b/stdlib/source/documentation/lux/static.lux deleted file mode 100644 index 9ae73aae8..000000000 --- a/stdlib/source/documentation/lux/static.lux +++ /dev/null @@ -1,56 +0,0 @@ -(.require - [library - [lux (.except nat int rev) - ["$" documentation] - [data - [text - ["%" \\format (.only format)]] - [collection - ["[0]" list]]]]] - [\\library - ["[0]" /]]) - -(`` (.def .public documentation - (.List $.Module) - ($.module /._ - "" - [(,, (with_template [ ] - [($.documentation - (%.code (' ( - (is - (value generating expression))))))] - - [/.nat .Nat] - [/.int .Int] - [/.rev .Rev] - [/.frac .Frac] - [/.text .Text] - )) - - ($.documentation /.literal - "" - [(/.literal - (is (-> ??? Code) - format) - (is ??? - (value generating expression)))]) - - (,, (with_template [ ] - [($.documentation - (%.code (' (is - ()))))] - - [/.random_nat .Nat] - [/.random_int .Int] - [/.random_rev .Rev] - [/.random_frac .Frac] - )) - - ($.documentation /.random - "" - [(/.random - (is (-> ??? Code) - format) - (is (Random ???) - (random data generator)))])] - []))) diff --git a/stdlib/source/library/lux/ffi/export.js.lux b/stdlib/source/library/lux/ffi/export.js.lux index a661027ab..bb725ed0c 100644 --- a/stdlib/source/library/lux/ffi/export.js.lux +++ b/stdlib/source/library/lux/ffi/export.js.lux @@ -2,7 +2,6 @@ [library [lux (.except) [extension (.only declaration)] - ["[0]" static] [abstract ["[0]" monad (.only do)]] [control @@ -16,6 +15,7 @@ [math ["[0]" random]] ["[0]" meta (.only) + ["[0]" static] ["[0]" code (.only) ["<[1]>" \\parser]] ["[0]" macro (.only) diff --git a/stdlib/source/library/lux/ffi/export.lua.lux b/stdlib/source/library/lux/ffi/export.lua.lux index b485934c5..c59c410ae 100644 --- a/stdlib/source/library/lux/ffi/export.lua.lux +++ b/stdlib/source/library/lux/ffi/export.lua.lux @@ -2,7 +2,6 @@ [library [lux (.except) [extension (.only declaration)] - ["[0]" static] [abstract ["[0]" monad (.only do)]] [control @@ -16,6 +15,7 @@ [math ["[0]" random]] ["[0]" meta (.only) + ["[0]" static] ["[0]" code (.only) ["<[1]>" \\parser]] ["[0]" macro (.only) diff --git a/stdlib/source/library/lux/ffi/export.py.lux b/stdlib/source/library/lux/ffi/export.py.lux index 63cc2c471..70c5fc591 100644 --- a/stdlib/source/library/lux/ffi/export.py.lux +++ b/stdlib/source/library/lux/ffi/export.py.lux @@ -2,7 +2,6 @@ [library [lux (.except) [extension (.only declaration)] - ["[0]" static] [abstract ["[0]" monad (.only do)]] [control @@ -16,6 +15,7 @@ [math ["[0]" random]] ["[0]" meta (.only) + ["[0]" static] ["[0]" code (.only) ["<[1]>" \\parser]] ["[0]" macro (.only) diff --git a/stdlib/source/library/lux/ffi/export.rb.lux b/stdlib/source/library/lux/ffi/export.rb.lux index aa1ade262..df3ab6f85 100644 --- a/stdlib/source/library/lux/ffi/export.rb.lux +++ b/stdlib/source/library/lux/ffi/export.rb.lux @@ -2,8 +2,6 @@ [library [lux (.except global) [extension (.only declaration)] - ["[0]" static] - ["[0]" type] [abstract ["[0]" monad (.only do)]] [control @@ -18,6 +16,8 @@ [math ["[0]" random]] ["[0]" meta (.only) + ["[0]" static] + ["[0]" type] ["[0]" code (.only) ["<[1]>" \\parser]] ["[0]" macro (.only) diff --git a/stdlib/source/library/lux/math.lux b/stdlib/source/library/lux/math.lux index 794bef35d..bbad785af 100644 --- a/stdlib/source/library/lux/math.lux +++ b/stdlib/source/library/lux/math.lux @@ -2,7 +2,6 @@ [library [lux (.except) [extension (.only analysis)] - ["[0]" static] [abstract ["[0]" monad (.only do)]] [control @@ -16,6 +15,7 @@ ["[0]" list (.use "[1]#[0]" mix)]]] [meta ["@" target] + ["[0]" static] ["[0]" code ["<[1]>" \\parser]] [macro diff --git a/stdlib/source/library/lux/meta/compiler/default/platform.lux b/stdlib/source/library/lux/meta/compiler/default/platform.lux index d8c301eb7..436d6bac3 100644 --- a/stdlib/source/library/lux/meta/compiler/default/platform.lux +++ b/stdlib/source/library/lux/meta/compiler/default/platform.lux @@ -2,7 +2,6 @@ [library [lux (.except) ["[0]" debug] - ["[0]" static] [abstract ["[0]" monad (.only Monad do)]] [control @@ -27,6 +26,7 @@ ["[0]" list (.use "[1]#[0]" monoid functor mix)]]] ["[0]" meta (.only) ["@" target] + ["[0]" static] ["[0]" configuration (.only Configuration)] [type (.only sharing) ["[0]" check]]] diff --git a/stdlib/source/library/lux/meta/compiler/meta/packager/scheme.lux b/stdlib/source/library/lux/meta/compiler/meta/packager/scheme.lux index 0b14e378f..29dfd6b81 100644 --- a/stdlib/source/library/lux/meta/compiler/meta/packager/scheme.lux +++ b/stdlib/source/library/lux/meta/compiler/meta/packager/scheme.lux @@ -1,7 +1,6 @@ (.require [library [lux (.except Module) - [type (.only sharing)] [abstract ["[0]" monad (.only do)]] [control @@ -21,6 +20,7 @@ [format ["[0]" tar]]] [meta + [type (.only sharing)] [target ["_" scheme]]] [world diff --git a/stdlib/source/library/lux/meta/static.lux b/stdlib/source/library/lux/meta/static.lux new file mode 100644 index 000000000..617ce7cdb --- /dev/null +++ b/stdlib/source/library/lux/meta/static.lux @@ -0,0 +1,140 @@ +(.require + [library + [lux (.except nat int rev if cond) + [abstract + [monad (.only do)]] + [control + ["<>" parser]] + [data + [collection + ["[0]" list (.use "[1]#[0]" functor mix)]]] + [math + [number (.only hex)] + ["[0]" random (.only Random)]] + ["[0]" meta (.use "[1]#[0]" functor) + ["[0]" code (.only) + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)]]]]]) + +(with_template [ ] + [(def .public + (syntax (_ [expression .any]) + (at meta.monad each + (|>> (as ) list) + (meta.eval expression))))] + + [bit .Bit code.bit] + [nat .Nat code.nat] + [int .Int code.int] + [rev .Rev code.rev] + [frac .Frac code.frac] + [text .Text code.text] + ) + +(def pcg_32_magic_inc + Nat + (hex "FEDCBA9876543210")) + +(with_expansions [ (Ex (_ a) + [(-> a Code) + a])] + (def .public literal + (syntax (_ [format .any + expression .any]) + (do meta.monad + [pair (meta.eval (.type_literal ) + (` [(, format) (, expression)])) + .let [[format expression] (as pair)]] + (in (list (format expression))))))) + +(with_expansions [ (Ex (_ a) + [(-> a Code) + (List a)])] + (def .public literals + (syntax (_ [format .any + expression .any]) + (do meta.monad + [pair (meta.eval (.type_literal ) + (` [(, format) (, expression)])) + .let [[format expression] (as pair)]] + (in (list#each format expression)))))) + +(def .public seed + (syntax (_ []) + (meta#each (|>> code.nat list) meta.seed))) + +(with_template [ ] + [(def .public + (syntax (_ []) + (do meta.monad + [seed meta.seed + .let [[_ result] (random.result (random.pcg_32 [..pcg_32_magic_inc seed]) + )]] + (in (list ( result))))))] + + [random_bit random.bit code.bit] + [random_nat random.nat code.nat] + [random_int random.int code.int] + [random_rev random.rev code.rev] + [random_frac random.frac code.frac] + ) + +(with_expansions [ (Ex (_ a) + [(-> a Code) + (Random a)])] + (def .public random + (syntax (_ [format .any + random .any]) + (do meta.monad + [pair (meta.eval (type_literal ) + (` [(, format) (, random)])) + .let [[format random] (as pair)] + seed meta.seed + .let [[_ result] (random.result (random.pcg_32 [..pcg_32_magic_inc seed]) + random)]] + (in (list (format result))))))) + +(with_expansions [ (Ex (_ a) + [(-> a Code) + (Random (List a))])] + (def .public randoms + (syntax (_ [format .any + random .any]) + (do meta.monad + [pair (meta.eval (type_literal ) + (` [(, format) (, random)])) + .let [[format random] (as pair)] + seed meta.seed + .let [[_ result] (random.result (random.pcg_32 [..pcg_32_magic_inc seed]) + random)]] + (in (list#each format result)))))) + +(def .public if + (syntax (_ [test .any + then .any + else .any]) + (do meta.monad + [test (meta.eval .Bit test)] + (in (list (.if (as .Bit test) + then + else)))))) + +(def .public cond + (syntax (_ [test,then/* (<>.some (<>.and .any .any)) + else .any]) + (in (list (list#mix (function (_ [test then] else) + (` (..if (, test) + (, then) + (, else)))) + else + (list.reversed test,then/*)))))) + +(def .public when + (syntax (_ [test .any + then .any]) + (do meta.monad + [test (meta.eval .Bit test)] + (in (.if (as .Bit test) + (list then) + (list)))))) diff --git a/stdlib/source/library/lux/static.lux b/stdlib/source/library/lux/static.lux deleted file mode 100644 index 617ce7cdb..000000000 --- a/stdlib/source/library/lux/static.lux +++ /dev/null @@ -1,140 +0,0 @@ -(.require - [library - [lux (.except nat int rev if cond) - [abstract - [monad (.only do)]] - [control - ["<>" parser]] - [data - [collection - ["[0]" list (.use "[1]#[0]" functor mix)]]] - [math - [number (.only hex)] - ["[0]" random (.only Random)]] - ["[0]" meta (.use "[1]#[0]" functor) - ["[0]" code (.only) - ["<[1]>" \\parser]] - [macro - [syntax (.only syntax)]]]]]) - -(with_template [ ] - [(def .public - (syntax (_ [expression .any]) - (at meta.monad each - (|>> (as ) list) - (meta.eval expression))))] - - [bit .Bit code.bit] - [nat .Nat code.nat] - [int .Int code.int] - [rev .Rev code.rev] - [frac .Frac code.frac] - [text .Text code.text] - ) - -(def pcg_32_magic_inc - Nat - (hex "FEDCBA9876543210")) - -(with_expansions [ (Ex (_ a) - [(-> a Code) - a])] - (def .public literal - (syntax (_ [format .any - expression .any]) - (do meta.monad - [pair (meta.eval (.type_literal ) - (` [(, format) (, expression)])) - .let [[format expression] (as pair)]] - (in (list (format expression))))))) - -(with_expansions [ (Ex (_ a) - [(-> a Code) - (List a)])] - (def .public literals - (syntax (_ [format .any - expression .any]) - (do meta.monad - [pair (meta.eval (.type_literal ) - (` [(, format) (, expression)])) - .let [[format expression] (as pair)]] - (in (list#each format expression)))))) - -(def .public seed - (syntax (_ []) - (meta#each (|>> code.nat list) meta.seed))) - -(with_template [ ] - [(def .public - (syntax (_ []) - (do meta.monad - [seed meta.seed - .let [[_ result] (random.result (random.pcg_32 [..pcg_32_magic_inc seed]) - )]] - (in (list ( result))))))] - - [random_bit random.bit code.bit] - [random_nat random.nat code.nat] - [random_int random.int code.int] - [random_rev random.rev code.rev] - [random_frac random.frac code.frac] - ) - -(with_expansions [ (Ex (_ a) - [(-> a Code) - (Random a)])] - (def .public random - (syntax (_ [format .any - random .any]) - (do meta.monad - [pair (meta.eval (type_literal ) - (` [(, format) (, random)])) - .let [[format random] (as pair)] - seed meta.seed - .let [[_ result] (random.result (random.pcg_32 [..pcg_32_magic_inc seed]) - random)]] - (in (list (format result))))))) - -(with_expansions [ (Ex (_ a) - [(-> a Code) - (Random (List a))])] - (def .public randoms - (syntax (_ [format .any - random .any]) - (do meta.monad - [pair (meta.eval (type_literal ) - (` [(, format) (, random)])) - .let [[format random] (as pair)] - seed meta.seed - .let [[_ result] (random.result (random.pcg_32 [..pcg_32_magic_inc seed]) - random)]] - (in (list#each format result)))))) - -(def .public if - (syntax (_ [test .any - then .any - else .any]) - (do meta.monad - [test (meta.eval .Bit test)] - (in (list (.if (as .Bit test) - then - else)))))) - -(def .public cond - (syntax (_ [test,then/* (<>.some (<>.and .any .any)) - else .any]) - (in (list (list#mix (function (_ [test then] else) - (` (..if (, test) - (, then) - (, else)))) - else - (list.reversed test,then/*)))))) - -(def .public when - (syntax (_ [test .any - then .any]) - (do meta.monad - [test (meta.eval .Bit test)] - (in (.if (as .Bit test) - (list then) - (list)))))) diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 23d89ee6e..0f03b346d 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -3,7 +3,6 @@ ["/" lux (.except) [program (.only program:)] ["_" test (.only Test)] - ["[0]" static] [abstract [monad (.only do)]] [control @@ -32,6 +31,7 @@ ["[0]" i64]]] ["[0]" meta (.use "[1]#[0]" monad) ["@" target] + ["[0]" static] ["[0]" location (.use "[1]#[0]" equivalence)] ["[0]" code (.use "[1]#[0]" equivalence) ["<[1]>" \\parser]] @@ -51,7 +51,6 @@ ["[1][0]" meta] ["[1][0]" program] - ["[1][0]" static] ["[1][0]" test] ["[1][0]" world] @@ -1207,7 +1206,6 @@ /meta.test /program.test - /static.test /test.test /world.test diff --git a/stdlib/source/test/lux/ffi.jvm.lux b/stdlib/source/test/lux/ffi.jvm.lux index 9e900469a..91b97276f 100644 --- a/stdlib/source/test/lux/ffi.jvm.lux +++ b/stdlib/source/test/lux/ffi.jvm.lux @@ -3,7 +3,6 @@ [lux (.except) ["_" test (.only Test)] ["[0]" debug] - ["[0]" static] [abstract [monad (.only do)]] [control @@ -25,6 +24,7 @@ ["i" int (.use "[1]#[0]" equivalence)] ["f" frac (.use "[1]#[0]" equivalence)]]] ["[0]" meta (.only) + ["[0]" static] ["[0]" type (.use "[1]#[0]" equivalence)] ["[0]" code (.only) ["<[1]>" \\parser]] diff --git a/stdlib/source/test/lux/ffi/export.js.lux b/stdlib/source/test/lux/ffi/export.js.lux index 073463498..852eee961 100644 --- a/stdlib/source/test/lux/ffi/export.js.lux +++ b/stdlib/source/test/lux/ffi/export.js.lux @@ -2,10 +2,11 @@ [library [lux (.except) ["_" test (.only Test)] - ["[0]" static] [math [number - ["n" nat]]]]] + ["n" nat]]] + [meta + ["[0]" static]]]] [\\library ["[0]" / (.only) ["/[1]" //]]]) diff --git a/stdlib/source/test/lux/ffi/export.jvm.lux b/stdlib/source/test/lux/ffi/export.jvm.lux index 81615af21..6904a33df 100644 --- a/stdlib/source/test/lux/ffi/export.jvm.lux +++ b/stdlib/source/test/lux/ffi/export.jvm.lux @@ -3,7 +3,6 @@ [lux (.except) ["_" test (.only Test)] ["[0]" debug] - ["[0]" static] [abstract [monad (.only do)]] [data @@ -17,6 +16,7 @@ ["[0]" int (.use "[1]#[0]" equivalence)] ["[0]" frac (.use "[1]#[0]" equivalence)]]] ["[0]" meta (.only) + ["[0]" static] ["[0]" code] [macro ["[0]" template]]]]] diff --git a/stdlib/source/test/lux/ffi/export.lua.lux b/stdlib/source/test/lux/ffi/export.lua.lux index 2f3c6fdeb..f0c1d7efd 100644 --- a/stdlib/source/test/lux/ffi/export.lua.lux +++ b/stdlib/source/test/lux/ffi/export.lua.lux @@ -2,10 +2,11 @@ [library [lux (.except) ["_" test (.only Test)] - ["[0]" static] [math [number - ["n" nat]]]]] + ["n" nat]]] + [meta + ["[0]" static]]]] [\\library ["[0]" / (.only) ["/[1]" //]]]) diff --git a/stdlib/source/test/lux/ffi/export.py.lux b/stdlib/source/test/lux/ffi/export.py.lux index 073463498..852eee961 100644 --- a/stdlib/source/test/lux/ffi/export.py.lux +++ b/stdlib/source/test/lux/ffi/export.py.lux @@ -2,10 +2,11 @@ [library [lux (.except) ["_" test (.only Test)] - ["[0]" static] [math [number - ["n" nat]]]]] + ["n" nat]]] + [meta + ["[0]" static]]]] [\\library ["[0]" / (.only) ["/[1]" //]]]) diff --git a/stdlib/source/test/lux/ffi/export.rb.lux b/stdlib/source/test/lux/ffi/export.rb.lux index 64b57eee8..394d16376 100644 --- a/stdlib/source/test/lux/ffi/export.rb.lux +++ b/stdlib/source/test/lux/ffi/export.rb.lux @@ -2,10 +2,11 @@ [library [lux (.except) ["_" test (.only Test)] - ["[0]" static] [math [number - ["n" nat]]]]] + ["n" nat]]] + [meta + ["[0]" static]]]] [\\library ["[0]" / (.only) ["/[1]" //]]]) diff --git a/stdlib/source/test/lux/meta.lux b/stdlib/source/test/lux/meta.lux index 9b6f168e4..4a7159fe5 100644 --- a/stdlib/source/test/lux/meta.lux +++ b/stdlib/source/test/lux/meta.lux @@ -41,6 +41,7 @@ ["[1][0]" version] ["[1][0]" type] ["[1][0]" macro] + ["[1][0]" static] ["[1][0]" target (.only) (.,, (.for "{old}" (.,, (.these ["[1]/[0]" jvm])) "JVM" (.,, (.these ["[1]/[0]" jvm])) @@ -1057,6 +1058,7 @@ /version.test /type.test /macro.test + /static.test /target.test (,, (for @.jvm (,, (these /target/jvm.test)) @.old (,, (these /target/jvm.test)) diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/analysis.lux b/stdlib/source/test/lux/meta/compiler/language/lux/analysis.lux index d153ae458..09c976004 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/analysis.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/analysis.lux @@ -2,7 +2,6 @@ [library [lux (.except) ["_" test (.only Test)] - ["[0]" static] [abstract [monad (.only do)] [\\specification @@ -27,6 +26,7 @@ ["f" frac] ["r" rev]]] [meta + ["[0]" static] ["[0]" symbol (.use "[1]#[0]" equivalence)] [macro ["[0]" template]] diff --git a/stdlib/source/test/lux/meta/macro.lux b/stdlib/source/test/lux/meta/macro.lux index e2705e961..80faef121 100644 --- a/stdlib/source/test/lux/meta/macro.lux +++ b/stdlib/source/test/lux/meta/macro.lux @@ -2,7 +2,6 @@ [library [lux (.except) ["_" test (.only Test)] - ["[0]" static] [abstract [monad (.only do)]] [control @@ -18,6 +17,7 @@ [number ["n" nat]]] ["[0]" meta (.only) + ["[0]" static] ["[0]" location] ["[0]" symbol] ["[0]" code (.use "[1]#[0]" equivalence) diff --git a/stdlib/source/test/lux/meta/static.lux b/stdlib/source/test/lux/meta/static.lux new file mode 100644 index 000000000..aa67ab7a2 --- /dev/null +++ b/stdlib/source/test/lux/meta/static.lux @@ -0,0 +1,93 @@ +(.require + [library + [lux (.except) + ["_" test (.only Test)] + [data + ["[0]" text (.use "[1]#[0]" equivalence) + ["%" \\format (.only format)]] + [collection + ["[0]" list (.use "[1]#[0]" mix)]]] + [math + ["[0]" random (.use "[1]#[0]" functor)] + [number + ["n" nat] + ["i" int] + ["r" rev] + ["f" frac]]] + ["[0]" meta (.only) + ["@" target] + ["[0]" code]]]] + [\\library + ["[0]" /]]) + +(def .public test + Test + (<| (_.covering /._) + (for @.old (_.property "PLACEHOLDER" true)) + (_.for [meta.eval]) + (`` (all _.and + (,, (with_template [ <=> <+> ] + [(_.coverage [ ] + (with_expansions [ () + () + ( (<+> ))] + (case (' ) + [_ { l+r}] + (<=> l+r (<+> )) + + _ + false)))] + + [/.nat /.random_nat n.= n.+ .#Nat] + [/.int /.random_int i.= i.+ .#Int] + [/.rev /.random_rev r.= r.+ .#Rev] + )) + (_.coverage [/.frac /.random_frac] + (with_expansions [ (/.random_frac) + (/.random_frac) + (/.frac (f.+ ))] + (case (' ) + [_ {.#Frac l+r}] + (or (f.= l+r (f.+ )) + (and (f.not_a_number? l+r) + (f.not_a_number? (f.+ )) + (or (f.not_a_number? ) + (f.not_a_number? )))) + + _ + false))) + (_.coverage [/.text /.random] + (with_expansions [ (/.random code.text (random.alpha_numeric 1)) + (/.random code.text (random.alpha_numeric 1)) + (/.text (format ))] + (case (' ) + [_ {.#Text l+r}] + (text#= l+r (format )) + + _ + false))) + (_.coverage [/.randoms] + (with_expansions [ (/.random code.nat + (random#each (|>> (n.% 10) ++) random.nat)) + l/* (/.randoms code.nat (random.list random.nat))] + (and (n.= (list.size (list l/*))) + (n.= (list#mix n.+ 0 (list l/*)) + (all n.+ l/*))))) + (_.coverage [/.literal] + (with_expansions [ (/.random code.text (random.alpha_numeric 1)) + (/.random code.text (random.alpha_numeric 1)) + (/.literal code.text (format ))] + (case (' ) + [_ {.#Text l+r}] + (text#= l+r (format )) + + _ + false))) + (_.coverage [/.literals] + (with_expansions [l/0 (/.random_nat) + l/1 (/.random_nat) + l/2 (/.random_nat) + l/* (/.literals code.nat (list l/0 l/1 l/2))] + (n.= (all n.+ l/0 l/1 l/2) + (all n.+ l/*)))) + )))) diff --git a/stdlib/source/test/lux/meta/target/js.lux b/stdlib/source/test/lux/meta/target/js.lux index 0288ca3b1..9604b26b3 100644 --- a/stdlib/source/test/lux/meta/target/js.lux +++ b/stdlib/source/test/lux/meta/target/js.lux @@ -2,7 +2,6 @@ [library [lux (.except) ["_" test (.only Test)] - ["[0]" static] [abstract [monad (.only do)] ["[0]" predicate]] @@ -25,6 +24,7 @@ ["f" frac] ["[0]" i64]]] [meta + ["[0]" static] [macro ["[0]" template]]]]] [\\library diff --git a/stdlib/source/test/lux/meta/target/lua.lux b/stdlib/source/test/lux/meta/target/lua.lux index 129748613..ad8ef35d6 100644 --- a/stdlib/source/test/lux/meta/target/lua.lux +++ b/stdlib/source/test/lux/meta/target/lua.lux @@ -3,7 +3,6 @@ [lux (.except) ["_" test (.only Test)] ["[0]" ffi] - ["[0]" static] [abstract [monad (.only do)] [\\specification @@ -28,6 +27,7 @@ ["f" frac] ["[0]" i64]]] [meta + ["[0]" static] [macro ["[0]" template]]]]] [\\library diff --git a/stdlib/source/test/lux/meta/target/python.lux b/stdlib/source/test/lux/meta/target/python.lux index ac1d84974..8c553dc2d 100644 --- a/stdlib/source/test/lux/meta/target/python.lux +++ b/stdlib/source/test/lux/meta/target/python.lux @@ -3,7 +3,6 @@ [lux (.except) ["_" test (.only Test)] ["[0]" ffi] - ["[0]" static] [abstract [monad (.only do)] ["[0]" predicate] @@ -28,6 +27,7 @@ ["f" frac] ["[0]" i64]]] [meta + ["[0]" static] ["[0]" code]]]] [\\library ["[0]" / (.use "[1]#[0]" equivalence)]]) diff --git a/stdlib/source/test/lux/meta/version.lux b/stdlib/source/test/lux/meta/version.lux index eebef8c0b..1df94e003 100644 --- a/stdlib/source/test/lux/meta/version.lux +++ b/stdlib/source/test/lux/meta/version.lux @@ -2,7 +2,6 @@ [library [lux (.except) ["_" test (.only Test)] - ["[0]" static] [abstract [monad (.only do)]] [control @@ -15,6 +14,7 @@ [number ["n" nat]]] ["[0]" meta (.only) + ["[0]" static] ["[0]" code (.only) ["<[1]>" \\parser]] ["[0]" macro (.only) diff --git a/stdlib/source/test/lux/static.lux b/stdlib/source/test/lux/static.lux deleted file mode 100644 index aa67ab7a2..000000000 --- a/stdlib/source/test/lux/static.lux +++ /dev/null @@ -1,93 +0,0 @@ -(.require - [library - [lux (.except) - ["_" test (.only Test)] - [data - ["[0]" text (.use "[1]#[0]" equivalence) - ["%" \\format (.only format)]] - [collection - ["[0]" list (.use "[1]#[0]" mix)]]] - [math - ["[0]" random (.use "[1]#[0]" functor)] - [number - ["n" nat] - ["i" int] - ["r" rev] - ["f" frac]]] - ["[0]" meta (.only) - ["@" target] - ["[0]" code]]]] - [\\library - ["[0]" /]]) - -(def .public test - Test - (<| (_.covering /._) - (for @.old (_.property "PLACEHOLDER" true)) - (_.for [meta.eval]) - (`` (all _.and - (,, (with_template [ <=> <+> ] - [(_.coverage [ ] - (with_expansions [ () - () - ( (<+> ))] - (case (' ) - [_ { l+r}] - (<=> l+r (<+> )) - - _ - false)))] - - [/.nat /.random_nat n.= n.+ .#Nat] - [/.int /.random_int i.= i.+ .#Int] - [/.rev /.random_rev r.= r.+ .#Rev] - )) - (_.coverage [/.frac /.random_frac] - (with_expansions [ (/.random_frac) - (/.random_frac) - (/.frac (f.+ ))] - (case (' ) - [_ {.#Frac l+r}] - (or (f.= l+r (f.+ )) - (and (f.not_a_number? l+r) - (f.not_a_number? (f.+ )) - (or (f.not_a_number? ) - (f.not_a_number? )))) - - _ - false))) - (_.coverage [/.text /.random] - (with_expansions [ (/.random code.text (random.alpha_numeric 1)) - (/.random code.text (random.alpha_numeric 1)) - (/.text (format ))] - (case (' ) - [_ {.#Text l+r}] - (text#= l+r (format )) - - _ - false))) - (_.coverage [/.randoms] - (with_expansions [ (/.random code.nat - (random#each (|>> (n.% 10) ++) random.nat)) - l/* (/.randoms code.nat (random.list random.nat))] - (and (n.= (list.size (list l/*))) - (n.= (list#mix n.+ 0 (list l/*)) - (all n.+ l/*))))) - (_.coverage [/.literal] - (with_expansions [ (/.random code.text (random.alpha_numeric 1)) - (/.random code.text (random.alpha_numeric 1)) - (/.literal code.text (format ))] - (case (' ) - [_ {.#Text l+r}] - (text#= l+r (format )) - - _ - false))) - (_.coverage [/.literals] - (with_expansions [l/0 (/.random_nat) - l/1 (/.random_nat) - l/2 (/.random_nat) - l/* (/.literals code.nat (list l/0 l/1 l/2))] - (n.= (all n.+ l/0 l/1 l/2) - (all n.+ l/*)))) - )))) -- cgit v1.2.3