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 2020-01-23T03:31:23.029400Z

Update to 0.4.1. Test output appears again! Thank you @mauricio.szabo!

👍 1
mauricio.szabo 2020-01-23T14:10:25.002600Z

About this issue: https://github.com/mauricioszabo/atom-chlorine/issues/139, do you think it's better to add REBL integration directly on Chlorine, or keep it as an add-on version? I'm not really sure myself (I don't use REBL that much).

sparkofreason 2020-01-23T16:51:06.003Z

If I read @seancorfield's code right, not using REBL shouldn't matter for his case. BUT, as I noted in the issue, it doesn't work for me, which is why I had switched back to the Chlorine version of Inspect Block when I stopped using REBL.

seancorfield 2020-01-23T16:55:35.004700Z

inspect-block is only for REBL. It makes no sense to use it without REBL. You should just use eval-block.

seancorfield 2020-01-23T16:56:23.005900Z

If my code doesn't work without REBL on the classpath, that's a bug I need to fix.

seancorfield 2020-01-23T16:58:46.007800Z

@mauricio.szabo unless you're going to support the full range of "inspect" functions, I see no value in Chlorine supporting REBL "partially".

sparkofreason 2020-01-23T17:07:01.007900Z

I used to have the keymap wired up to use Inspect Block regardless of whether REBL was in use, since I'm pretty sure it used to work in either case. But I recently switched jobs and rebuilt the environment from scratch (without REBL installed), and your Inspect Block wasn't working, so I switched to Chlorine's version.

seancorfield 2020-01-23T17:10:36.010400Z

Yes, it should work without REBL -- it should be identical to eval-block

➕ 1
sparkofreason 2020-01-23T17:10:45.010600Z

What's the difference between the inspect-block and evaluate-block commands in Chlorine?

seancorfield 2020-01-23T17:11:21.011500Z

But if you're not using REBL you might as well just use bare eval-block anyway

➕ 1
sparkofreason 2020-01-23T17:14:01.011700Z

Something is screwy with how the block is scoped. What's happening is that evaluate-block scopes differently based on cursor position than Chlorine's inspect-block. Take this expression: (vec (gen/sample sql-gen/stmt-text-gen 100)). If the cursor is inside the last closing paren, evaluate-block evaluates the entire expression, inspect-block evaluates the (gen-sample...) bit to the left of the cursor. Your inspect-block has the same behavior as Chlorine's evaluate-block. The behavior when the cursor is to the right of a top-level s-expression is to do nothing, which I interpreted as "not working", whereas Chlorine's inspect-block would evaluate the s-expression to the left of the cursor (prior to 0.4.0).

mauricio.szabo 2020-01-23T17:23:52.013200Z

inspect-block is using some old APIs that I was removing little by little (and on 0.4.0 I removed some, but forgot to migrate the code)

sparkofreason 2020-01-23T17:26:09.014Z

Presumably that's the source of the exception, and I should be using evaluate-block instead of inspect-block?

mauricio.szabo 2020-01-23T17:27:04.015100Z

@dave.dixon not really, I'm gonna fix the inspect-* versions for now and then we can decide on how to progress (migrate the code, remove it altogether, extend with Sean's version, etc) 🙂

mauricio.szabo 2020-01-23T17:29:47.017500Z

Also, I think that "Evaluate top block" could understand (+ (* 2 3) 4)| as "evaluate the whole expression before me" (I think it's not working like this right now)

seancorfield 2020-01-23T17:58:20.018900Z

@dave.dixon I just tried my inspect-block command on a Socket REPL connected to a remote machine that has never seen REBL and it worked just fine. Sounds like I'll need to dig into your setup a bit deeper to figure out why it isn't working for you. I'll be free in about 30 minutes for that.

sparkofreason 2020-01-23T17:59:59.019400Z

Actually, it is working. It just isn't working how I expected, see the description in the 6:10AM thread.

mauricio.szabo 2020-01-23T18:04:43.020Z

By the way, I also fixed the Chlorine version, but it'll use the new API for detection of blocks

mauricio.szabo 2020-01-23T18:05:03.020200Z

(I'm just checking other things so that I can publish a new version)

1
sparkofreason 2020-01-23T18:05:37.020400Z

Got it. At some point, inspect-block worked that way. I got used to just cmd-tabbing between the end of top-level s-expressions, and then cmd-enter to evaluate. I assume others have something similar wired up, but working with evaluate-block?

sparkofreason 2020-01-23T18:24:42.020700Z

Sounds like inspect-block is maybe intended to be more like "evaluate expression to the left of the cursor"? So using your example:

(+ (* 2 3) 4|) 
=> 4
(+ (* 2 3)| 4) 
=> 6
(+ (* 2 3|) 4) 
=> 3
(+ (* 2 3) 4)|
=> 10

seancorfield 2020-01-23T18:57:26.020900Z

Ah, inspect-block was written using the older expression-finding logic and that "broke" at some point and @mauricio.szabo fixed it for evaluate-block. My commands use the API which I think "does the right thing" now?

mauricio.szabo 2020-01-23T18:58:44.021100Z

Yes, exactly. In fact, I'm using the same API that is available for extensions to implement this version of REBL

sparkofreason 2020-01-23T18:59:26.021300Z

It does, and is consistent with evaluate-block. It's just not what I want ðŸĪŠ But I may just have to adapt my workflow.

seancorfield 2020-01-23T19:00:01.021500Z

(+ (* 2 3) 4|) ;=> 10
(+ (* 2 3)| 4) ;=> 10
(+ (* 2 3|) 4) ;=> 6
(+ (* 2 3) 4)| ;=> does not work
That last one is kind of annoying, I agree.

seancorfield 2020-01-23T19:00:17.021700Z

It used to work, but no longer does.

seancorfield 2020-01-23T19:00:44.021900Z

(that's my inspect-block BTW which I believe is consistent with the built-in evaluate-block)

mauricio.szabo 2020-01-23T19:01:10.022100Z

Yes. On evaluate-block, it'll probably not work anymore. On top-block, I'm checking if I can make it work