Created
July 14, 2012 11:09
-
-
Save visibletrap/3110628 to your computer and use it in GitHub Desktop.
Print-Increment Function
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 characters
(defn pi | |
([] (pi 0)) | |
([x] (println x) #(pi (+ x 1)))) | |
; result | |
=> (((((((pi))))))) | |
0 | |
1 | |
2 | |
3 | |
4 | |
5 | |
6 |
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 characters
pi = ->x = 0 do | |
puts x | |
->{ pi[x + 1] } | |
end | |
# result | |
> pi[][][][][][][] | |
0 | |
1 | |
2 | |
3 | |
4 | |
5 | |
6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment