                                 :previous-args (vec args)
                                 :previous-render invoked
                                 :previous-ratom-args ratom-args})))))
-        ;; otherwise it is an item, already rendering
+        ;; otherwise it is an item that must be rendered anyway (except that a diff will be computed)
         :else
         (recur (rest elements)
                ratoms-map

;; just reuse its previous value.
;;}

;; CONTROLLER
;; ----------
;; Will be inside the the universe

;; (defn make-controller []
;;   (atom {:components {}}))

;; XXX: nested #(...) are not allowed ...
;; (defn register-component! [controller component]
;;   (swap! controller #(update % :components #(assoc % component {}))))

(defn register-component! [controller component]
  (swap! controller #(update % :components (fn [comps] (assoc comps component {})))))

(defn unregister-component! [controller component]

;; and produces a complete scene and an updated controller
;;}

;; auxiliary functions to maintain the `ratoms-map` in the component renderer
(declare register-ratoms-map
         unregister-ratoms-map)

(defn render-component
  "Renders the scene `component` in the context of the controller `ctrl`."
  [ctrl component]
  (loop [elements (list component)
         , ratoms-map {}  ; we build a map associating each referenced ratom to the components that depend on it
         , rendering []   ; this is finally the items to effectively render
         , rendered #{}   ; we are careful note to render twice the same item
         , seen #{}       ; we also track all the items we encountered
         , ctrl ctrl]     ; the controller state is optionally updated at each step
    ;; the loop proceeds for the component and all its subcomponents (if any)
    (if (seq elements)
      (cond
        ;; if the first element is a scene, splice it into the rest
