summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2021-06-01 13:48:23 +0530
committerArun Isaac2021-06-01 13:55:29 +0530
commit2324856e72ef1f0f16a91475498753674df8c8ef (patch)
treeb05a2af4b28d838d79adb1889b3a1a08cbbb7294
parenta9635eaeab7f534c3fe7575f62d36ddca4601971 (diff)
downloadccwl-2324856e72ef1f0f16a91475498753674df8c8ef.tar.gz
ccwl-2324856e72ef1f0f16a91475498753674df8c8ef.tar.lz
ccwl-2324856e72ef1f0f16a91475498753674df8c8ef.zip
Avoid datum->syntax.
* ccwl/utils.scm (lambda**): Avoid using datum->syntax whenever possible.
-rw-r--r--ccwl/utils.scm12
1 files changed, 6 insertions, 6 deletions
diff --git a/ccwl/utils.scm b/ccwl/utils.scm
index 6ad1ffa..71bc1fe 100644
--- a/ccwl/utils.scm
+++ b/ccwl/utils.scm
@@ -116,22 +116,22 @@ for example, be invoked as:
=> (1 2 123 (1 2 3))"
(syntax-case x ()
- ((_ args-spec body ...)
+ ((_ (args-spec ...) body ...)
#`(lambda args
- #,(let* ((positionals rest (break keyword? (syntax->datum #'args-spec)))
+ #,(let* ((args-spec (unsyntax-keywords #'(args-spec ...)))
+ (positionals rest (break keyword? args-spec))
(grouped-rest (group-keyword-arguments rest))
(unary-arguments (or (plist-ref grouped-rest #:key)
(list)))
(nary-arguments (or (plist-ref grouped-rest #:key*)
(list))))
- #`(apply (lambda* #,(datum->syntax x (append positionals
- (cons #:key (append unary-arguments nary-arguments))))
+ #`(apply (lambda* #,(append positionals
+ (cons #:key (append unary-arguments nary-arguments)))
body ...)
(let ((positionals rest (break keyword? args)))
(append positionals
(group-keyword-arguments
- rest (list #,@(map (compose (cut datum->syntax x <>)
- symbol->keyword)
+ rest (list #,@(map (compose symbol->keyword syntax->datum)
unary-arguments))))))))))))
(define (mapn proc lst)