From cdedc54e7c51755103d78014e8a8773d82110c63 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 20 Jul 2021 16:58:48 +0530 Subject: ccwl: Set default value of lambda** n-ary arguments to '(). * ccwl/utils.scm (lambda**): Set default value of lambda** n-ary arguments to the empty list. Document this in the docstring. * tests/utils.scm ("default value of lambda** unary argument should be #f", "default value of lambda** n-ary argument should be the empty list"): New tests. --- tests/utils.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/utils.scm b/tests/utils.scm index 5c5bfd1..bc9315d 100644 --- a/tests/utils.scm +++ b/tests/utils.scm @@ -70,6 +70,16 @@ (list foo aal vale pal naal irandu sol)) 1 2 #:vale 123 #:naal 321 456)) +(test-equal "default value of lambda** unary argument should be #f" + #f + ((lambda** (#:key foo) + foo))) + +(test-equal "default value of lambda** n-ary argument should be the empty list" + '() + ((lambda** (#:key* foo) + foo))) + (test-assert "syntax-lambda**" (equal? (list #'1 #'2 #'123 (list #'1 #'2 #'3)) ((syntax-lambda** (a b #:key foo #:key* bar) -- cgit v1.2.3