Simplify quoting and unquoting in auto-hash-ref/explicit.

This commit is contained in:
Sergiu Ivanov 2022-02-20 17:30:33 +01:00
parent f6946d94ad
commit fa015870d0
1 changed files with 3 additions and 3 deletions

View File

@ -51,9 +51,9 @@
(define-syntax (auto-hash-ref/explicit stx)
(syntax-parse stx
[(_ (ht:id xs:id ...) body:expr)
#`(let #,(for/list ([x (syntax->list #'(xs ...))])
#`[#,x (hash-ref ht '#,x)])
[(_ (ht:id keys:id ...) body:expr)
#`(let #,(for/list ([key (syntax->list #'(keys ...))])
`[,key (hash-ref ,#'ht ',key)])
body)]))
(module+ test