aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2023-11-18 23:50:12 +0000
committerArun Isaac2023-11-18 23:50:12 +0000
commit1d28ca4c90fef799c024d8631f95c4c3d0d748d4 (patch)
treefcda9f34ecb626b45abf320cec532f339179a54a
parentcd2be030233d529d0319a4b73dd9dbc0eea007f3 (diff)
downloadccwl-1d28ca4c90fef799c024d8631f95c4c3d0d748d4.tar.gz
ccwl-1d28ca4c90fef799c024d8631f95c4c3d0d748d4.tar.lz
ccwl-1d28ca4c90fef799c024d8631f95c4c3d0d748d4.zip
ccwl: Error out if arguments have been supplied more than once.
* ccwl/ccwl.scm (collect-steps): Error out if arguments have been supplied more than once.
-rw-r--r--ccwl/ccwl.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm
index 558161c..b106c6d 100644
--- a/ccwl/ccwl.scm
+++ b/ccwl/ccwl.scm
@@ -695,6 +695,18 @@ represented by <step> objects."
(syntax->datum value)
input-key-symbols))))))
(pairify #'(args ...)))
+ ;; Test for arguments that have been supplied more than once.
+ (fold (match-lambda*
+ (((key-syntax . _) seen)
+ (let ((key (syntax->datum key-syntax)))
+ (when (memq key seen)
+ (raise-exception
+ (condition (ccwl-violation key-syntax)
+ (formatted-message "~a argument already supplied"
+ key))))
+ (cons key seen))))
+ (list)
+ (pairify #'(args ...)))
(let ((symbolic-arguments
literal-arguments
(partition (match-lambda