diff --git a/utils.rkt b/utils.rkt index 34d3df5..7d27e18 100644 --- a/utils.rkt +++ b/utils.rkt @@ -17,6 +17,11 @@ ;;; Given a (HashTable Symbol a) and a sequence of symbols, binds ;;; these symbols to the values they are associated to in the hash ;;; table, then puts the body in the context of these bindings. +;;; +;;; > (let ([ht #hash((a . 1) (b . 2))]) +;;; (auto-hash-ref/explicit (ht a b) (+ a (* 2 b)))) +;;; 5 +;;; (define-syntax (auto-hash-ref/explicit stx) (syntax-parse stx [(_ (ht:id xs:id ...) body:expr)