   (println "Total done: " ?total-done)
   (println "Retracting toggle-all-complete action: " ?toggle)
   (retract! ?toggle))
+
+; Need to nail down our accum syntax. Current expansion violates
+; Clara's schema anyway:
+;Value does not match schema: {:from {:constraints [(not ("s-expression" :all))]}}
+;(def-tuple-rule no-done-todos-when-clear-completed-action
+  ;[:exists [:ui/clear-completed]]
+  ;[[?e :todo/title]]
+  ;[[?e :todo/done]]
+  ;[?entity <- (acc/all) :from [?e :all]]
+  ;=>
+  ; (retract {:todo/keys :all})
+  ; (retract {:todo/keys [title visible done]})
+  ; (retract-entity ?e))
+  ;(println "Retracting entity " ?entity)
+  ;(doseq [tuple ?entity] (retract! tuple)))
 
 (defrule no-done-todos-when-clear-completed-action
   ; when clear completed action exists

  (println "Retracting entity " ?entity)
  (doseq [tuple ?entity] (retract! tuple)))

(defrule clear-completed-action-is-done-when-no-done-todos
  [?action <- :ui/clear-completed]
  [:not [:exists [:todo/done]]]

  [:todo/done [[e a v]] (= ?e e)]
  [?entity <- (acc/all) :from [:all [[e a v]] (= ?e e)]]
  =>
  ; DSL notes on how we might handle retractions such as these.
  ; Follows convention for namespaced keyword destructuring slated for CLJ 1.9
  ; (retract {:todo/keys :all})
  ; (retract {:todo/keys [title visible done]})
  ; (retract-entity ?e)
