diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/control/pipe.lux | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/stdlib/source/library/lux/control/pipe.lux b/stdlib/source/library/lux/control/pipe.lux index cdd6589b8..b16b4a167 100644 --- a/stdlib/source/library/lux/control/pipe.lux +++ b/stdlib/source/library/lux/control/pipe.lux @@ -28,14 +28,14 @@ (syntax (_ [start <code>.any body ..body prev <code>.any]) - (in (list (` (|> (~ start) (~+ body))))))) + (in (list (` (|> (, start) (,* body))))))) (def .public let (syntax (_ [binding <code>.any body <code>.any prev <code>.any]) - (in (list (` (.let [(~ binding) (~ prev)] - (~ body))))))) + (in (list (` (.let [(, binding) (, prev)] + (, body))))))) (def _reversed_ (Parser Any) @@ -49,39 +49,39 @@ _ _reversed_ branches (<>.some (<>.and ..body ..body))]) (with_symbols [g!temp] - (in (list (` (.let [(~ g!temp) (~ prev)] - (.cond (~+ (monad.do list.monad + (in (list (` (.let [(, g!temp) (, prev)] + (.cond (,* (monad.do list.monad [[test then] branches] - (list (` (|> (~ g!temp) (~+ test))) - (` (|> (~ g!temp) (~+ then)))))) - (|> (~ g!temp) (~+ else)))))))))) + (list (` (|> (, g!temp) (,* test))) + (` (|> (, g!temp) (,* then)))))) + (|> (, g!temp) (,* else)))))))))) (def .public if (syntax (_ [test ..body then ..body else ..body prev <code>.any]) - (in (list (` (..cond [(~+ test)] [(~+ then)] - [(~+ else)] - (~ prev))))))) + (in (list (` (..cond [(,* test)] [(,* then)] + [(,* else)] + (, prev))))))) (def .public when (syntax (_ [test ..body then ..body prev <code>.any]) - (in (list (` (..cond [(~+ test)] [(~+ then)] + (in (list (` (..cond [(,* test)] [(,* then)] [] - (~ prev))))))) + (, prev))))))) (def .public while (syntax (_ [test ..body then ..body prev <code>.any]) (with_symbols [g!temp g!again] - (in (list (` (.loop ((~ g!again) [(~ g!temp) (~ prev)]) - (.if (|> (~ g!temp) (~+ test)) - ((~ g!again) (|> (~ g!temp) (~+ then))) - (~ g!temp))))))))) + (in (list (` (.loop ((, g!again) [(, g!temp) (, prev)]) + (.if (|> (, g!temp) (,* test)) + ((, g!again) (|> (, g!temp) (,* then))) + (, g!temp))))))))) (def .public do (syntax (_ [monad <code>.any @@ -92,11 +92,11 @@ (pattern (list.partial last_step prev_steps)) (.let [step_bindings (monad.do list.monad [step (list.reversed prev_steps)] - (list g!temp (` (|> (~ g!temp) (~+ step)))))] - (in (list (` ((~! monad.do) (~ monad) - [.let [(~ g!temp) (~ prev)] - (~+ step_bindings)] - (|> (~ g!temp) (~+ last_step))))))) + (list g!temp (` (|> (, g!temp) (,* step)))))] + (in (list (` ((,! monad.do) (, monad) + [.let [(, g!temp) (, prev)] + (,* step_bindings)] + (|> (, g!temp) (,* last_step))))))) _ (in (list prev)))))) @@ -105,22 +105,22 @@ (syntax (_ [body ..body prev <code>.any]) (with_symbols [g!temp] - (in (list (` (.let [(~ g!temp) (~ prev)] - (.exec (|> (~ g!temp) (~+ body)) - (~ g!temp))))))))) + (in (list (` (.let [(, g!temp) (, prev)] + (.exec (|> (, g!temp) (,* body)) + (, g!temp))))))))) (def .public tuple (syntax (_ [paths (<>.many ..body) prev <code>.any]) (with_symbols [g!temp] - (in (list (` (.let [(~ g!temp) (~ prev)] - [(~+ (list#each (function (_ body) (` (|> (~ g!temp) (~+ body)))) + (in (list (` (.let [(, g!temp) (, prev)] + [(,* (list#each (function (_ body) (` (|> (, g!temp) (,* body)))) paths))]))))))) (def .public case (syntax (_ [branches (<>.many (<>.and <code>.any <code>.any)) prev <code>.any]) - (in (list (` (.case (~ prev) - (~+ (|> branches + (in (list (` (.case (, prev) + (,* (|> branches (list#each (function (_ [pattern body]) (list pattern body))) list#conjoint)))))))) |