From 62ae1e3af18cc47a6e9e940fd9b235b9ac9f04ec Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Wed, 25 Mar 2020 00:03:26 +0100 Subject: [PATCH] utils: Convert dotit and unorg to functions. --- utils.rkt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/utils.rkt b/utils.rkt index 0a307fe..92bca85 100644 --- a/utils.rkt +++ b/utils.rkt @@ -19,6 +19,8 @@ [unstringify-pairs (-> (listof (general-pair/c string? any/c)) (listof (general-pair/c symbol? any/c)))] [read-org-variable-mapping (-> string? variable-mapping?)] + [unorg (-> string? variable-mapping?)] + [dotit (-> graph? void?)] [read-symbol-list (-> string? (listof symbol?))] [drop-first-last (-> string? string?)] [list-sets->list-strings (-> (listof (set/c any/c)) (listof string?))] @@ -48,7 +50,7 @@ [string-variable-mapping? contract?] [general-pair/c (-> contract? contract? contract?)]) ;; Syntax - auto-hash-ref/explicit auto-hash-ref/: unorg dotit) + auto-hash-ref/explicit auto-hash-ref/:) ;;; =================== ;;; HashTable Injection @@ -225,10 +227,10 @@ (compose make-immutable-hash unstringify-pairs read-org-sexp)) ;;; A synonym for read-org-variable-mapping. -(define-syntax-rule (unorg str) (read-org-variable-mapping str)) +(define unorg read-org-variable-mapping) ;;; Typeset the graph via graphviz and display it. -(define-syntax-rule (dotit gr) (display (graphviz gr))) +(define dotit (compose display graphviz)) ;;; Reads a list of symbols from a string. (define (read-symbol-list str)