diff options
author | Eduardo Julian | 2022-06-04 20:00:01 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-06-04 20:00:01 -0400 |
commit | 75e8244fd7914d2ac0c3622d2277b84c4bfa7ffb (patch) | |
tree | 317e26d0702e8c73669b9cef39979c0d2ed93b17 /stdlib/source/library/lux.lux | |
parent | f9e33ae96aec4741385a576719786092c9e68043 (diff) |
comonad/cofree => comonad/free
Diffstat (limited to 'stdlib/source/library/lux.lux')
-rw-r--r-- | stdlib/source/library/lux.lux | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index cdcb304a0..1c550ec22 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -4264,11 +4264,20 @@ _ (failure (..wrong_syntax_error (symbol ..refer))))) +(macro: .public (with tokens) + (case (..parsed (..andP ..anyP ..anyP) + tokens) + {.#Some [implementation expression]} + (meta#in (list (` (..let [(..open (~ (text$ (alias_stand_in 0)))) (~ implementation)] + (~ expression))))) + + {.#None} + (failure (..wrong_syntax_error (symbol ..with))))) + (macro: .public (at tokens) (case tokens - (pattern (list struct [_ {#Symbol member}])) - (meta#in (list (` (..let [(..open (~ (text$ (alias_stand_in 0)))) (~ struct)] - (~ (symbol$ member)))))) + (pattern (list implementation [_ {#Symbol member}])) + (meta#in (list (` (..with (~ implementation) (~ (symbol$ member)))))) (pattern (partial_list struct member args)) (meta#in (list (` ((..at (~ struct) (~ member)) (~+ args))))) |