From d6e02ceea56644dea341e64a1f46f8fbe43ca6b5 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 23 Aug 2023 19:59:38 -0700 Subject: 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. --- stdlib/op.tl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'stdlib/op.tl') 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)) -- cgit v1.2.3