From 8bc2a582a676b84c5d33bcf973722e6e1e4fbd98 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Tue, 24 Mar 2020 23:47:20 +0100 Subject: [PATCH] utils: Remove sgfy. --- example/example.org | 2 +- utils-tests.rkt | 3 --- utils.rkt | 5 +---- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/example/example.org b/example/example.org index dfff9e9..a48cb91 100644 --- a/example/example.org +++ b/example/example.org @@ -152,7 +152,7 @@ converts all the values of a given variable mapping to strings: #+BEGIN_SRC racket :results table drawer -(sgfy #hash((a . (and a b)) (b . (not b)))) +(stringify-variable-mapping #hash((a . (and a b)) (b . (not b)))) #+END_SRC #+RESULTS: diff --git a/utils-tests.rkt b/utils-tests.rkt index 82fa0d4..7f822d3 100644 --- a/utils-tests.rkt +++ b/utils-tests.rkt @@ -41,9 +41,6 @@ (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))))]) - (check-equal? (hash-ref mp 'a) "(and a b)") - (check-equal? (hash-ref mp 'b) "(not b)")) (check-equal? (string->any "(or b (not a))") '(or b (not a))) (check-equal? (string->any "14") 14) (check-equal? (read-org-sexp "((\"a\" \"(and a b)\") (\"b\" \"(or b (not a))\"))") diff --git a/utils.rkt b/utils.rkt index b0fbad8..0a307fe 100644 --- a/utils.rkt +++ b/utils.rkt @@ -48,7 +48,7 @@ [string-variable-mapping? contract?] [general-pair/c (-> contract? contract? contract?)]) ;; Syntax - auto-hash-ref/explicit auto-hash-ref/: sgfy unorg dotit) + auto-hash-ref/explicit auto-hash-ref/: unorg dotit) ;;; =================== ;;; HashTable Injection @@ -190,9 +190,6 @@ (define (stringify-variable-mapping ht) (for/hash ([(key val) ht]) (values key (any->string val)))) -;;; A shortcut for variable-mapping-stingify. -(define-syntax-rule (sgfy ht) (stringify-variable-mapping ht)) - ;;; Reads any value from string. (define (string->any str) (with-input-from-string str (λ () (read))))