removed dependency on ring which was only used for the web example
[propagator.git] / src / heron.clj
blobdffe5ae936d858cdb7b683b081ead96c7b486978
2 (in-ns 'propagator)
3 (cell guess 1)
4 (cell x 9)
5 (cell done false)
6 (cell margin 0.1)
8 (propagator enough [x guess] [done]
9   (Thread/sleep 1000)
10   (if (< (abs (- (* guess guess) x)) @margin) true false))
12 (propagator heron [x done guess] [guess]
13   (Thread/sleep 1000)
14   (if done
15     guess
16     (/ (+ guess (/ x guess)) 2.0)))