We're updating the issue view to help you get more done. 

through method should always have cache as first argument to make it more friendly for swap!

Description

Given that "through" returns a new cache (like the other methods), it is quite likely that people will store the cache in an atom. Currently, code using through looks like this:

(defn load-secondary-index-segment [[filename offset length :as segment]]
(swap! segment-cache #(cache/through fetch-secondary-index-segment % segment))
(cache/lookup @segment-cache segment))

If the cache argument were always first, it would work nicely with swap, ->, etc, be more consistent with conj, assoc, etc, and you'd have this instead:

(defn load-secondary-index-segment [[filename offset length :as segment]]
(swap! segment-cache cache/through fetch-secondary-index-segment segment)
(cache/lookup @segment-cache segment))

Environment

None

Status

Assignee

Sean Corfield

Reporter

import

Labels

None

Approval

None

Patch

None

Priority

Minor