Fork me on GitHub

morning friends


ah there was a clj meetup? If I'd known I might have stuck around after das kafka


Morning again 🙂

😂 4

Another Clojure related question. How do people best deal with numerical precision? As an example of what I mean...

user=> (- 0.121 0.2)


I guess it depends on why you want to be precise and how much


if that makes sense


I want "exactitude" 😉 Hoping to have (- 0.121 0.2) return -0.079 for example


Like so @dominicm?

user=> (- (bigdec 0.121) (bigdec 0.2))


@yogidevbear there's a shorthand too ^^

Rachel Westmacott11:04:13

you just have to watch out for division with big decimals IIRC


Morning All 🙂

Rachel Westmacott11:04:41

eg. (/ 1M 3M) => ArithmeticException Non-terminating decimal expansion; no exact representable decimal result.

Rachel Westmacott11:04:07

vs. (.divide 1M 3M MathContext/DECIMAL64) => 0.3333333333333333M


Thanks for the heads-up @peterwestmacott :+1. For my use case I'm looking purely at addition/subtraction 🙂


Oh damn, I should have gone to the clj meetup while I was here. Didn't notice in time 😕


Has anyone purchased/read Alex et. al.'s Programming Clojure 3rd ed. book?


One of the graduates at work is reading this book as one of several ways to get comfortable with Clojure. They are enjoying the book. I've done several Clojure workshops with them and we've pair programmed with them. The book gives a nice background to all this and has some useful example code


Awesome, thanks for the feedback @U05254DQM 🙂

Rachel Westmacott15:04:54

I think that one of my colleagues has.

Rachel Westmacott15:04:09

qq. what versions of Java are people on?


@peterwestmacott I updated to 9 for a while, but ran into some issues with clojure lib dependencies so reverted back to 8

Rachel Westmacott15:04:13

I was on 8, but apparently I need >=9 for the latest nashorn to run my cljs tests

Rachel Westmacott15:04:29

Oracle don’t want you to download 9, they want you to download 10


8 here. We tried 9 and had issues with boot etc. Haven't tried again since

Rachel Westmacott15:04:57

10 seems to throw ClassNotFoundException’s trying to load clojure

Rachel Westmacott15:04:50

I think maybe I’m best sticking with 8 then for now - but it means holding at reagent “0.7.0”


so data science notebooks are just emacs org mode?


obviously I think so, but then I'm a Church of Emacs zealot. 😉


lol @peterwestmacott we're still on reagent 0.6

👀 4
Rachel Westmacott15:04:24

do you mind me asking how you run your cljs unit tests?


we've got some cljs tests running with phantom and boot-cljs-test


other tests are for re-frame things which are written in .cljc and run under .clj with

Rachel Westmacott11:04:49

Do you trust CLJS tests to be run as CLJ?


the only place where we've had problems is regex - regex related tests are all in phantom+cljs

Rachel Westmacott11:04:04

I had been wondering about running my cljs unit tests in the browser (eg. a test page), as it seems most representative of how the code will actually be run (and I’m already using selenium for UI acceptance tests) - but then I have to deploy it first before I can run those, so time-to-feedback is increased…


if you are running UI tests then that might be a good idea - we skip UI tests altogether, and mostly only run event logic and subscription logic tests under clj and cljs specific tests under phantom. phantom seems quite close to our deployment platforms (which are mostly webkit based)

Rachel Westmacott15:04:43

I don’t particularly need “0.7.0” - but I try to keep my deps up to date so I don’t have panic/pain when I need to upgrade something

Rachel Westmacott15:04:59

the other option here is for me to ditch nashorn


9 is now retired & deprecated right?


obviously I think so, but then I'm a Church of Emacs zealot. 😉