chlorine-clover

About Chlorine for Atom and Clover for VS Code: https://atom.io/packages/chlorine and https://marketplace.visualstudio.com/items?itemName=mauricioszabo.clover
seancorfield 2019-05-30T00:24:01.045400Z

That's actually not too bad... I might try just installing 0.1.7 and then putting my inspect selection command in that way, as an experiment. I'd certainly rather run with the "stock" Chlorine so it's easier for me to customize on both machines without having to run from source.

seancorfield 2019-05-30T00:30:58.046Z

@mauricio.szabo You showed JS above for your "init script" -- is that something different to init.coffee?

seancorfield 2019-05-30T01:39:34.046200Z

Figured it out...

seancorfield 2019-05-30T01:40:25.046300Z

Inspect Selection in REBL!

seancorfield 2019-05-30T01:54:56.046900Z

https://github.com/seancorfield/atom-chlorine-setup

seancorfield 2019-05-30T03:41:38.001Z

I cannot get go to var definition to work in 0.1.7...

seancorfield 2019-05-30T05:03:10.002200Z

Show source doesn't seem to work either.

seancorfield 2019-05-30T05:07:20.004Z

On a brighter note, I've sort of got the bug for defining new commands in my init file now 🙂 Inspect current namespace. Inspect var at cursor. Define var/expr (so you can turn parts of a let into top-level defs to make it easier to debug and eval sub-expressions. I ❤️ REBL.

mloughlin 2019-05-30T10:16:45.004400Z

how do I stop my defonce definitions from being overwritten when I reload a file? 😕

mauricio.szabo 2019-05-30T14:47:22.006300Z

I'll look at these two bugs right now. There shouldn't be any breakages, but we never know... after all, the current new code is registering commands in a different manner

mauricio.szabo 2019-05-30T14:52:23.007700Z

@michael.e.loughlin, what command are you using? If it's the full refresh, I use clojure.tools.namespace to do the refreshing part, and the approach they use is to drop the full namespace and then reload everything

mloughlin 2019-05-30T14:55:39.008300Z

yeah, full refresh. would you recommend simple? I don't remember why I chose full, so it can't have been an important decision

mauricio.szabo 2019-05-30T15:00:40.010700Z

You chose full because it is the default 😄. But I'll change these defaults on the next version too. Try to change it to "simple" and see if it works - probably will. It's not really that easy to configure a project to use a kind of refresh that clojure.tools.namespace expects...

mloughlin 2019-05-30T15:01:54.011Z

I'll give it a go when I'm at my workstation, thanks!

mauricio.szabo 2019-05-30T16:33:02.012300Z

When you try "goto definition", are you getting an Atom error?

mloughlin 2019-05-30T16:45:50.012400Z

yep that fixed it

mloughlin 2019-05-30T16:50:58.013900Z

I can avoid using integrant for a little bit longer now my top-level defonces are back 😄

mauricio.szabo 2019-05-30T16:51:38.014500Z

Just found the problem: on newer versions of ClojureScript, clojure.core/let resolves to cljs.core/let instead of keeping the original namespace. I was using it as a "poor man's template engine", seems like it's time to rethink it 🙂

mauricio.szabo 2019-05-30T16:51:47.014800Z

(and cover these parts with tests too :D)

seancorfield 2019-05-30T17:04:30.014900Z

FWIW, I never use any automated refresh process in all project.

seancorfield 2019-05-30T17:05:30.015100Z

Eric Normand's REPL-Driven Development course (which is excellent, BTW, and well worth the money!) also advises against the auto-refresh stuff, and instead advocates a better REPL workflow where you develop practices that let you avoid that stuff.

seancorfield 2019-05-30T17:07:05.016300Z

Interesting. I've been using my own "inspect var" instead since that lets me see the source code in REBL which is mostly what I use go to var definition for.

souenzzo 2019-05-30T17:11:27.016900Z

~ cljs
ClojureScript 1.10.520
cljs.user=> `let
cljs.core/let
cljs.user=> `clojure.core/let
cljs.core/let ;;; <==
I think that this behavior is a bug

lilactown 2019-05-30T17:12:26.017400Z

i believe that's intended? because clojure.core doesn't actually exist in CLJS

lilactown 2019-05-30T17:12:33.017600Z

everything is implemented in cljs.core

lilactown 2019-05-30T17:13:14.018300Z

however, to help with cross-platform macros etc. the CLJS compiler will rewrite references to clojure.core as cljs.core

lilactown 2019-05-30T17:15:32.020700Z

this way you can write macros like this:

(defmacro foo []
  `(let [a# 1 b# 2]
    (+ a# b#))
and it will work in Clojure or ClojureScript. instead of having to somehow detect in the macro if you're being run as part of the CLJS compiler and fully-quality all the core functions/macros like:
(cljs.core/let [a# 1 b#]
  (cljs.core/+ a# b#)

mloughlin 2019-05-30T17:28:24.021Z

thanks for the recommendation Sean. How do you go about updating your REPL with the most up-to-date defn and such?

mloughlin 2019-05-30T17:30:48.021200Z

you don't have to answer if it gives too much of Eric's course away 😂

seancorfield 2019-05-30T17:30:51.021400Z

I hit ctl-, b or ctl-, B depending on whether I want to eval the current form or the top-level form. ctl-, f if I want to (re-)load the whole file. Those are the three "eval" steps that Eric talks about in the course. The "practice" is to develop the habit of always taking small steps: edit a form, eval it, edit a form, eval it, etc.

mloughlin 2019-05-30T17:31:39.021600Z

that makes a lot of sense

seancorfield 2019-05-30T17:32:22.021800Z

I often work across multiple files without even needing to save them. Edit a function, ctl-, B, write a test expression, ctl-, b, rinse, repeat. Occasionally I save and then ctl-, f to reload a file (which doesn't overwrite defonce BTW).

mloughlin 2019-05-30T17:33:16.022Z

I will try out disabling the namespace reload stuff 🙂

mloughlin 2019-05-30T17:37:22.022200Z

it seems like a small jump from how Chlorine encourages users to (comment (...)) eval forms

souenzzo 2019-05-30T17:39:34.022400Z

https://twitter.com/mfikes/status/1053769348966506496

seancorfield 2019-05-30T17:46:24.022700Z

Rich Comment Forms 🙂

seancorfield 2019-05-30T17:47:36.022900Z

Yeah, I've been using those for ages at work, as does my teammate. It was funny to watch Stu's talk about RDD and hear him recommend the same thing -- and call them Rich Comment Forms (because Rich does that too).

souenzzo 2019-05-30T17:54:22.023100Z

mloughlin 2019-05-30T18:00:49.023200Z

I write C# for my day job, and I find comment takes over the documentation role of unit tests, and you can put them in the same file as your business logic - like Rust tests. I really like it. Only Lisp! 🙂