On 28/02/13 15:36, Softaddicts wrote:
Hi,

can you post the JVM used, maybe a snippet of the code around line 68,
the dependencies tree (lein deps :tree) and your project.clj ?

With these we can probably find the root cause of this.

Luc P.

Hi Luc,

thanks for your interest but I think I've cracked it...:) the code that was causing this is the following record. You will notice that 'deploy' delegates to 'run' per component. But then, since a WorkFlow can be a Component as well, the 'run' fn should NOT delegate to 'deploy' as it will only go round in circles! So, from what I understand '(deploy this text)' should be '(reduce #(run %2 %) text components))' which is basically what 'deploy' does! This is in-line with what Marko / Meikel suggested...


(defrecord Workflow [components] ;;a seq of components - the workflow can itself be a component
IWorkflow
(getComponents [this] components) ;;just return all components
(appendComponent [this c] (conj (vec components) c))
(addComponent [this pos c] (addC components pos c))
(removeComponent [this pos] (removeC components pos))
(replaceComponent [this pos replacement] (replaceC components pos replacement))
(deploy [_ text intermediates?]
((if intermediates? reductions reduce)
(fn [init c] (run c init)) text components))
(deploy [this text] (deploy this text false))
;(deploy [this] (deploy this))
IComponent
(link [this pos other]
(Workflow. (help/link this pos other)))
;(run [this] (deploy this))
(run [this text] (deploy this text) ;(reduce #(run %2 %) text components))
;(run [this text & more] (deploy this text (first more)))
clojure.lang.IFn ;;can act as an fn
(invoke [this arg]
(deploy this arg))
(applyTo [this args]
(apply deploy this args)) ) Jim


--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to