summaryrefslogtreecommitdiffstats
path: root/tests/012/op.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-08-03 06:36:48 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-08-03 06:36:48 -0700
commit6eb147ff66fb54800e1b37730dc3de51868d8ea5 (patch)
treee414ccc55bb6142dc3c192e5e8c4b525a2d391c5 /tests/012/op.tl
parenta81edc2c7f1a8110ccc77ef9c73a462af33565dd (diff)
downloadtxr-6eb147ff66fb54800e1b37730dc3de51868d8ea5.tar.gz
txr-6eb147ff66fb54800e1b37730dc3de51868d8ea5.tar.bz2
txr-6eb147ff66fb54800e1b37730dc3de51868d8ea5.zip
opip: new special handling of (let ...).
* stdlib/op.tl (sys:opip-single-let-p, sys:opip-let-p): New functions. (sys:opip-expand): Restructure from collect loop to car/cdr recursive form, because the new let operators in opip need access to the rest of the pipeline. Implement let operators. * tests/012/op.tl: New tests. * txr.1: Documented.
Diffstat (limited to 'tests/012/op.tl')
-rw-r--r--tests/012/op.tl6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/012/op.tl b/tests/012/op.tl
index aafe0a28..5501cec4 100644
--- a/tests/012/op.tl
+++ b/tests/012/op.tl
@@ -99,3 +99,9 @@
(partition-if (op neq 1 (- @2 @1)))
(find-max-key @1 : len))
80)
+
+(mtest
+ (flow 1 (+ 1) (let x) (+ 2) (let y) (+ 3) (list x y @1)) (2 4 7)
+ (flow 10 (+ 1) (let (x @1) (y (* x 2))) (+ x y)) 44
+ (flow 10 (+ 1) (let ((x @1) (y (* @1 2))) (+ x y))) 33
+ (flow 10 (+ 1) (let ((x @1) (y (* @1 2))))) nil)