Fork me on GitHub
#clojure-uk
<
2018-06-26
>
dominicm07:06:21

I slept in,

thomas07:06:54

mogge 😼

3Jane07:06:28

achievement unlocked: git bisect

3Jane07:06:16

result: code is fine, I had a broken function definition left over in a long-running repl πŸ˜•

3Jane07:06:12

need to be more strict when experimenting πŸ™‚

otfrom07:06:41

@lady3janepl I hate it when a dirty repl catches me out.

πŸ‘ 2
alexlynham08:06:00

I tend to can my repl every once in a while just so that it's getting refreshed

otfrom08:06:57

when I think I'm done hacking I tend to cider-restart just to make sure I'm not relying on something I haven't captured

mccraigmccraig08:06:32

i just do a c.t.n.r/refresh regularly - that reloads everything and cleans out namespaces without paying the clojure init tax or doing the cider connection dance

danm10:06:20

c.t.n.r?

otfrom10:06:21

@U0524B4UW does that work for multimethods and other compiled things too?

mccraigmccraig10:06:05

what dyu mean @U0525KG62 ? multimethods still have a var, so i think it works fine for them (we use multimethods quite a lot, and while i haven't explicitly tested, i think i would have noticed a refresh not working on multimethods) `? i shouldn't think it works for pure java things which don't have a var in front of them

mccraigmccraig10:06:52

i think ztellman did something for people who need java class reloading too - i've never tried it out though - https://github.com/ztellman/virgil

otfrom10:06:30

sounds like the var bit sorts it out then πŸ™‚

agile_geek12:06:42

@U6SUWNB9N clojure.tools.namespace.repl/refresh

mccraigmccraig13:06:40

i invoke c.t.n.r/refresh through my app-context manager thingy https://github.com/employeerepublic/deferst which is kinda like component but async-compatible and much less intrusive... i just call @(reload!) and it reloads everything and restarts the app-context

simonkatz21:06:47

@U0525KG62 @U0524B4UW https://github.com/clojure/tools.namespace#reloading-code-motivation explains the bit about multimethods (and other motivation for c.t.n).

πŸ‘ 2
dominicm08:06:55

cider-refresh is always available too πŸ™‚

alexlynham09:06:50

call me paranoid but I like to see the repl die and be restarted

2
alexlynham09:06:55

I don't trust computers

πŸ˜† 2
peterwestmacott09:06:26

git bisect is somehow cooler than it is useful - but just occasionally it’s the perfect tool for the job

firthh09:06:48

I get the feeling my workflow in Clojure varies quite a lot from others. I typically just use the repl for experimentation. When I’m happy I know how the pieces work I tend to rely more on tests (`lein auto test` is a godsend), or manually testing the entire application is working end-to-end

danm10:06:14

This sounds very much like my pattern too. I use the REPL to experiment and see if what I'm considering works, but the actual feedback is generally from writing a function stub, writing the tests, running boot watch test and filling in the stubs

alexlynham09:06:27

yeah I'm guessing most folk do some variant on repl-driven development and then reification into tests

alexlynham09:06:32

(but I might be wrong!)

3Jane09:06:13

I had tests, but I realised they were incomplete

3Jane09:06:32

and once I fixed the incompleteness, my current version turned out to be broken

3Jane09:06:18

(I did find where things changed in the end)

3Jane09:06:43

which is why digging backwards in history turned out to be useful πŸ™‚

dominicm09:06:22

How does git bisect work wrt to new tests?

3Jane09:06:10

I created an experimental branch, moved the test way back in history (interactive rebase) and bisected the commits in between

dominicm09:06:47

aha, novel πŸ˜„

3Jane09:06:01

it should have been there from the start, so I’m tempted to make this the new master anyway

hyankov10:06:40

Morning everyone

πŸ‘‹ 2
dominicm10:06:21

@lady3janepl force pushing master is always dangerous πŸ˜„ mercurial added some support for "recorded rewritten history" which is apparently quite nice.

3Jane10:06:32

Β―\(ツ)/Β―

3Jane10:06:45

personal experiment repo

3Jane10:06:37

I use git for code version tracking and mental notes for why I made certain changes, so I can cut up history however I want

mccraigmccraig10:06:38

clojure.tools.namespace.repl/refresh

dominicm10:06:00

https://www.mercurial-scm.org/wiki/ChangesetEvolution this is what I was thinking of apparently πŸ™‚ which is very cool. They let you perform 4 common operations on historical commits safely.

dominicm10:06:47

in earnest, some changesets are hidden apparently: https://arrenbrecht.ch/mercurial/evolution/

dominicm10:06:53

(if you can't tell, I'm secretly in love with mercurial, but everyone else picked git, so I just sit and look at how cool it is)

πŸ˜‚ 2
3Jane11:06:58

all the feels