wisp

get interweb fluff
Log | Files | Refs

commit b085da5446b58254a82ee457568cf6929f278cfd
parent 315d13b733b3f41191279a6e897e4bbe89896004
Author: rsiddharth <s@ricketyspace.net>
Date:   Tue, 18 Jun 2019 19:51:28 -0400

hn/g: Add athings:index.

* hn/g (athings:index): New function.

Diffstat:
hn/g | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

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