Skip to content

Instantly share code, notes, and snippets.

@Licenser
Created March 14, 2010 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Licenser/332156 to your computer and use it in GitHub Desktop.
Save Licenser/332156 to your computer and use it in GitHub Desktop.
(defn find-units
[game pred]
(let [units (vals (:units game))
_ (utils/trace "find-units on" (count units))
units (filter (fn [u]
(println "bla!!!!!!!!!!!!!!")
(utils/trace "find-units" "testing unit:" (:id @u))
(if (and utils/*trace* (pred @u))
(utils/trace "find-units" "testing unit:" (:id @u) "positive!")
(utils/trace "find-units" "testing unit:" (:id @u) "negativ!"))
(pred @u)) units)]
(println "Woggle woggel.")
units))
;=> Trace<find-units on>: 2
;=> Woggle woggel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment