diff options
author | Leah Neukirchen <leah@vuxu.org> | 2022-12-07 01:48:19 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2022-12-07 01:48:19 +0100 |
commit | bf2318462d7024050635fd4620e207d6d5a7281d (patch) | |
tree | 844f58de19b26006c352f8309d35ee2545fd5752 | |
parent | 3119e2a2b550919326f7850242a6083c81a9b1fa (diff) | |
download | mew-bf2318462d7024050635fd4620e207d6d5a7281d.tar.gz mew-bf2318462d7024050635fd4620e207d6d5a7281d.tar.xz mew-bf2318462d7024050635fd4620e207d6d5a7281d.zip |
fun=>: fix unquote matching
-rw-r--r-- | mew.scm | 4 | ||||
-rw-r--r-- | 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))) |