Fork me on GitHub
#chlorine-clover
<
2020-07-06
>
fabrao19:07:34

Hello all, anyone tried to use Chlorine with remote REPL?

seancorfield20:07:38

@fabrao Yup. I use Chlorine all the time with remote Socket REPLs. What's the question?

fabrao20:07:44

How do you evaluate functions from source code?

seancorfield20:07:36

Evaluate top-level form. Which is ctrl-; B in my keymap.

seancorfield20:07:47

Same as working with a local REPL.

fabrao20:07:21

I tried to load the source code from other path, but it seems that has some difference

seancorfield20:07:09

Yeah, because load file operates inside the REPL process and will try to load the requested path (sent from your editor) using the local-to-the-REPL file system.

seancorfield20:07:46

So if your source code isn't on the remote system or isn't in the exact same location, load file cannot possibly work.

seancorfield20:07:11

If you're working on Windows with WSL, Chlorine's load file command can detect a REPL started on Linux (as opposed to Windows) and will try to use /mnt/<drive>/path/to/the.clj instead of <drive>:\path\to\the.clj so that it works across a Windows/WSL boundary -- but that won't help if your REPL is running in a container or on another machine.

seancorfield20:07:09

(unless of course you can mount your Windows filesystem as a networked system on the container/server 🙂 )

fabrao23:07:34

So, the remote source code must be in the same path as the editor?

seancorfield23:07:36

For "Load File" yes, since that is not evaluating code from the editor to the REPL. Instead, it is telling the (remote) REPL to load a file from the filesystem.

seancorfield23:07:00

Which is why I said: > So if your source code isn't on the remote system or isn't in the exact same location, load file cannot possibly work.

seancorfield23:07:59

But you can eval block, eval top-level block. Even eval selection. So in theory you could do <select all> <evaluate selection> and it should send all of the forms in your source file over to the REPL for evaluation.

seancorfield23:07:56

Confirmed that <select all> <evaluate selection> will work with the regular Chlorine evaluate selection command -- but won't work with my extended eval-and-send-to-rebl logic because I don't wrap the selection in a (do ...)

seancorfield23:07:15