Hello all, anyone tried to use Chlorine with remote REPL?
@fabrao Yup. I use Chlorine all the time with remote Socket REPLs. What's the question?
How do you evaluate functions from source code?
Evaluate top-level form. Which is ctrl-; B
in my keymap.
Same as working with a local REPL.
I tried to load the source code from other path, but it seems that has some difference
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.
So if your source code isn't on the remote system or isn't in the exact same location, load file cannot possibly work.
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.
(unless of course you can mount your Windows filesystem as a networked system on the container/server 🙂 )
So, the remote source code must be in the same path as the editor?
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.
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.
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.
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 ...)
@fabrao Does that answer your question and provide a workaround?
@seancorfield Yes, I understand now