Re: Closure for object pattern? A good idea?

2016-12-10 Thread Didier
Logan's point about being able to add new functions on a stopwatch is valid. That's often the argument to why protocols are better then classic OO. Though I still feel like in some scenarios, I think this is a good pattern, and can serve us better, the stopwatch being one good example. Nothing

Re: ava.lang.SecurityException: class "org.apache.poi.POIXMLDocumentPart"'s signer information does not match signer information of other classes in the same package

2016-12-10 Thread larry google groups
Not sure how to exclude an imported Java class? lein deps :tree Possibly confusing dependencies found: [lein-checkall "0.1.1"] -> [jonase/eastwood "0.0.2"] -> [org.clojure/tools.namespace "0.1.2"] overrides [lein-checkall "0.1.1"] -> [lein-kibit "0.0.8"] -> [jonase/kibit "0.0.8"] ->

ava.lang.SecurityException: class "org.apache.poi.POIXMLDocumentPart"'s signer information does not match signer information of other classes in the same package

2016-12-10 Thread larry google groups
I've never worked much with Java, so dealing with stuff like Maven is the stuff I understand least about Clojure. I've added these 3 items to the dependencies that I list in project.clj [org.apache.poi/poi "3.9"] [org.apache.poi/poi-ooxml

Re: "lein uberjar" gives me java.lang.OutOfMemoryError:

2016-12-10 Thread larry google groups
I seem to get around this by increasing: :jvm-opts ["-Xms300m" "-Xmx300m" "-XX:-UseCompressedOops"]) Is that possible? I didn't realize that effected "lein uberjar" I thought it only effected my app when my app was running. On Saturday, December 10, 2016 at 11:37:44 PM UTC-5, larry

"lein uberjar" gives me java.lang.OutOfMemoryError:

2016-12-10 Thread larry google groups
I had a small app that was compelling, and then I added in a java class, and now when I run "lein uberjar" I get java.lang.OutOfMemoryError. I'm working on my MacBook Pro, 16 gigs of memory Dependencies were: :dependencies [ [org.clojure/clojure "1.7.0"]

Re: Closure for object pattern? A good idea?

2016-12-10 Thread James Reeves
You don't need mutability to represent a stopwatch. (defn start [stopwatch] (assoc stopwatch ::start-time (System/currentTimeMillis))) (defn elapsed-since-started [stopwatch] (- (System/currentTimeMillis) (::start-time stopwatch))) (defn stop [stopwatch] (-> stopwatch

Re: Index of an element in a vector of vectors

2016-12-10 Thread Tyler Perkins
Don't know what you mean about "swapping", but here's a solution that generalizes to a tree of any finite depth, where each node is either a leaf element or a seqable (say, a vector) of any length: (defn coord-of ([elems target] (coord-of elems target [])) ([elems target indexes]

Re: Closure for object pattern? A good idea?

2016-12-10 Thread Logan Buckley
I feel like you would be better off separating functions from the data they operate on here. In this case, you could represent the state of a stopwatch with a map containing the start time and the time elapsed, and have functions `stop`, `reset`, `start`, etc that take the stopwatch data

Re: Thoughts on clojure.spec

2016-12-10 Thread Ben Brinckerhoff
I would certainly welcome and use an `overinstrument` function if added to schpec (or another library). One reason spec is great because it provides "a la carte" validation: a can add an appropriate amount of validation to the parts of my code that would most benefit from it. In my experience

[ANN] Odin 0.2.0 - Query DSL for Clojure

2016-12-10 Thread Timothy Baldridge
I just released the first official version of Odin ( https://github.com/halgari/odin). Odin is a declarative, extensible query DSL for Clojure that leverages transducers to provide a high amount of generality while still maintaining acceptable performance. One of the biggest features of Odin is

Re: Spec of conform of spec

2016-12-10 Thread James Laver
This is exactly my use case as well. I want to provide the user a nice DSL but make it easy to automatically generate input. The idea I had was the user could write things in the DSL and for automatic generation you could just generate the conformed structure. The other thing it's made me