diff options
author | Eduardo Julian | 2022-03-14 06:14:57 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-03-14 06:14:57 -0400 |
commit | 4965597043aca57a05760113f1851e96dad1eaf8 (patch) | |
tree | 8126d3e6394e38bc52918eea95a67546350bb95e /lux-scheme | |
parent | cfd438517a46e025b15345e3570b02f5ea6165c0 (diff) |
Leaner syntax for the "for" macro.
Diffstat (limited to 'lux-scheme')
-rw-r--r-- | lux-scheme/source/program.lux | 188 |
1 files changed, 94 insertions, 94 deletions
diff --git a/lux-scheme/source/program.lux b/lux-scheme/source/program.lux index 9ffda365a..e04ba5ac2 100644 --- a/lux-scheme/source/program.lux +++ b/lux-scheme/source/program.lux @@ -1,69 +1,69 @@ (.using - [lux "*" - [program {"+" program:}] - ["[0]" ffi] - ["[0]" debug] - [abstract - ["[0]" monad {"+" do}]] - [control - [pipe {"+" exec> case> new>}] - ["[0]" maybe] - ["[0]" try {"+" Try}] - ["[0]" exception {"+" exception:}] - ["[0]" io {"+" IO io}] - [concurrency - ["[0]" promise {"+" Promise}]]] - [data - ["[0]" text ("[1]#[0]" hash) - ["%" format {"+" format}] - ["[0]" encoding]] - [collection - ["[0]" array {"+" Array}]]] - [macro - ["[0]" template]] - [math - [number {"+" hex} - ["n" nat] - ["[0]" i64]]] - [time - ["[0]" instant]] - ["[0]" world "_" - ["[0]" file] - ["[1]/[0]" program]] - ["@" target - ["_" scheme]] - [tool - [compiler - [phase {"+" Operation Phase}] - [reference - [variable {"+" Register}]] - [language - [lux - [program {"+" Program}] - [generation {"+" Context Host}] - ["[0]" synthesis] - [analysis - [macro {"+" Expander}]] - [phase - ["[0]" extension {"+" Extender Handler} - ["[1]/[0]" bundle] - ["[0]" analysis "_" - ["[1]" scheme]] - ["[0]" generation "_" - ["[1]" scheme]]] - [generation - ["[0]" reference] - ["[0]" scheme - ["[0]" runtime]]]]]] - [default - ["[0]" platform {"+" Platform}]] - [meta - ["[0]" packager "_" - ["[1]" scheme]]]]]] - [program - ["/" compositor - ["[1][0]" cli] - ["[1][0]" static]]]) + [lux "*" + [program {"+" program:}] + ["[0]" ffi] + ["[0]" debug] + [abstract + ["[0]" monad {"+" do}]] + [control + [pipe {"+" exec> case> new>}] + ["[0]" maybe] + ["[0]" try {"+" Try}] + ["[0]" exception {"+" exception:}] + ["[0]" io {"+" IO io}] + [concurrency + ["[0]" promise {"+" Promise}]]] + [data + ["[0]" text ("[1]#[0]" hash) + ["%" format {"+" format}] + ["[0]" encoding]] + [collection + ["[0]" array {"+" Array}]]] + [macro + ["[0]" template]] + [math + [number {"+" hex} + ["n" nat] + ["[0]" i64]]] + [time + ["[0]" instant]] + ["[0]" world "_" + ["[0]" file] + ["[1]/[0]" program]] + ["@" target + ["_" scheme]] + [tool + [compiler + [phase {"+" Operation Phase}] + [reference + [variable {"+" Register}]] + [language + [lux + [program {"+" Program}] + [generation {"+" Context Host}] + ["[0]" synthesis] + [analysis + [macro {"+" Expander}]] + [phase + ["[0]" extension {"+" Extender Handler} + ["[1]/[0]" bundle] + ["[0]" analysis "_" + ["[1]" scheme]] + ["[0]" generation "_" + ["[1]" scheme]]] + [generation + ["[0]" reference] + ["[0]" scheme + ["[0]" runtime]]]]]] + [default + ["[0]" platform {"+" Platform}]] + [meta + ["[0]" packager "_" + ["[1]" scheme]]]]]] + [program + ["/" compositor + ["[1][0]" cli] + ["[1][0]" static]]]) (ffi.import: java/lang/Boolean) (ffi.import: java/lang/String) @@ -414,35 +414,35 @@ (runtime.lux//program_args _.nil) _.nil)) -(for [@.old - (def: extender - Extender - ... TODO: Stop relying on coercions ASAP. - (<| (:as Extender) - (function (@self handler)) - (:as Handler) - (function (@self name phase)) - (:as Phase) - (function (@self archive parameters)) - (:as Operation) - (function (@self state)) - (:as Try) - try.trusted - (:as Try) - (do try.monad - [handler (try.from_maybe (..ensure_macro (:as Macro handler))) - output (gnu/mapping/Procedure::applyN (array.from_list (list (lux_value (:as java/lang/Object name)) - (lux_value (:as java/lang/Object phase)) - (lux_value (:as java/lang/Object archive)) - (lux_value (:as java/lang/Object parameters)) - (lux_value (:as java/lang/Object state)))) - handler)] - (..read output)))) - - @.scheme - (def: (extender handler) - Extender - (:expected handler))]) +(for @.old + (def: extender + Extender + ... TODO: Stop relying on coercions ASAP. + (<| (:as Extender) + (function (@self handler)) + (:as Handler) + (function (@self name phase)) + (:as Phase) + (function (@self archive parameters)) + (:as Operation) + (function (@self state)) + (:as Try) + try.trusted + (:as Try) + (do try.monad + [handler (try.from_maybe (..ensure_macro (:as Macro handler))) + output (gnu/mapping/Procedure::applyN (array.from_list (list (lux_value (:as java/lang/Object name)) + (lux_value (:as java/lang/Object phase)) + (lux_value (:as java/lang/Object archive)) + (lux_value (:as java/lang/Object parameters)) + (lux_value (:as java/lang/Object state)))) + handler)] + (..read output)))) + + @.scheme + (def: (extender handler) + Extender + (:expected handler))) (def: (declare_success! _) (-> Any (Promise Any)) |