clojure-uk

A place for people in the UK, near the UK, visiting the UK, planning to visit the UK or just vaguely interested to randomly chat about things (often vi and emacs, occasionally clojure). More general the #ldnclj
jiriknesl 2021-01-21T05:15:11.000300Z

Morning 🙂

1
djm 2021-01-21T06:27:21.000600Z

👋

dharrigan 2021-01-21T07:05:48.000800Z

Good Morning!

dharrigan 2021-01-21T07:06:02.001200Z

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

dharrigan 2021-01-21T07:07:17.002100Z

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

😂 2
mccraigmccraig 2021-01-21T08:11:21.002400Z

mawnmån

mccraigmccraig 2021-01-21T08:16:13.002700Z

was your dreamcoding productive though @dharrigan?

thomas 2021-01-21T08:18:06.002900Z

morning

alexlynham 2021-01-21T08:32:50.003100Z

morning

jasonbell 2021-01-21T09:04:51.003300Z

Morning

dharrigan 2021-01-21T09:07:08.003400Z

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

dharrigan 2021-01-21T09:07:18.003600Z

Unfortunately, I forgot it all when I woke up.

dharrigan 2021-01-21T09:23:31.004100Z

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

2021-01-21T09:23:44.004400Z

Morn'

dharrigan 2021-01-21T10:55:10.005100Z

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

😆 1
🚰 1
2021-01-21T10:58:44.005900Z

Morning

2021-01-21T11:24:20.007600Z

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?

dharrigan 2021-01-21T11:28:33.007900Z

yes

dharrigan 2021-01-21T11:28:49.008200Z

I use it quite a lot as the ultimate debugger

2021-01-21T11:30:40.008500Z

Will have to give that a watch next then 😃

dharrigan 2021-01-21T11:32:49.008900Z

From around the 37m mark onwards

1
alexlynham 2021-01-21T11:45:46.009Z

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

alexlynham 2021-01-21T11:45:50.009100Z

s'a cider feature

2021-01-21T12:00:58.010200Z

I personally much prefer scope capture to using tap>

dharrigan 2021-01-21T13:59:18.010500Z

what's scope capture?

dharrigan 2021-01-21T15:09:39.010700Z

Why no work?

dharrigan 2021-01-21T15:10:28.011500Z

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

2021-01-21T15:17:44.011900Z

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

2021-01-21T15:18:27.012800Z

or can it take a set too?

mccraigmccraig 2021-01-21T15:18:29.013Z

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

mccraigmccraig 2021-01-21T15:19:05.013700Z

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

👍 1
dharrigan 2021-01-21T15:19:10.014Z

ahahaha!

2021-01-21T15:19:11.014100Z

ahh of course

dharrigan 2021-01-21T15:19:23.014600Z

however, the nil? works

dharrigan 2021-01-21T15:19:32.014900Z

that'll do for me

mccraigmccraig 2021-01-21T15:24:31.015Z

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

2021-01-21T15:46:40.015500Z

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

dharrigan 2021-01-21T15:47:00.015900Z

thank you! will review.

2021-01-21T15:47:10.016100Z

though you can use it for much more than debugging

benedek 2021-01-21T22:02:11.018400Z

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

benedek 2021-01-21T22:04:27.019700Z

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

2021-01-22T09:20:54.021Z

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

benedek 2021-01-22T11:19:55.021600Z

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

benedek 2021-01-22T11:21:09.021800Z

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