diff --git a/rs.rkt b/rs.rkt index a782805..5195c4d 100644 --- a/rs.rkt +++ b/rs.rkt @@ -86,10 +86,6 @@ ;;; This section contains some useful primitives for Org-mode ;;; interoperability. -;;; Reads a list of species from a string. -(define (read-symbol-list str) - (string->any (string-append "(" str ")"))) - ;;; Converts a triple of strings to a reaction. (define/match (str-triple->reaction lst) [((list str-reactants str-inhibitors str-products)) diff --git a/utils-tests.rkt b/utils-tests.rkt index dd46c80..8bc7e46 100644 --- a/utils-tests.rkt +++ b/utils-tests.rkt @@ -60,7 +60,8 @@ (check-equal? (hash-ref m3 'a) '(and a b)) (check-equal? (hash-ref m1 'b) '(or b (not a))) (check-equal? (hash-ref m2 'b) '(or b (not a))) - (check-equal? (hash-ref m3 'b) '(or b (not a))))) + (check-equal? (hash-ref m3 'b) '(or b (not a)))) + (check-equal? (read-symbol-list "a b c") '(a b c))) (test-case "Additional graph utilities" (let* ([gr1 (directed-graph '((a b) (b c)))] diff --git a/utils.rkt b/utils.rkt index 94a8c8e..8031bf7 100644 --- a/utils.rkt +++ b/utils.rkt @@ -19,6 +19,7 @@ [unstringify-pairs (-> (listof (general-pair/c string? any/c)) (listof (general-pair/c symbol? any/c)))] [read-org-variable-mapping (-> string? variable-mapping?)] + [read-symbol-list (-> string? (listof symbol?))] [update-vertices/unweighted (-> graph? (-> any/c any/c) graph?)] [update-graph (->* (graph?) (#:v-func (-> any/c any/c) @@ -219,6 +220,10 @@ ;;; Typeset the graph via graphviz and display it. (define-syntax-rule (dotit gr) (display (graphviz gr))) +;;; Reads a list of symbols from a string. +(define (read-symbol-list str) + (string->any (string-append "(" str ")"))) + ;;; ========================== ;;; Additional graph utilities