Using local namespaces in Pluto

Very basic question: I am writing some code in Pluto and can’t work out how to properly use local modules/namespaces.

When using Jupyter notebooks, I can create local modules (either inside the notebook or in a local file) and then include them via “using .MyLocalModule”, either with using or import, pretty much just as if they were an external package.

I know that using “ingredients” I can also fairly easily include the contents of another .jl file into my pluto notebook, but it’s not clear how to implement the equivalent of using. Do I just have to write somefunction = MyModule.somefunction for everything that I exported in my module (even if there are hundreds of such functions)? Is there a better way? Or am I misusing modules here?

thanks a lot for any tips!

Have you tried this in Pluto? It should work just fine.

It is a known issue, you can try out the hacky macro solution mentioned here as workaround

1 Like