wisp

get interweb fluff
Log | Files | Refs

commit 47eed29ef5c9ee2d6aa4a27e07d8e94737b4bac1
parent 93c1aec877d17218c4a786081707a4b05793eb9f
Author: rsiddharth <s@ricketyspace.net>
Date:   Fri,  5 Jul 2019 20:07:31 -0400

hn: Update athings:hash.

* hn (athings:hash): If read-json returns #eof return empty hash.

Diffstat:
hn | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hn b/hn @@ -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)