From 1d28ca4c90fef799c024d8631f95c4c3d0d748d4 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sat, 18 Nov 2023 23:50:12 +0000 Subject: 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. --- ccwl/ccwl.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 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 -- cgit v1.2.3