diff --git a/utils-tests.rkt b/utils-tests.rkt index d756bd4..7ff27e5 100644 --- a/utils-tests.rkt +++ b/utils-tests.rkt @@ -39,5 +39,8 @@ (check-equal? (any->string '(a 1 (x y))) "(a 1 (x y))") (check-equal? (any->string "hello") "hello") (let ([mp (variable-mapping-stringify #hash((a . (and a b)) (b . (not b))))]) + (check-equal? (hash-ref mp 'a) "(and a b)") + (check-equal? (hash-ref mp 'b) "(not b)")) + (let ([mp (sgfy #hash((a . (and a b)) (b . (not b))))]) (check-equal? (hash-ref mp 'a) "(and a b)") (check-equal? (hash-ref mp 'b) "(not b)"))) diff --git a/utils.rkt b/utils.rkt index d83b7e2..9e73bef 100644 --- a/utils.rkt +++ b/utils.rkt @@ -17,7 +17,7 @@ (contract-out [variable-mapping? contract?] [string-variable-mapping? contract?]) ;; Syntax - auto-hash-ref/explicit auto-hash-ref/:) + auto-hash-ref/explicit auto-hash-ref/: sgfy) ;;; =================== ;;; HashTable Injection @@ -159,3 +159,6 @@ (define (variable-mapping-stringify ht) (make-hash (hash-map ht (λ (key val) (cons key (any->string val)))))) + +;;; A shortcut for variable-mapping-stingify. +(define-syntax-rule (sgfy ht) (variable-mapping-stringify ht))