Fork me on GitHub
#clojure-uk
<
2018-04-25
>
jasonbell06:04:15

morning friends

alexlynham08:04:17

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

dominicm09:04:46

Morning again 🙂

😂 4
yogidevbear11:04:45

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

user=> (- 0.121 0.2)
-0.07900000000000001

guy11:04:25

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

guy11:04:32

if that makes sense

yogidevbear11:04:48

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

yogidevbear11:04:25

Like so @dominicm?

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

dominicm11:04:32

@yogidevbear there's a shorthand too ^^

Rachel Westmacott11:04:13

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

maleghast11:04:19

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

yogidevbear11:04:59

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

danm13:04:02

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

yogidevbear15:04:01

Has anyone purchased/read Alex et. al.'s Programming Clojure 3rd ed. book? https://www.amazon.co.uk/gp/product/1680502468/

practicalli-john08:04:44

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

yogidevbear09:04:18

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?

yogidevbear15:04:14

@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

danm15:04:54

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”

alexlynham15:04:50

so data science notebooks are just emacs org mode?

otfrom15:04:35

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

mccraigmccraig15:04:56

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?

mccraigmccraig16:04:43

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

mccraigmccraig16:04:23

other tests are for re-frame things which are written in .cljc and run under .clj with https://github.com/Day8/re-frame-test

Rachel Westmacott11:04:49

Do you trust CLJS tests to be run as CLJ?

mccraigmccraig11:04:15

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…

mccraigmccraig12:04:32

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

dominicm15:04:12

9 is now retired & deprecated right?

otfrom15:04:35

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