From 51e7ba30722d7a6d8a5fd4d35d25b8a4996b04a4 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Mon, 17 Feb 2020 00:16:01 +0100 Subject: [PATCH] auto-hash-ref/explicit: Add an example to the comment. --- utils.rkt | 5 +++++ 1 file changed, 5 insertions(+) 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)