Fork me on GitHub
#chlorine-clover
<
2020-03-25
>
mauricio.szabo01:03:56

@jlmr after some debugging, I found out that datahike.db.DB re-writes seq so it returns something that's not the "key-value" as UNREPL expects. I'm seeing if there's any way to fix this for now 🙂

jlmr06:03:52

@mauricio.szabo awesome. Does it rewrite “a seq” or the entire seq protocol?

mauricio.szabo12:03:30

I'm really thinking of a workaround: even thinking that this could change in future implementations on datahike side, I can't have an "unparseable EDN" breaking the entire plug-in....

jlmr12:03:03

Agreed, even a message saying something like “Couldn’t parse edn” but just continuing to function would be nice.

jamieorc17:03:27

In Chlorine, advantages/disadvantages of “Should we refresh namespaces when we save a file?”

mauricio.szabo17:03:08

The advantage is that you can be sure that when you save a file, Chlorine will try to refresh that namespace using (require '[<namespace> :reload :all]) or clojure.tools.namespace

mauricio.szabo17:03:40

The disadvantage is that it's kinda fragile: you have to be sure that when you save a file, you don't break anything. Otherwise, not even autocomplete will work 😞

mauricio.szabo17:03:41

When I started to work with Clojure I always left it on. Nowadays, I left it off all the time, because when you make a mistake its really hard to fix when you leave it on...

mauricio.szabo17:03:08

BTW, autocomplete will not work if you're using the "clojure.tools.namespace" approach, because it destroys namespaces and re-loads then 🙂

jamieorc17:03:40

Yeah, using simple. Been playing with turning off the refresh

seancorfield18:03:25

I am fairly vocal against all of these auto-refresh/reloaded approaches. It can sometimes make things seem "magically" easy but when it goes wrong it can really confuse people -- and it is certainly not simple (in the Clojure sense).

seancorfield19:03:39

Stu Halloway kind of speaks against these approaches too in his REPL talks, and Eric Normand isn't in favor of them either (re: his REPL course online).

seancorfield19:03:33

ProtoREPL also had similar options that Jason Gilman's "opinionated" guide said should be "on" but which caused users all sorts of weird problems (and, again, I advised ProtoREPL users to turn them "off"!).

mauricio.szabo19:03:30

Yes, even while working on ClojureScript, sometimes if there's an error on the code, it'll not reload in the browser / node.js environments. This means that ClojureScript REPL will not work (and sometimes, autocomplete/etc will also fail).

jamieorc17:03:05

One thing I’m wrangling with is tabs/spacing. I use parinfer with experimental on (nice!) and paredit so I can slurp, barf, etc (also nice!) but I often see weird tabbing and indenting. Often it will indent 1 space, even though set up for two. Tabbing usually goes 2 spaces, but sometimes goes 0 spaces (!) then jumps four. Sometimes one. I have no idea what is going on. I expect this isn’t Chlorine, but asking here. Just redirect me to another forum if needed

mauricio.szabo17:03:52

It isn't Chlorine, but no worries. Clojure indentation sometimes use only one space, other two. It depends: there's some configuration on lisp-paredit where you can change which forms will indent 2 spaces

mauricio.szabo17:03:16

Also, Atom sometimes does strange things too, unfortunately 😞

seancorfield19:03:16

Also, I think Parinfer and Paredit can compete/conflict sometimes, which doesn't help. Parinfer's "smart" mode isn't always very smart. I often find myself selecting a block of code and using smart reindent explicitly to fix this -- and I've had Parinfer break code by adjusting parens to match the (incorrect) indentation. It can be quite frustrating. But, overall, its benefits outweigh its downsides so I still keep using it... 😐

mauricio.szabo19:03:15

Yes, for example, I'm used to use CTRL+ALT+9 to change parinfer mode from "smart" to "paren" before pasting any code. This wil not change the structure of pasted code, so I can indent manually after and then change back to "smart"

seancorfield20:03:05

I forget to do that a lot of the time. I probably ought to set up a command that pastes code with Parinfer mode set to paren (and then changes it back) -- and get used to whatever hot key I bind to that.

mauricio.szabo21:03:45

I was thinking about a plug-in for Atom that would evaluate multiple commands, one after another, exactly because of that 😄. But in the end, for the cases that I had to use it, I ended up using a custom command on init.coffee