Morning 🙂
👋
Good Morning!
I was dreaming about Clojure and the REPL last night....
Lesson being....Don't go to bed after just watching the video by @seancorfield on REPL Driven Development, kiddies!
mawnmån
was your dreamcoding productive though @dharrigan?
morning
morning
Morning
It was the most amazing software ever written, that made me richer than our friend Mr. Bezos.
Unfortunately, I forgot it all when I woke up.
I'm making a concious effort to eval inside my editor (neovim + conjure)
Morn'
(doto tap>)
where have you been all my (short) clojure life!
Morning
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?
yes
I use it quite a lot as the ultimate debugger
Will have to give that a watch next then 😃
From around the 37m mark onwards
I use #dbg
etc in emacs a lot, not sure if that's similar or not
s'a cider feature
I personally much prefer scope capture to using tap>
what's scope capture?
Why no work?
(remove #{nil} [1 2 nil nil 3])
=> [1 2 nil nil 3]
remove takes a predicate, right? so shouldn't it be (remove nil? [1 2 nil nil 3])
or can it take a set too?
because (#{nil} nil) => nil)
- it looks up the nil
from the set, and you get the looked-up value back, which is nil
a set behaves like a fn
@me1763 which checks its arg with contains?
ahahaha!
ahh of course
however, the nil?
works
that'll do for me
doh, that's wrong - it's like a fn
which looks up its arg with get
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
thank you! will review.
though you can use it for much more than debugging
fun fact: you can (filter identity [...])
instead of remove nil?
as long as you don't have false
in your vector
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
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
all my nefarious purposes are now laid bare i think :)