utils.rkt: Remove the left-over definitions of read-org-sexp and unorg.

This commit is contained in:
Sergiu Ivanov 2022-01-27 21:10:37 +01:00
parent 8b2bab4d9e
commit 746c586973

View file

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