Change REPL module / namespace in Julia

I'm looking for a way to “enter” a module in REPL, so that I can access all characters without qualifications (and not just exported ones), and any function (re) defined in REPL gets into the specified module. (This is mainly the functionality of a common Lisp macro in-package.)

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

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

+4
source share
2 answers

I launched a package called REPLMods.jl . It probably should have been polished, but I didn't have the time.

I spoke with the main members of Julia, and there was an interest in merging with the base when everything was clean, but again, there is no time!

+6
source

I know that this is not quite what you are asking for, but just in case, the “obvious” did not happen to you (or future visitors to the question), assuming that you downloaded the module with an annoyingly cumbersome name, for example

import LaTeXStrings

and you don’t want to introduce LaTeXStrings all the time just to learn about its accessibles, i.e.

LaTeXStrings.[TAB]

you can simply assign the imported module as a whole to another variable, i.e.

const l = LaTeXStrings

, , , l.[TAB] LaTeXStrings.[TAB] :)

( , julia, , import LaTeXStrings as l...)

+1

Source: https://habr.com/ru/post/1650092/


All Articles