From 4c658c87fbf513e69e00fe90dbfc9480dab3453c Mon Sep 17 00:00:00 2001 From: Matthew Darling Date: Mon, 2 Mar 2015 08:02:45 -0500 Subject: [PATCH] Move user-provided protocol impls after generic This allows the user to provide their own versions of start, stop, or status for systems. I'll need to test it, but based on the following example, it should work: user> (defrecord NewThing [attr] Speak (say [this] "woo") Speak (say [this] "boo")) ;=> user.NewThing user> (say (->NewThing 5)) "boo" --- src/cljx/com/palletops/leaven.cljx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cljx/com/palletops/leaven.cljx b/src/cljx/com/palletops/leaven.cljx index 51d448e..f715aeb 100644 --- a/src/cljx/com/palletops/leaven.cljx +++ b/src/cljx/com/palletops/leaven.cljx @@ -208,7 +208,6 @@ `(do (def ~option-sym ~options) ; defrecord functions can't access lexical scope (defrecord ~record-name [~@component-syms] - ~@body protocols/Startable (~'start [component#] (apply-components @@ -220,4 +219,5 @@ protocols/Queryable (~'status [component#] (apply-components - status component# ~rcomponents "querying status" nil)))))) + status component# ~rcomponents "querying status" nil)) + ~@body))))