diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-08-23 19:59:38 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-08-23 19:59:38 -0700 |
commit | d6e02ceea56644dea341e64a1f46f8fbe43ca6b5 (patch) | |
tree | de7345d67de93291489fae1f726e73991b057cf9 /stdlib/op.tl | |
parent | 33cd4b10aca2e097e1d03fe4d5ee725f4f207131 (diff) | |
download | txr-d6e02ceea56644dea341e64a1f46f8fbe43ca6b5.tar.gz txr-d6e02ceea56644dea341e64a1f46f8fbe43ca6b5.tar.bz2 txr-d6e02ceea56644dea341e64a1f46f8fbe43ca6b5.zip |
New macros opf and lopf.
These remove repetitive (op ...) syntax from
the arguments of functional combinators.
* stdlib/opt.tl (opf, lopf): New macros.
* autoload.c (op_set_entries): Register opf and
lopf as autoload triggers.
* tests/012/op.tl: New tests.
* txr.1: Documented.
Diffstat (limited to 'stdlib/op.tl')
-rw-r--r-- | stdlib/op.tl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/stdlib/op.tl b/stdlib/op.tl index 4b5b0311..79786f20 100644 --- a/stdlib/op.tl +++ b/stdlib/op.tl @@ -265,6 +265,12 @@ (defmacro loand (:env e . clauses) ^[chand ,*(sys:opip-expand e 'lop 'ldo clauses)]) +(defmacro opf (:env e fun . clauses) + ^[,fun ,*(sys:opip-expand e 'op 'do clauses)]) + +(defmacro lopf (:env e fun . clauses) + ^[,fun ,*(sys:opip-expand e 'lop 'ldo clauses)]) + (defmacro flow (val . opip-args) ^(call (opip ,*opip-args) ,val)) |