I am trying to implement a protocol with an entry in the clojure program that I am writing. The error I get is "Unsupported form of binding".
(defprotocol query-rows
(query-text [table])
(trans-cols [table rows])
(set-max [table] [table id]))
(defrecord Submissions [data max-id]
query-rows
(query-text [table]
(gen-query-text "SubmissionId" "Valid" "Submission"))
(trans-cols [table rows]
(let
[trans-data
(->>
rows
(trans-col
(trans-col
(trans-col format-sql-date :createdon :date))]
(assoc table :data trans-data)))
(set-max
([table]
(when-let [id (gen-get-max "SubmissionAgg2")]
(assoc table :max-id id)))
([table id] (assoc table :max-id id))))
The set-max function is what throws an error. It feels like I'm trying to misuse a few things. Does anyone know what I'm doing wrong?
source
share