aboutsummaryrefslogtreecommitdiff
path: root/module/util.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2020-01-24 20:22:20 +0100
committerHugo Hörnquist <hugo@hornquist.se>2020-01-24 20:22:20 +0100
commit61a3301385ddb96e4c54ac7207fa1b71f7b0f381 (patch)
tree196f26b5068aa7c2bdbdf943c919dc1bdf3f9180 /module/util.scm
parentAllow = in set->. (diff)
downloadcalp-61a3301385ddb96e4c54ac7207fa1b71f7b0f381.tar.gz
calp-61a3301385ddb96e4c54ac7207fa1b71f7b0f381.tar.xz
Add and=>>.
Diffstat (limited to 'module/util.scm')
-rw-r--r--module/util.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/module/util.scm b/module/util.scm
index 0751c7de..adac6b90 100644
--- a/module/util.scm
+++ b/module/util.scm
@@ -15,6 +15,7 @@
-> set set-> aif awhen
tree-map let-lazy let-env
case* define-many
+ and=>>
)
#:replace (let* set! define-syntax
when unless if))
@@ -405,6 +406,13 @@
[(_ obj (func args ...) rest ...)
(set-> (set (func obj) args ...) rest ...)]))
+(define-syntax and=>>
+ (syntax-rules ()
+ [(_ value) value]
+ [(_ value proc rest ...)
+ (and=>> (and=> value proc)
+ rest ...)]))
+
(define-syntax let-env