Fork me on GitHub
#chlorine-clover
<
2022-11-14
>
mauricio.szabo13:11:05

Both do - it detects, from current file and position, which namespace it is, and then sends a (in-ns 'namespace.name) before the eval

mauricio.szabo13:11:51

The detection is basically: search for top-forms that happen before the current file's position to find a ns form. If it doesn't find anything, search for something below it. This second check is basically to solve a weird edge-cases that happens when you try to eval ns forms with metadata on it (for example, because of clj-kondo config)

borkdude13:11:19

I think CIDER does something similar

Mattias13:11:02

Aha. Interesting! I have wondered, idly, how the running process matches the text file when sending specific forms… (and I have a larger question looming about why you have to keep the actual “content” of the process in your head, but that’s a different thing).