utils: Convert dotit and unorg to functions.

This commit is contained in:
Sergiu Ivanov 2020-03-25 00:03:26 +01:00
parent c4af42a2f6
commit 62ae1e3af1
1 changed files with 5 additions and 3 deletions

View File

@ -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)