Search code examples
modulenamespacesjuliaread-eval-print-loop

Change REPL module/namespace in Julia


I'm looking for a way to "enter" a module in the REPL, so that I can access all symbols without qualification (not just the exported ones), and any function (re)defined at the REPL gets in the specified module. (Basically this is the functionality of Common Lisp's in-package macro.)

This would be useful in a REPL-oriented workflow, as I would be able to write the same code in the REPL as in the module I am developing.

The manual recommends a workflow where I qualify everything, but that seems annoying.


Solution

  • I started a package called REPLMods.jl for this a while back. It should probably be polished up, but I haven't had the time.

    I spoke to core Julia members and there was interest in getting it merged into base once things were clean, but again, no time!