aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.