Created
July 4, 2015 18:38
-
-
Save vinayh/cd6ab88c40580aa21a93 to your computer and use it in GitHub Desktop.
Source of apply
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn apply | |
"Applies fn f to the argument list formed by prepending intervening arguments to args." | |
{:added "1.0" | |
:static true} | |
([^clojure.lang.IFn f args] | |
(. f (applyTo (seq args)))) | |
([^clojure.lang.IFn f x args] | |
(. f (applyTo (list* x args)))) | |
([^clojure.lang.IFn f x y args] | |
(. f (applyTo (list* x y args)))) | |
([^clojure.lang.IFn f x y z args] | |
(. f (applyTo (list* x y z args)))) | |
([^clojure.lang.IFn f a b c d & args] | |
(. f (applyTo (cons a (cons b (cons c (cons d (spread args))))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment