Fork me on GitHub
#clojure-uk
<
2021-01-21
>
jiriknesl05:01:11

Morning 🙂

3
dharrigan07:01:48

Good Morning!

dharrigan07:01:02

I was dreaming about Clojure and the REPL last night....

dharrigan07:01:17

Lesson being....Don't go to bed after just watching the video by @seancorfield on REPL Driven Development, kiddies!

😂 6
mccraigmccraig08:01:13

was your dreamcoding productive though @dharrigan?

dharrigan09:01:08

It was the most amazing software ever written, that made me richer than our friend Mr. Bezos.

dharrigan09:01:18

Unfortunately, I forgot it all when I woke up.

dharrigan09:01:31

I'm making a concious effort to eval inside my editor (neovim + conjure)

dharrigan10:01:10

(doto tap>) where have you been all my (short) clojure life!

🚰 3
😆 3
folcon11:01:20

Hmm, not used tap> much myself, not really figured out how to fit it into my workflow, does seancorfield's REPL driven development video showcase it?

dharrigan11:01:49

I use it quite a lot as the ultimate debugger

folcon11:01:40

Will have to give that a watch next then 😃

dharrigan11:01:49

From around the 37m mark onwards

3
alexlynham11:01:46

I use #dbg etc in emacs a lot, not sure if that's similar or not

alexlynham11:01:50

s'a cider feature

rickmoynihan12:01:58

I personally much prefer scope capture to using tap>

dharrigan13:01:18

what's scope capture?

rickmoynihan15:01:40

I should add I don’t typically use a sidecar tool like Sean; e.g. reveal, rebl, portal etc… cider has a lot of that functionality already. So if you’re using those tools you may need the tap> to render the value in them anyway. Regardless scope capture is awesome; you can essentially capture a scope and jump your repl into the scope to debug etc… So unlike tap> you capture all the values in lexical scope. It’s not like a step through debugger because you’re not jumping into the stack; everything already happened, and the stack will have unwound. But I find it works better; it’s much less mechanical and a more functional way of debugging

dharrigan15:01:00

thank you! will review.

rickmoynihan15:01:10

though you can use it for much more than debugging

dharrigan15:01:39

Why no work?

dharrigan15:01:28

(remove #{nil} [1 2 nil nil 3])
=> [1 2 nil nil 3]

Jordan Robinson15:01:44

remove takes a predicate, right? so shouldn't it be (remove nil? [1 2 nil nil 3])

Jordan Robinson15:01:27

or can it take a set too?

mccraigmccraig15:01:29

because (#{nil} nil) => nil) - it looks up the nil from the set, and you get the looked-up value back, which is nil

mccraigmccraig15:01:05

a set behaves like a fn @me1763 which checks its arg with contains?

👍 3
mccraigmccraig15:01:31

doh, that's wrong - it's like a fn which looks up its arg with get

dharrigan15:01:23

however, the nil? works

dharrigan15:01:32

that'll do for me

benedek22:01:11

fun fact: you can (filter identity [...]) instead of remove nil?

benedek22:01:27

as long as you don't have false in your vector

Ben Hammond09:01:54

what are the upsides of doing it that way? (remove nil?) is straightforward comin' atcha bit of code (filter identity) seems like it is trying to conceal its real intentions no doubt for some nefarious purpose

benedek11:01:55

maybe it is inferior but as david is exploring this space of clojure i assumed it worths checking out alternatives and how they are slightly different. as a side note identity is a fascinating fn

benedek11:01:09

all my nefarious purposes are now laid bare i think :)