From bf2318462d7024050635fd4620e207d6d5a7281d Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Wed, 7 Dec 2022 01:48:19 +0100 Subject: fun=>: fix unquote matching --- mew.scm | 4 ++-- tests/test.mew | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mew.scm b/mew.scm index 17c23d2..0780029 100644 --- a/mew.scm +++ b/mew.scm @@ -1001,10 +1001,10 @@ (apply and=> result (cdr fs))))))) (define-syntax fun=>-inner - (syntax-rules () + (syntax-rules (unquote) ((_ (acc ...)) (compose acc ...)) - ((_ (acc ...) ,arg args ...) + ((_ (acc ...) (unquote arg) args ...) (fun=>-inner (arg acc ...) args ...)) ((_ (acc ...) (arg ...) args ...) (fun=>-inner ((op arg ...) acc ...) args ...)) diff --git a/tests/test.mew b/tests/test.mew index 32d9df1..c01bb08 100644 --- a/tests/test.mew +++ b/tests/test.mew @@ -547,6 +547,8 @@ (test-group "op=>" (test 42 (op=> 40 (+ _ 1) inc)) + (test 42 (op=> 40 (inc _) inc)) + (test 42 (op=> 40 ,(op inc _) inc)) (test #f (op=> 40 inc even?)) (test 43 (op=> '(6 7) (apply * _) inc)) (test 42 (op=> 42))) -- cgit 1.4.1