store/[org.clojure/clojure "1.8.0"] clj::clojure.core/partial

Official Documentation

Add notes
Arities
==================================================
   [f]
   [f arg1]
   [f arg1 arg2]
   [f arg1 arg2 arg3]
   [f arg1 arg2 arg3 & more]

Docstring
==================================================
  Takes a function f and fewer than the normal arguments to f, and
  returns a fn that takes a variable number of additional args. When
  called, the returned function calls f with args + additional args.

Source

(defn partial
  "Takes a function f and fewer than the normal arguments to f, and
  returns a fn that takes a variable number of additional args. When
  called, the returned function calls f with args + additional args."
  {:added "1.0"
   :static true}
  ([f] f)
  ([f arg1]
   (fn
     ([] (f arg1))
     ([x] (f arg1 x))
     ([x y] (f arg1 x y))
     ([x y z] (f arg1 x y z))
     ([x y z & args] (apply f arg1 x y z args))))
  ([f arg1 arg2]
   (fn
     ([] (f arg1 arg2))
     ([x] (f arg1 arg2 x))
     ([x y] (f arg1 arg2 x y))
     ([x y z] (f arg1 arg2 x y z))
     ([x y z & args] (apply f arg1 arg2 x y z args))))
  ([f arg1 arg2 arg3]
   (fn
     ([] (f arg1 arg2 arg3))
     ([x] (f arg1 arg2 arg3 x))
     ([x y] (f arg1 arg2 arg3 x y))
     ([x y z] (f arg1 arg2 arg3 x y z))
     ([x y z & args] (apply f arg1 arg2 arg3 x y z args))))
  ([f arg1 arg2 arg3 & more]
   (fn [& args] (apply f arg1 arg2 arg3 (concat more args)))))

Example 1

Edit
(def subtract-from-hundred (partial - 100))

(subtract-from-hundred 10)      ; same as (- 100 10)
;; => 90

(subtract-from-hundred 10 20)   ; same as (- 100 10 20)
;; => 70

Example 2

Edit
(require '[clojure.pprint])
;; => nil

(def to-english (partial clojure.pprint/cl-format nil "~@(~@[~R~]~^ ~A.~)"))
;; => #'user/to-english

(to-english 1234567890)
;; => "One billion, two hundred thirty-four million, five hundred sixty-seven thousand, eight hundred ninety"

Example 3

Edit
(def hundred-times (partial * 100))
;; => #'user/hundred-times

(hundred-times 5)
;; => 500

(hundred-times 4 5 6)
;; => 12000

(def add-hundred (partial + 100))
;; => #'user/add-hundred

(add-hundred 5)
;; => 105

Example 4

Edit
; Maps exponent to coefficient
; x^3 + 2x + 1
(def poly (fn [n]
            (cond
              (= 0 n) 1
              (= 1 n) 2
              (= 3 n) 1
              :else 0))); Differentiates input by returning a polynomial that is curried
; 3x^2 + 2
(defn diff [p]
  (partial (fn [p n] (* (+ 1 n) (p (+ 1 n)))) p))

(poly 3)
;=> 1
((diff poly) 3)
;=> 0
((diff poly) 2)
;=> 3

Uses on crossclj