diff options
author | Eduardo Julian | 2022-01-30 05:08:37 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-01-30 05:08:37 -0400 |
commit | 4b22baf63fd2ef2bf141835ab540f7d52168cc84 (patch) | |
tree | 7b36381a9e192732f7aeba200ec41cc78152c17d /stdlib/source/test/lux/macro/code.lux | |
parent | 75c90ff2c4cc805a841339b238128bc3e31eab6a (diff) |
Fixes for the pure-Lux JVM compiler machinery. [Part 12]
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/macro/code.lux | 63 |
1 files changed, 32 insertions, 31 deletions
diff --git a/stdlib/source/test/lux/macro/code.lux b/stdlib/source/test/lux/macro/code.lux index 4c6eb7e38..ffa65358b 100644 --- a/stdlib/source/test/lux/macro/code.lux +++ b/stdlib/source/test/lux/macro/code.lux @@ -1,31 +1,31 @@ (.using - [library - [lux "*" - ["_" test {"+" Test}] - [abstract - [monad {"+" do}] - [\\specification - ["$[0]" equivalence]]] - [control - ["[0]" try {"+" Try}]] - [data - ["[0]" product] - ["[0]" text] - [collection - ["[0]" list ("[1]#[0]" functor)]]] - [math - ["[0]" random {"+" Random} ("[1]#[0]" monad)] - [number - ["n" nat]]] - [meta - ["[0]" location]] - [tool - [compiler - [language - [lux - ["[0]" syntax]]]]]]] - [\\library - ["[0]" /]]) + [library + [lux "*" + ["_" test {"+" Test}] + [abstract + [monad {"+" do}] + [\\specification + ["$[0]" equivalence]]] + [control + ["[0]" try {"+" Try}]] + [data + ["[0]" product] + ["[0]" text] + [collection + ["[0]" list ("[1]#[0]" functor)]]] + [math + ["[0]" random {"+" Random} ("[1]#[0]" monad)] + [number + ["n" nat]]] + [meta + ["[0]" location]] + [tool + [compiler + [language + [lux + ["[0]" syntax]]]]]]] + [\\library + ["[0]" /]]) (def: random_text (Random Text) @@ -78,10 +78,11 @@ (function (_ replacement_simulation) (let [for_sequence (: (-> (-> (List Code) Code) (Random [Code Code])) (function (_ to_code) - (do [! random.monad] - [parts (..random_sequence replacement_simulation)] - (in [(to_code (list#each product.left parts)) - (to_code (list#each product.right parts))]))))] + (random.only (|>> product.left (# /.equivalence = original) not) + (do [! random.monad] + [parts (..random_sequence replacement_simulation)] + (in [(to_code (list#each product.left parts)) + (to_code (list#each product.right parts))])))))] ($_ random.either (random#in [original substitute]) (do [! random.monad] |