From 0581a381ae09b5a09ef97e23abdb38ac9e03c166 Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Thu, 15 Nov 2018 19:07:12 -0800 Subject: Make the pronouns table an atom and add `reload-table!` This is useful primarily for repl development --- src/pronouns/config.clj | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/pronouns/config.clj') diff --git a/src/pronouns/config.clj b/src/pronouns/config.clj index 3a07c36..e35ac7e 100644 --- a/src/pronouns/config.clj +++ b/src/pronouns/config.clj @@ -17,5 +17,13 @@ (ns pronouns.config (:require [pronouns.util :as u])) -(def ^:dynamic *pronouns-table* - (u/slurp-tabfile "resources/pronouns.tab")) +(def pronouns-table + (atom (u/slurp-tabfile "resources/pronouns.tab"))) + +(defn replace-value [old new] new) + +(defn reload-table! [] + (swap! pronouns-table + replace-value + (u/slurp-tabfile "resources/pronouns.tab"))) + -- cgit