diff options
author | rsiddharth <s@ricketyspace.net> | 2019-06-18 19:51:28 -0400 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2019-06-18 19:51:28 -0400 |
commit | b085da5446b58254a82ee457568cf6929f278cfd (patch) | |
tree | cb9632b85b737999d295e58b8c7f98a4f9422553 /hn/g | |
parent | 315d13b733b3f41191279a6e897e4bbe89896004 (diff) |
hn/g: Add athings:index.
* hn/g (athings:index): New function.
Diffstat (limited to 'hn/g')
-rwxr-xr-x | hn/g | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -84,3 +84,10 @@ (cond ((file-exists? f) (call-with-input-file f (λ (in) (read-json in)))) (else '())))) +(define (athings:index slug) + (let ((f (build-path (athings:data-dir) "list")) + (l (athings:list))) + (unless (member slug l) + (call-with-output-file f (λ (out) (write-json (cons slug l) out)) + #:exists 'truncate)))) + |