Skip to content

Instantly share code, notes, and snippets.

@rik0
Created February 10, 2011 21:27
Show Gist options
  • Save rik0/821384 to your computer and use it in GitHub Desktop.
Save rik0/821384 to your computer and use it in GitHub Desktop.
(defn -initialize [this params]
(dosync
(alter (.state this) merge
(unpack-parameters
params
[:is-starting-node :connections-on-spawn :starting-nodes]
(array-map :is-starting-node false))))
true)
(defn unpack-parameters
([params ks defaults]
(merge defaults
(apply hash-map
(interleave ks params))))
([params defaults]
(unpack-parameters params (keys defaults) defaults)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment