utils.rkt: Remove the left-over definitions of read-org-sexp and unorg.
This commit is contained in:
parent
8b2bab4d9e
commit
746c586973
1 changed files with 0 additions and 18 deletions
18
utils.rkt
18
utils.rkt
|
@ -304,24 +304,6 @@
|
||||||
;;; A string variable mapping is a mapping from variables to strings.
|
;;; A string variable mapping is a mapping from variables to strings.
|
||||||
(define (string-variable-mapping? dict) (hash/c symbol? string?))
|
(define (string-variable-mapping? dict) (hash/c symbol? string?))
|
||||||
|
|
||||||
;;; Reads a sexp from a string produced by Org-mode for a named table.
|
|
||||||
;;; See example.org for examples.
|
|
||||||
(define read-org-sexp
|
|
||||||
(compose ((curry map-sexp) (match-lambda
|
|
||||||
[(and (? string?) str) (string->any str)]
|
|
||||||
[x x]))
|
|
||||||
string->any))
|
|
||||||
|
|
||||||
;;; A shortcut for read-org-sexp.
|
|
||||||
(define unorg read-org-sexp)
|
|
||||||
|
|
||||||
(module+ test
|
|
||||||
(test-case "read-org-sexp"
|
|
||||||
(check-equal? (read-org-sexp "((\"a\" \"(and a b)\") (\"b\" \"(or b (not a))\"))")
|
|
||||||
'((a (and a b)) (b (or b (not a)))))
|
|
||||||
(check-equal? (read-org-sexp "(#t \"#t\" \"#t \" '(1 2 \"#f\"))")
|
|
||||||
'(#t #t #t '(1 2 #f)))))
|
|
||||||
|
|
||||||
;;; A contract allowing pairs constructed via cons or via list.
|
;;; A contract allowing pairs constructed via cons or via list.
|
||||||
(define (general-pair/c key-contract val-contract)
|
(define (general-pair/c key-contract val-contract)
|
||||||
(or/c (list/c key-contract val-contract)
|
(or/c (list/c key-contract val-contract)
|
||||||
|
|
Loading…
Reference in a new issue