utils: Convert dotit and unorg to functions.
This commit is contained in:
parent
c4af42a2f6
commit
62ae1e3af1
1 changed files with 5 additions and 3 deletions
|
@ -19,6 +19,8 @@
|
||||||
[unstringify-pairs (-> (listof (general-pair/c string? any/c))
|
[unstringify-pairs (-> (listof (general-pair/c string? any/c))
|
||||||
(listof (general-pair/c symbol? any/c)))]
|
(listof (general-pair/c symbol? any/c)))]
|
||||||
[read-org-variable-mapping (-> string? variable-mapping?)]
|
[read-org-variable-mapping (-> string? variable-mapping?)]
|
||||||
|
[unorg (-> string? variable-mapping?)]
|
||||||
|
[dotit (-> graph? void?)]
|
||||||
[read-symbol-list (-> string? (listof symbol?))]
|
[read-symbol-list (-> string? (listof symbol?))]
|
||||||
[drop-first-last (-> string? string?)]
|
[drop-first-last (-> string? string?)]
|
||||||
[list-sets->list-strings (-> (listof (set/c any/c)) (listof string?))]
|
[list-sets->list-strings (-> (listof (set/c any/c)) (listof string?))]
|
||||||
|
@ -48,7 +50,7 @@
|
||||||
[string-variable-mapping? contract?]
|
[string-variable-mapping? contract?]
|
||||||
[general-pair/c (-> contract? contract? contract?)])
|
[general-pair/c (-> contract? contract? contract?)])
|
||||||
;; Syntax
|
;; Syntax
|
||||||
auto-hash-ref/explicit auto-hash-ref/: unorg dotit)
|
auto-hash-ref/explicit auto-hash-ref/:)
|
||||||
|
|
||||||
;;; ===================
|
;;; ===================
|
||||||
;;; HashTable Injection
|
;;; HashTable Injection
|
||||||
|
@ -225,10 +227,10 @@
|
||||||
(compose make-immutable-hash unstringify-pairs read-org-sexp))
|
(compose make-immutable-hash unstringify-pairs read-org-sexp))
|
||||||
|
|
||||||
;;; A synonym for read-org-variable-mapping.
|
;;; 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.
|
;;; 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.
|
;;; Reads a list of symbols from a string.
|
||||||
(define (read-symbol-list str)
|
(define (read-symbol-list str)
|
||||||
|
|
Loading…
Reference in a new issue