Skip to content

Instantly share code, notes, and snippets.

@skatenerd
Last active December 14, 2015 03:59
Show Gist options
  • Save skatenerd/5024832 to your computer and use it in GitHub Desktop.
Save skatenerd/5024832 to your computer and use it in GitHub Desktop.
wtf, var wtf, pmap?
(ns parallel-clojure.core-test
(:use clojure.test
parallel-clojure.core))
(def ^:dynamic set-me 1)
(deftest varset-test
(testing "value does not go into new thread"
(binding [set-me 99]
(let [thread (Thread. (fn [] (is (= set-me 1))))]
(is (= set-me 99))
(.start thread)
(.join thread))))
(testing "WTF PMAP??"
(binding [set-me 99]
(pmap (fn [_] (is (= set-me 1))) [1 2 3 4 5 6]))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment