From fa015870d0000c044db564fcf37486947bcf6961 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Sun, 20 Feb 2022 17:30:33 +0100 Subject: [PATCH] Simplify quoting and unquoting in auto-hash-ref/explicit. --- utils.rkt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils.rkt b/utils.rkt index 221bb8b..1679fd0 100644 --- a/utils.rkt +++ b/utils.rkt @@ -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