I originally intended to implement this in #62 but I think I must have forgotten to check in all of the changes to make it happen. This PR implements the actual changes
defmodel macro generates a record type using Potemkindefrecord+ instead of vanilla Clojure defrecord. This behaves identically to normal defrecord for all intents and purposes, but unlike vanilla defrecord, reevaluating the form will not replace the original class if the form itself has not changed. This makes working with Toucan models during interactive development an order of magnitude easier: previously, reloading a namespace containing a Toucan model would require you to reload any other namespaces that used that class, e.g. for interface/protocol/multimethod dispatch.
I originally intended to implement this in #62 but I think I must have forgotten to check in all of the changes to make it happen. This PR implements the actual changes
defmodel
macro generates a record type using Potemkindefrecord+
instead of vanilla Clojuredefrecord
. This behaves identically to normaldefrecord
for all intents and purposes, but unlike vanilladefrecord
, reevaluating the form will not replace the original class if the form itself has not changed. This makes working with Toucan models during interactive development an order of magnitude easier: previously, reloading a namespace containing a Toucan model would require you to reload any other namespaces that used that class, e.g. for interface/protocol/multimethod dispatch.