   [: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)

  (println "Marked done via toggle complete:" ?e)
  (insert-unconditional! [?e :todo/done :done]))

(defrule remove-toggle-complete-when-all-todos-done
  [?toggle <- :ui/toggle-complete]
  [?total <- (acc/count) :from [:todo/title]]

  (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
