nbb 2022-08-11

been trying to understand namespaces and file structures for 8 years and I am still unable to create a directory structure that works

👍🏼 1

ok, figured it out eventually, reading the docs twice and starting over more than twice

seems like if I have a file in root dir and require another, that way I can resolve a different file in a different directory in root, but if I just launch nrepl and try to eval, it can't resolve it (I am assuming because it's not in the same directory)

you have to launch the nrepl within the same directory as your project

ashnur ~/r/o/t/nimble-tt ~1 -3 ?4 main ↑1,  ↓1                                                                                                                        last: 0m 2s 09:41:55
 ➜ npx nbb nrepl-server
nREPL server started on port 38007 on host 127.0.0.1 - 
Unhandled operation :ls-sessions
Unhandled operation :ls-sessions
Unhandled operation :ls-sessions

ashnur ~/r/o/t/nimble-tt ~1 -3 ?4 main ↑1,  ↓1                                                                                                                        last: 0m 0s 10:07:57
 ➜ tree -L 2 -I node_modules
.
├── package.json
├── package-lock.json
├── README
├── src
│   └── main.cljs
├── test
│   └── output.cljs
└── test.cljs

trying to evaluate something in output.cljs that refers to main.cljs

Right, you have to add src and test to nbb's classpath:

--classpath .:src:test