Fork me on GitHub
#clojure
<
2015-12-22
>
kvlt02:12:58

Has anyone worked with modifying the content of word documents?

Tim02:12:33

I didn’t realize clojure had classes?

lambeta10:12:03

Could anyone recommend a good test library in Clojure? expectations-mode seems not suitable for emacs.

wotbrew10:12:55

@lambeta: I like the combination of clojure.test for examples and test.check for generative testing. Both should work with ciders test runner for clojure.test.

spacepluk10:12:47

any good resource on how to expose a clojure library to java while providing an idiomatic interface?

magomimmo13:12:48

@danstone: I agree with @lambeta moreover if you need to cross the border between CLJ and CLJS, cljs.test is very good as well and you can share the same tests between the server and client sides as well

stuartsierra13:12:04

@spacepluk: If you want idiomatic Java, including types and JavaDoc, the best way is to write interfaces or stub classes in Java and implement them in Clojure.

spacepluk13:12:50

@stuartsierra thanks, I'll do that

jjconti13:12:25

Hi, in a project I have cljs-time 0.3.14 as dependency

jjconti13:12:50

but I have a problem (http://stackoverflow.com/questions/34401358/error-formating-date-in-clojurescript) that points that my project is using 0.3.0

jjconti13:12:02

in ~/.m2/repository/com/andrewmcveigh/cljs-time I have 2 folders, 0.3.0 and 0.3.14 if I delete 0.3.0 and try to run the project again i get: Retrieving com/andrewmcveigh/cljs-time/0.3.0/cljs-time-0.3.0.pom from clojars

jjconti13:12:10

why can this be happening?

roberto13:12:13

try deleting both folders

roberto13:12:22

and do a lein clean

jjconti14:12:19

thanks roberto , seems to be working now

jjconti14:12:37

lein clean had no output

roberto14:12:40

yeah, lein clean normally has no output

spacepluk14:12:49

there's no automatic way of removing the unused namespaces from an uberjar, right?

eyelidlessness15:12:08

is there a way to compile clojure files with arbitrary filename extensions?

eyelidlessness15:12:28

(motivation is to have a different extension for files that are compiling to css using garden)

oskarth15:12:04

,(def m {:a 😛 :a :c})

oskarth15:12:27

(def m {:a :foobar :a :c}) - does anyone know why this returns "Unmatched delimiter: )" rather than something like "duplicate key"? It's obviously wrong, but curious what happens here behind the scenes.

jjconti16:12:03

i get duplicate key error first oskarth

jjconti16:12:05

user=> (def m {:a :foobar :a :c}) IllegalArgumentException Duplicate key: :a clojure.lang.PersistentArrayMap.createWithCheck (PersistentArrayMap.java:70) RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221)

bronsa16:12:19

it returns both

bronsa16:12:30

it reads the map, fails at read-time verification and the reader throws

bronsa16:12:41

then it starts reading again, but it encounters ) and throws a second time

bronsa16:12:21

when the reader fails mid-expression, it doesn't try reading until the end of the expression (there might be no end!)

spacepluk16:12:19

hmm, I'm trying to call java functions from clojure in a mixed project and I'm getting CompilerException java.lang.RuntimeException: Unable to find static field the classes are there though, and I even get autocompletion in the repl, any idea?

oskarth16:12:54

interesting, I only see the RuntimeException using CIDER @jjconti

oskarth16:12:05

oh nevermind, I was looking in the wrong windopw

oskarth16:12:25

cider-error doesn't show it, but it's in the repl

jjconti16:12:20

what's cider oskarth?

oskarth16:12:22

I wonder why it doesn't show up in error

oskarth16:12:33

emacs repl

oskarth16:12:00

@bronsa: yeah that makes sense

solicode16:12:06

@spacepluk: Are you trying to refer to a Java function as if it were a Clojure function? For example, you would get that error if you did this: (map Integer/parseInt ["1" "2" "3"]) But this will work: (map #(Integer/parseInt %) ["1" "2" "3"])

spacepluk16:12:05

@solicode: I'm just trying to call a static function without parameters (after importing) something like (Test/test)

solicode16:12:55

Hmm, in that case, as long as you have the parentheses, it should work.

bronsa16:12:59

@spacepluk: that usually means you got the arity wrong

bronsa16:12:13

i.e it takes 1 arg and you're passing it 0

bronsa16:12:31

or you're trying to invoke an instance method as a static method

spacepluk16:12:34

thank you that was it

snowell19:12:47

Hey all…I’m getting a strange error any time I include the “cheshire” library (either explicitly or through an indirect inclusion). Anybody seen this / know what to do? https://www.refheap.com/3c9dec3860f34758c0b945934

snowell19:12:21

For the lazy: java.lang.IllegalAccessError: tag does not exist, compiling:(cheshire/generate_seq.clj:1:1)

stuartsierra19:12:35

Looks like a version conflict in some library that Cheshire depends on.

stuartsierra19:12:14

Or maybe somehow you have 2 different versions of Cheshire on the classpath.

snowell19:12:58

According to lein deps :tree I only have 1 Cheshire and one of each of its dependencies

stuartsierra19:12:28

Also check for stale AOT-compiled files.

snowell19:12:57

Well, I was able to just exclude cheshire, which is really cheating

snowell19:12:29

Though I do always ask for help before trying lein clean

roberto19:12:46

When in doubt, lein clean

snowell19:12:25

Too bad I never remember. Surprisingly, that didn’t actually help. But I’ll exclude it for now and go on merrily pretending that there’s no problem!

roberto19:12:03

excluding is prefectly fine.

roberto19:12:07

I always do that

freyert20:12:07

Is there an article about why people love Clojure? I'm still trying to make Clojure "click" in my mind. I like it, but I don't have a reason to love it yet.

freyert20:12:20

Since, I'm a beginner

timgilbert21:12:41

@freyert: When I talk to people about this, Rich Hickey's "Simple Made Easy" talk seems to come up a lot: http://www.infoq.com/presentations/Simple-Made-Easy

timgilbert21:12:11

...but I'm sure there are more concise articles/blog posts out there

freyert21:12:39

I hear a lot about Rich Hickey, so I might as well get it into it 😄

lvh21:12:35

is there a fancy way of expressing (fn [x] (if (x? x) (f x) x))

lvh21:12:42

basically “apply f, but only if pred)

stuartsierra22:12:15

@lvh (cond-> x (pred? x) f) but that's not much clearer in my opinion

lvh22:12:30

yeah I guess

lvh22:12:40

thanks, stuartsierra simple_smile

cfleming22:12:30

@alexmiller: Any idea when the state of Clojure results are coming out?

cfleming22:12:44

(I should make sure I get your username right)

alexmiller22:12:30

@cfleming people are working on it but not sure due to holidays

cfleming22:12:47

@alexmiller: Ok, no problem, just curious.

currentoor23:12:05

I'm using Stuart Sierra's reloaded workflow and it's working well except when I introduce a test file in the spec directory. I get an error like Could not locate spec__init.class.

currentoor23:12:39

Is there a way to make clojure.tools.namespace.repl/refresh ignore my spec directory?

lvh23:12:14

is there a way to get clojure.walk/prewalk to not descend into maps? I’m trying to do something to all of the vecs in a tree structure, but it’s iterating over map pairs apparently 😕

tolitius23:12:22

@currentoor: you can disable certain namespaces from reloading by (disable-reload!): https://github.com/clojure/tools.namespace#disabling-refresh-in-a-namespace , or you can specify directories where tools.namespace will look with (set-refresh-dirs): https://github.com/clojure/tools.namespace/blob/be75a292c7df3bdb0e0fcdf010dd3ed42537c6c6/src/main/clojure/clojure/tools/namespace/repl.clj#L164 I don't think there is anything like (refresh-everything-but-these-dirs), but @stuartsierra will know for sure

currentoor23:12:18

@tolitius: I'll look into that, thanks!

currentoor23:12:42

By the way setting my src and dev directories with set-refresh-dirs worked. Thanks again!

bronsa23:12:40

wow, no wonder tools.analyzer breaks when :reload-all

bronsa23:12:58

re-evaluating a defmulti completely destroys any metadata on that multimethod