diff options
author | Morgan Astra <givengravity@gmail.com> | 2018-11-15 19:10:37 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-15 19:10:37 -0800 |
commit | 79d239309664a8f56095289a8a3f6c377fca355f (patch) | |
tree | 7235483e71a125f03e28bfe25cbd58ab3e8c1f9d /src/pronouns/config.clj | |
parent | 04d94c8935377e68292f78671428d564395b1641 (diff) | |
parent | 0581a381ae09b5a09ef97e23abdb38ac9e03c166 (diff) |
Merge pull request #93 from witch-house/reload-pronouns-table
Make the pronouns table an atom and add `reload-table!`
Diffstat (limited to 'src/pronouns/config.clj')
-rw-r--r-- | src/pronouns/config.clj | 12 |
1 files changed, 10 insertions, 2 deletions
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"))) + |