lfe / xrepl

An experimental, general purpose LFE REPL
Apache License 2.0
7 stars 1 forks source link

Explore possible designs for (optional) tight integration with LFE modules #12

Open oubiwann opened 6 months ago

oubiwann commented 6 months ago

Use-case illuminating comments from John Goff on the LFE Discord:

Yeah, to be honest it feels limiting to be able to define functions in the repl but not overwrite functions defined in a file. The syntax of Elixir's defmodule makes this comparatively easy, since there's no "switching namespaces", you just type in a block and when that block's end is reached, we're back in the shell. But since LFE follows Erlang in that you're limited to one module per file, the syntax in LFE wasn't really made with this in mind.

The idea that I had was if this is possible, then you can connect your editor to your running system, and you can just send the entire buffer to the repl when you've made changes in the buffer that you want to appear in the live system.

I definitely think that LFE should provide some way of reloading a module via the repl, whether that's a part of xrepl or lfe itself I'm not sure.