Created
July 1, 2015 10:54
-
-
Save tdammers/e3fc0d2f92c10b8f4d20 to your computer and use it in GitHub Desktop.
def thwarting laziness?
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
user=> (defn foo [& fns] (fn [] (->> fns (map #(%)) (filter (comp not nil?)) (first)))) | |
#'user/foo | |
user=> ((foo (fn [] nil) (fn [] "OK") (fn [] (do (print "NONONO") "NO")))) | |
"OK" | |
user=> (def blah (foo (fn [] nil) (fn [] "OK") (fn [] (do (print "NONONO") "NO")))) | |
#'user/blah | |
user=> (blah) | |
NONONO"OK" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment