Clojure Multi Method Chain with Partial

In my last post I had mentioned that there could be an improvement to the code below: (-> subject-items ((partial sort-by :Name)) ((partial drop (* page-number items-per-page)) ((partial take items-per-page))) Simple method chain taking advantage of partial methods. That might be fine for lesser beings, but not for someone so ruggishly handsome as me. To take an […]

Clojure: How to Chain Array Functions Using Partial

Wrote this just recently as a part of way to mock a database query for testing JavaScript controls. (defn retrieve-subject-items [page per-page sort descending] (take items-per-page (drop (* page-number items-per-page) (sort-by (to-key sort) subject-items)))) Is the “why” important? No. What is important is that all of these list functions have one thing in common: take […]