summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-07-05 20:07:31 -0400
committerrsiddharth <s@ricketyspace.net>2019-07-05 20:07:31 -0400
commit47eed29ef5c9ee2d6aa4a27e07d8e94737b4bac1 (patch)
treeda6b346a2567b1386be35e04c4cc77e8e6fc72ea
parent93c1aec877d17218c4a786081707a4b05793eb9f (diff)
hn: Update athings:hash.HEADmaster
* hn (athings:hash): If read-json returns #eof return empty hash.
-rwxr-xr-xhn5
1 files changed, 4 insertions, 1 deletions
diff --git a/hn b/hn
index 0c424b7..f410878 100755
--- 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)