aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-01-16 12:22:46 +0530
committerArun Isaac2022-01-16 12:25:17 +0530
commitfa583a919f270bb1ddf0c9102fa633b10d3dff10 (patch)
tree6a53d4fb9f2b3483c2b72cd735aacc86c1c326e5
parent8a4da0fbae43592f6afd739ecab9a885bde2ba1b (diff)
downloadccwl-fa583a919f270bb1ddf0c9102fa633b10d3dff10.tar.gz
ccwl-fa583a919f270bb1ddf0c9102fa633b10d3dff10.tar.lz
ccwl-fa583a919f270bb1ddf0c9102fa633b10d3dff10.zip
ccwl: Document default default value of syntax-lambda**.
* ccwl/utils.scm (syntax-lambda**): Document default default value. * tests/utils.scm ("default default value of syntax-lambda** unary argument should be #f", "default default value of syntax-lambda** n-ary argument should be the empty list"): New tests.
-rw-r--r--ccwl/utils.scm3
-rw-r--r--tests/utils.scm10
2 files changed, 12 insertions, 1 deletions
diff --git a/ccwl/utils.scm b/ccwl/utils.scm
index db74c7f..04938b1 100644
--- a/ccwl/utils.scm
+++ b/ccwl/utils.scm
@@ -252,7 +252,8 @@ number of positional arguments is passed, a
=> (#'1 #'2 #'123 (#'1 #'2 #'3))
Like lambda**, syntax-lambda** supports default values for
-arguments. For example,
+arguments. The default default value for unary arguments is #f, while
+that for n-ary arguments is the empty list. For example,
((syntax-lambda** (foo aal #:key vale (pal 9) #:key* naal (irandu 7) (sol 3 2 1))
(list foo aal vale pal naal irandu sol))
diff --git a/tests/utils.scm b/tests/utils.scm
index 6b14f29..3970a5c 100644
--- a/tests/utils.scm
+++ b/tests/utils.scm
@@ -132,6 +132,16 @@
(list foo aal vale pal naal irandu sol))
#'1 #'2 #'#:vale #'123 #'#:naal #'321 #'456)))
+(test-equal "default default value of syntax-lambda** unary argument should be #f"
+ #f
+ ((syntax-lambda** (#:key foo)
+ foo)))
+
+(test-equal "default default value of syntax-lambda** n-ary argument should be the empty list"
+ '()
+ ((syntax-lambda** (#:key* foo)
+ foo)))
+
;; We cannot use test-equal to compare syntax objects, since
;; test-equal does not preserve the lexical contexts of the test
;; expressions.