aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArun Isaac2021-07-20 15:53:43 +0530
committerArun Isaac2021-07-20 15:58:32 +0530
commitbe338a13488a219bed1ae96d5c264d09c4c35efd (patch)
treecce472d4af64a3f0e6abc511275a73420e0a84d8 /tests
parent2eccdc9fbc8b1ed0666ef82d0e1e280b85945b3c (diff)
downloadccwl-be338a13488a219bed1ae96d5c264d09c4c35efd.tar.gz
ccwl-be338a13488a219bed1ae96d5c264d09c4c35efd.tar.lz
ccwl-be338a13488a219bed1ae96d5c264d09c4c35efd.zip
ccwl: Support default values for arguments in lambda**.
* ccwl/utils.scm (lambda**): Support default values for arguments, both unary and n-ary. * tests/utils.scm ("lambda** with default values"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/utils.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/utils.scm b/tests/utils.scm
index 6b38708..473bd45 100644
--- a/tests/utils.scm
+++ b/tests/utils.scm
@@ -64,6 +64,12 @@
(list a b foo bar))
1 2 #:foo 123 #:bar 1 2 3))
+(test-equal "lambda** with default values"
+ '(1 2 123 9 (321 456) (7) (3 2 1))
+ ((lambda** (foo aal #:key vale (pal 9) #:key* naal (irandu 7) (sol 3 2 1))
+ (list foo aal vale pal naal irandu sol))
+ 1 2 #:vale 123 #:naal 321 456))
+
(test-assert "syntax-lambda**"
(equal? (list #'1 #'2 #'123 (list #'1 #'2 #'3))
((syntax-lambda** (a b #:key foo #:key* bar)