diff options
author | rsiddharth <s@ricketyspace.net> | 2019-07-05 20:07:31 -0400 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2019-07-05 20:07:31 -0400 |
commit | 47eed29ef5c9ee2d6aa4a27e07d8e94737b4bac1 (patch) | |
tree | da6b346a2567b1386be35e04c4cc77e8e6fc72ea | |
parent | 93c1aec877d17218c4a786081707a4b05793eb9f (diff) |
* hn (athings:hash): If read-json returns #eof return empty hash.
-rwxr-xr-x | hn | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -76,7 +76,10 @@ (define (athings:hash f) (cond ((file-exists? f) - (call-with-input-file f (λ (in) (read-json in)))) + (call-with-input-file f + (λ (in) + (let ((j (read-json in))) + (if (eof-object? j) (make-immutable-hash) j))))) (else (make-immutable-hash)))) (define (athings:list) |