functions: Add read-org-tbfs.
This commit is contained in:
parent
dd3062652f
commit
b52aa188b9
1 changed files with 11 additions and 1 deletions
|
@ -34,7 +34,8 @@
|
||||||
[vector-boolean->01 (-> (vectorof boolean?) (vectorof (or/c 0 1)))]
|
[vector-boolean->01 (-> (vectorof boolean?) (vectorof (or/c 0 1)))]
|
||||||
[apply-tbf (-> tbf? (vectorof (or/c 0 1)) (or/c 0 1))]
|
[apply-tbf (-> tbf? (vectorof (or/c 0 1)) (or/c 0 1))]
|
||||||
[apply-tbf/boolean (-> tbf? (vectorof boolean?) boolean?)]
|
[apply-tbf/boolean (-> tbf? (vectorof boolean?) boolean?)]
|
||||||
[list->tbf (-> (cons/c number? (cons/c number? (listof number?))) tbf?)]))
|
[list->tbf (-> (cons/c number? (cons/c number? (listof number?))) tbf?)]
|
||||||
|
[read-org-tbfs (-> (listof (listof number?)) (listof tbf?))]))
|
||||||
|
|
||||||
(module+ test
|
(module+ test
|
||||||
(require rackunit))
|
(require rackunit))
|
||||||
|
@ -290,3 +291,12 @@
|
||||||
(module+ test
|
(module+ test
|
||||||
(test-case "list->tbf"
|
(test-case "list->tbf"
|
||||||
(check-equal? (list->tbf '(1 2 3)) (tbf #(1 2) 3))))
|
(check-equal? (list->tbf '(1 2 3)) (tbf #(1 2) 3))))
|
||||||
|
|
||||||
|
;;; Reads of a list of TBF from an Org-mode table read by
|
||||||
|
;;; read-org-sexp.
|
||||||
|
(define read-org-tbfs ((curry map) list->tbf))
|
||||||
|
|
||||||
|
(module+ test
|
||||||
|
(test-case "read-org-tbfs"
|
||||||
|
(check-equal? (read-org-tbfs '((1 2 3) (2 3 4)))
|
||||||
|
(list (tbf '#(1 2) 3) (tbf '#(2 3) 4)))))
|
||||||
|
|
Loading…
Reference in a new issue