From a9635eaeab7f534c3fe7575f62d36ddca4601971 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 1 Jun 2021 13:54:12 +0530 Subject: Add unsyntax-keywords. * ccwl/utils.scm (unsyntax-keywords): New function. --- ccwl/utils.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) 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** -- cgit v1.2.3