Traffic junctions as a metaphor for understanding the STM?

2010-10-16 Thread Sam Aaron
This might be slightly off the wall, but I recently watched a tiny documentary about an experimental congestion control strategy in the UK where at a busy junction they disabled the traffic lights. Interestingly it reminded me of Clojure's STM (except on car crashes a big robot arm would scoop

Re: Best practices for protocols

2010-10-16 Thread Christian Vest Hansen
My understanding of protocols is this: they are an abstraction representation of data. They allow you to write functions, building upon the protocol, such that they work for all concrete implementations of that protocol. So the protocol is a view on data. And the many ways of modifying the data is

Re: Idiomatic Way to Keep a Variable Private to a Namespace

2010-10-16 Thread Steven E. Harris
ataggart alex.tagg...@gmail.com writes: It's fairly common to let over a function, e.g.: So common, in fact, that Doug Hoyte wrote a book about it: Let Over Lambda http://www.letoverlambda.com/ -- Steven E. Harris -- You received this message because you are subscribed to the Google

Re: Idiomatic Way to Keep a Variable Private to a Namespace

2010-10-16 Thread ka
I've been wondering about having let over defn, I have the following concerns - 1. Not recommended in the docs http://clojure.org/special_forms#Special%20Forms--%28def%20symbol%20init?%29 says - Using def to modify the root value of a var at other than the top level is usually an indication that

sql and cursors

2010-10-16 Thread Kyle R. Burton
As far as I can tell, contrib.sql's functions do not use database cursors (at least for PostgreSQL, again as far as I can tell). For result sets that are larger than you'd like to load into the running process, but rather step through the results and have them fetched on demand from the server,

Re: precise numbers

2010-10-16 Thread Steven E. Harris
cej38 junkerme...@gmail.com writes: (defn float= ([x y] (float= x y 0.1)) ([x y epsilon] (let [scale (if (or (zero? x) (zero? y)) 1 (Math/abs x))] (= (Math/abs (- x y)) (* scale epsilon ) You're scaling epsilon incorrectly here. Epsilon defines the smallest value

Re: precise numbers

2010-10-16 Thread David Sletten
Steven, Thanks for your comments. You bring up some interesting points, however, you also raise some more questions. First, you criticize my use of the variable name 'epsilon'. Of course, this usage is entirely consistent with its ubiquitous use in mathematics. I am designating a(n)