TUPLE: cd { title string } { artist string } { rating number } { ripped boolean } ; C: cd : save-as-json ( obj filename -- ) [ >json ] dip utf8 set-file-contents ; : read-from-json ( filename -- array ) utf8 file-contents json> ; : hashtable>cd ( hashtable -- cd ) >alist cd "slots" word-prop [ name>> ] map [ dupd of ] map nip first4 cd boa ; : load-cd-db ( -- ) P" /Users/loryn/json-db-cd-collection" read-from-json make-db [ hashtable>cd db-add ] each ;