Last active
July 13, 2018 15:24
-
-
Save emidln/acf3aae6ec6c366fd30b0eaf980c26fc to your computer and use it in GitHub Desktop.
Revisions
-
emidln revised this gist
Jul 13, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ (defmacro rpartial "Takes a form leaving a new variadic function which calls the head of form with the variadic arguments and then the arguments passed in as form. This has the effect of being a partial which preloads arguments from the right instead of the left. e.g. -
emidln revised this gist
Jul 13, 2018 . No changes.There are no files selected for viewing
-
emidln revised this gist
Jul 13, 2018 . No changes.There are no files selected for viewing
-
emidln created this gist
Jul 13, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ (defmacro rpartial "Takes a form leaving a new variadic function which calls the head of form with the variadic arguments and then the arguments passed in as form. This has the effect of being a partial which loads arguments from the right instead of the left. e.g. ((rpartial str \"World\") \"Hello \")" [& [f & xs]] `(f ([x#] (~f x# ~@xs)) ([x# y#] (~f x# y# ~@xs)) ([x# y# z#] (~f x# y# z# ~@xs)) ([x# y# z# & more#] (apply ~f x# y# z# (concat more# [~@xs])))))