Revisions
-
rm-hull revised this gist
Dec 2, 2013 . 1 changed file with 7 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -15,9 +15,10 @@ (>! events (sin-vals n)) (recur (inc n)))) (go (dotimes [_ 10] ;; Draw on screen (println (map (fn [x y] {:x x :y y}) (range 3) (take 3 (<! events))))))) -
rm-hull revised this gist
Dec 2, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ (ns async-test.sinewave.core (:require [cljs.core.async :refer [<! >! chan timeout]]) (:require-macros [cljs.core.async.macros :as m :refer [go]])) @@ -20,4 +20,4 @@ (println (map (fn [x y] {:x x :y y}) (range 3) (take 3 (<! events)))))) -
rm-hull revised this gist
Dec 2, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ (ns async-test.sinewave.core (:require [cljs.core.async :refer [<! <!! >! chan timeout]]) (:require-macros [cljs.core.async.macros :as m :refer [go]])) -
rm-hull revised this gist
Dec 2, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ (ns async-test.sinewave.core (:require [cljs.core.async :refer [chan timeout]]) (:require-macros [cljs.core.async.macros :as m :refer [go]])) -
rm-hull revised this gist
Dec 2, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -10,10 +10,10 @@ (let [events (chan)] ;; produce seqs of sine values (go (loop [n 0] (<! (timeout 200)) (>! events (sin-vals n)) (recur (inc n)))) (dotimes [_ 10] ;; Draw on screen -
rm-hull revised this gist
Dec 2, 2013 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,10 @@ (ns async-test.sinewave.core (:require [cljs.core.async :refer [chan close!]]) (:require-macros [cljs.core.async.macros :as m :refer [go]])) (defn sin-vals [offset] (map #(Math/sin %) (iterate (partial + 0.1) offset))) (let [events (chan)] -
martintrojer revised this gist
Dec 2, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,6 @@ defn sin-vals [offset] (dotimes [_ 10] ;; Draw on screen (println (map (fn [x y] {:x x :y y}) (range 3) (take 3 (<!! events)))))) -
martintrojer revised this gist
Dec 2, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ defn sin-vals [offset] (map #(Math/sin %) (iterate (partial + 0.1) offset))) (let [events (chan)] -
martintrojer revised this gist
Dec 2, 2013 . 1 changed file with 7 additions and 11 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ defn sin-vals [offset] (map ƒ(Math/sin %) (iterate (partial + 0.1) offset))) (let [events (chan)] @@ -9,13 +9,9 @@ (>! events (sin-vals n)) (recur (inc n))) (dotimes [_ 10] ;; Draw on screen (println (map (λ [x y] {:x x :y y}) (range 3) (take 3 (<!! events)))))) -
martintrojer created this gist
Dec 2, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ (defn sin-vals [offset] (map ƒ(Math/sin %) (iterate (partial + 0.1) offset))) (let [events (chan)] ;; produce seqs of sine values (go-loop [n 0] (<! (timeout 200)) (>! events (sin-vals n)) (recur (inc n))) (go-loop [cnt 10] (when (pos? cnt) ;; Draw on screen (println (map (λ [x y] {:x x :y y}) (range 3) (take 3 (<! events)))) (recur (dec cnt)))))