From 7d52533f743c20e9e31caa94a4af43ee0c6790c5 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Sat, 22 Feb 2020 12:12:57 +0100 Subject: [PATCH] utils: variable-mapping-stringify -> stringify-variable-mapping. --- utils-tests.rkt | 2 +- utils.rkt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/utils-tests.rkt b/utils-tests.rkt index 2534121..3d075d5 100644 --- a/utils-tests.rkt +++ b/utils-tests.rkt @@ -38,7 +38,7 @@ (check-equal? (any->string 'a) "a") (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))))]) + (let ([mp (stringify-variable-mapping #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))))]) diff --git a/utils.rkt b/utils.rkt index 924eb2d..d4c3bac 100644 --- a/utils.rkt +++ b/utils.rkt @@ -12,7 +12,7 @@ (contract-out [eval-with (-> variable-mapping? any/c any)] [extract-symbols (-> any/c list?)] [any->string (-> any/c string?)] - [variable-mapping-stringify (-> variable-mapping? string-variable-mapping?)] + [stringify-variable-mapping (-> variable-mapping? string-variable-mapping?)] [string->any (-> string? any/c)]) ;; Contracts (contract-out [variable-mapping? contract?] @@ -157,12 +157,12 @@ (define (string-variable-mapping? dict) (hash/c symbol? string?)) ;;; Converts all the values of a variable mapping to string. -(define (variable-mapping-stringify ht) +(define (stringify-variable-mapping 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)) +(define-syntax-rule (sgfy ht) (stringify-variable-mapping ht)) ;;; Reads any value from string. (define (string->any str)