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
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
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
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
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,
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
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)