Fork me on GitHub
#clojure-europe
<
2021-04-12
>
slipset05:04:31

Good morning?

otfrom06:04:15

We had some snow at the weekend but it didn't rest this near the sea

djm06:04:20

👋

djm06:04:47

We had light snow on and off yesterday, for most of the day

simongray06:04:37

good morning

dharrigan06:04:28

Good Morning!

pez06:04:59

Morning!

thomas07:04:51

Morning, we had some snow this morning again. very weird indeed.

javahippie08:04:18

No snow, here, was only sleeting. The look my dog gave me when we went for a run was not a friendly one

😂 8
thomas08:04:20

You must have a very clever dog!

genRaiy12:04:03

also a flurry of hail and snow here for 20 mins in the late morning

ordnungswidrig12:04:46

We had the fluffiest of snow flakes this morning.

dharrigan12:04:31

It was fluffying it down this morning down in Surrey, UK.

dharrigan12:04:37

but now, it's fine weather

ordnungswidrig12:04:23

We have “unevenly bright cloud shine” now.

dharrigan13:04:38

I have reservations about my 4 year old son, he's becoming too english. He was commenting this morning on how fine the weather was and he hopes it will improve later....

⛅ 6
djm13:04:47

"I have reservations about" - sounds like a very English things to say

dharrigan13:04:26

I've been here far too long 🙂

otfrom14:04:50

2 small rubbish libraries to help me with charting and data science https://github.com/MastodonC/kixi.plot & https://github.com/MastodonC/kixi.large

slipset14:04:05

docs sure are rubbish 🙂

otfrom15:04:53

omg, the docs are terrible

otfrom15:04:07

not really fit for public consumption

otfrom15:04:23

atm it is really just solving some things that have been annoying me about the libraries that I've been using

otfrom15:04:26

if you aren't embarrassed by your first release then you waited too long to ship? 😄

😂 6
pez15:04:52

TIL:

(def ^:dynamic *foo* :FOO)
(defn foo [x] [*foo* x])

(binding [*foo* :BAR]
  (map foo [1 2 3]))
=> ([:FOO 1] [:FOO 2] [:FOO 3])
https://clojuredocs.org/clojure.core/binding#example-60746e7de4b0b1e3652d74c4

djblue15:04:32

I literally just experienced this same issue this weekend!

😂 3
dominicm18:04:04

bound-fn :

user=> (def ^:dynamic *foo* :FOO)
#'user/*foo*
user=> (defn foo [x] [*foo* x])
#'user/foo
user=> (binding [*foo* :BAR]
  (map (bound-fn [x] (foo x)) [1 2 3]))
([:BAR 1] [:BAR 2] [:BAR 3])
user=> 

dominicm18:04:16

Even better, bound-fn*:

user=> (binding [*foo* :BAR]
  (map (bound-fn* foo) [1 2 3]))
([:BAR 1] [:BAR 2] [:BAR 3])

djblue18:04:53

Okay, now those are some pretty dope functions! aw_yeah

djblue18:04:08

Thanks for sharing!

djblue18:04:17

Is there a cljs equivalent?

pez19:04:18

Will you update the ClojureDocs example, or should I, @U09LZR36F?

pez07:04:12

babashka does not support bound-fn , nor bound-fn*, I just learnt. 😃 Maybe it can’t?

dominicm19:04:04

@U1G869VNV I think it's not needed in cljs, as there's no threads, but I'm not certain tbh


dominicm19:04:28

@U0ETXRFEW I don't think I've ever made a ClojureDocs update, all yours :)

pez20:04:26

It’s my first as well. 😃

dominicm20:04:24

https://gist.github.com/micha/c9d8175d80e8a7d378adb6047e850c50 hoplon got your back @U1G869VNV (I've apparently googled this before)

😂 2
thanks3 2
borkdude15:04:28

this is laziness biting you

borkdude15:04:09

it's a common source of confusion. I spent an entire day figuring out why my datomic query didn't execute against a certain "as of" date because of this and then rewrote an entire app to take the db as an argument instead.

💯 6
😅 3
mccraigmccraig15:04:51

friends don't let friends use dynvars 😬

🙂 6
pez15:04:53

Yeah, lazyness is what I blamed in the ClojureDocs example. I might rewrite my (babashka) script to thread the value through as an argument instead. (Or I might stop at just using doall, which works for my use case.)

genRaiy18:04:20

dynamic vars in tests are nice - in reality, not so much

✅ 3