about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2026-06-22 00:51:21 +0100
committerArun Isaac2026-06-22 00:51:21 +0100
commitfdedfc0088714ed82c93a0e44e2d8cd2def10f91 (patch)
treeb435857795ae90d2baaa0d0b0768f5ee9e538e2b
parent8add8ab66317215d772f4a82c6267b62688f9371 (diff)
downloadccwl-fdedfc0088714ed82c93a0e44e2d8cd2def10f91.tar.gz
ccwl-fdedfc0088714ed82c93a0e44e2d8cd2def10f91.tar.lz
ccwl-fdedfc0088714ed82c93a0e44e2d8cd2def10f91.zip
ccwl: Error out if old key in rename is a keyword.
-rw-r--r--ccwl/ccwl.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm
index 075ae0c..a2d9ea2 100644
--- a/ccwl/ccwl.scm
+++ b/ccwl/ccwl.scm
@@ -772,11 +772,16 @@ represented by <step> objects."
     ;; rename keys (base case)
     ((rename new-key old-key)
      (begin
-       ;; Error out on non-keyword arguments.
+       ;; Error out if new key is not a keyword.
        (unless (keyword? (syntax->datum #'new-key))
          (raise-exception
           (condition (ccwl-violation #'new-key)
                      (formatted-message "Expected keyword (for example: #:foo, #:bar)"))))
+       ;; Error out if old key is a keyword.
+       (when (keyword? (syntax->datum #'old-key))
+         (raise-exception
+          (condition (ccwl-violation #'old-key)
+                     (formatted-message "Unexpected keyword; expected symbol (for example: foo, bar)"))))
        ;; Ensure old key exists.
        (unless (memq (syntax->datum #'old-key)
                      (map key-name input-keys))