Created
May 30, 2018 12:12
-
-
Save green-coder/5b962f443b193505a00f864784663f55 to your computer and use it in GitHub Desktop.
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 debug | |
; Default parameters stuffs. | |
([] (debug 0)) | |
([indent] (debug indent ">" "<")) | |
([indent in out] | |
(let [spaces (apply str (repeat indent \space))] | |
(debug (str spaces in) | |
(str spaces out)))) | |
; The transducer code starts here. | |
([in out] | |
(fn [rf] | |
(fn ([] (rf)) | |
([result] (rf result)) | |
([result input] | |
(print in input \return) | |
(let [ret (rf result input)] | |
(print out ret \return) | |
ret)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment