-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuser-tables.rkt
More file actions
21 lines (18 loc) · 796 Bytes
/
Copy pathuser-tables.rkt
File metadata and controls
21 lines (18 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#lang racket/base
(require basedir)
(provide get-user-config-tables)
(define (get-user-config-tables)
;; This is a little awkwark. There's probably a better way to read a file
;; and make sure it's closed properly.
(filter
hash?
(for/list ([file (list-config-files "unicoder-table")])
(with-handlers ([(λ _ #t) (λ _ #f)])
(let ([port (open-input-file file)])
(with-handlers ([(λ _ #t) (λ (e)
(close-input-port port)
(eprintf "error with config file: ~a\n~a"
file
e)
#f)])
(begin0 (read port) (close-input-port port))))))))