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
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"]
->
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
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
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"]
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
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]
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
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
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
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
11 matches
Mail list logo