summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2021-06-01 13:54:12 +0530
committerArun Isaac2021-06-01 13:55:29 +0530
commita9635eaeab7f534c3fe7575f62d36ddca4601971 (patch)
treebd82e1841e3ba4389f0b54c63352856bbf4517df
parentde985209acc2438459eb93d407a15c93eb48dfab (diff)
downloadccwl-a9635eaeab7f534c3fe7575f62d36ddca4601971.tar.gz
ccwl-a9635eaeab7f534c3fe7575f62d36ddca4601971.tar.lz
ccwl-a9635eaeab7f534c3fe7575f62d36ddca4601971.zip
Add unsyntax-keywords.
* ccwl/utils.scm (unsyntax-keywords): New function.
-rw-r--r--ccwl/utils.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/ccwl/utils.scm b/ccwl/utils.scm
index c75ec91..6ad1ffa 100644
--- a/ccwl/utils.scm
+++ b/ccwl/utils.scm
@@ -83,6 +83,17 @@ or #f if there is no such entry."
((_ value . _) value)
(#f #f)))
+(define (unsyntax-keywords lst)
+ "Unsyntax keywords in LST, a list of syntax objects. For example:
+
+(unsyntax-keywords (list #'#:ham #'1 #'#:eggs #'2))
+=> (#:ham #'1 #:eggs 2)"
+ (map (lambda (element)
+ (if (keyword? (syntax->datum element))
+ (syntax->datum element)
+ element))
+ lst))
+
;; TODO: Implement a define** for lambda** in the spirit of define*
;; for lambda*.
(define-syntax lambda**