# \#module

**URL:** https://discourse.julialang.org/tag/module/151.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Test utilities in a Revise-friendly module](https://discourse.julialang.org/t/test-utilities-in-a-revise-friendly-module/138967)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 4\
**Last updated:** [August 21, 2026, 7:52pm UTC](https://discourse.julialang.org/t/test-utilities-in-a-revise-friendly-module/138967 "2026-08-21T19:52:37Z")

</div>

For complicated packages, I use reasonably complex test utilities, on the level of 500-1k LoC. I would like to move them into their own module that I can track with Revise.jl. Eg in runtests.jl, I want to have using My…

---

## [Update a const defined in a module](https://discourse.julialang.org/t/update-a-const-defined-in-a-module/135548)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 3\
**Last updated:** [February 14, 2026, 7:58am UTC](https://discourse.julialang.org/t/update-a-const-defined-in-a-module/135548 "2026-02-14T07:58:22Z")

</div>

Now we can update a const julia\> const m = 0 0 julia\> const m = 1 1 in a REPL. But in a larger project I may want to wrap all the consts in another module M. # Opening a new julia REPL julia\> module M con…

---

## [Alternative to Base.get\_extension](https://discourse.julialang.org/t/alternative-to-base-get-extension/133191)

<div class="topic-metadata">

**Author:** [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Replies:** 13\
**Last updated:** [October 16, 2025, 7:14am UTC](https://discourse.julialang.org/t/alternative-to-base-get-extension/133191 "2025-10-16T07:14:23Z")

</div>

That was quick!

---

## [Usability improvements in TestItemRunner.@testmodule](https://discourse.julialang.org/t/usability-improvements-in-testitemrunner-testmodule/132513)

<div class="topic-metadata">

**Author:** [@Ken\_Williams](https://discourse.julialang.org/u/Ken_Williams)\
**Replies:** 2\
**Last updated:** [October 9, 2025, 9:53pm UTC](https://discourse.julialang.org/t/usability-improvements-in-testitemrunner-testmodule/132513 "2025-10-09T21:53:29Z")

</div>

There are a couple of usability improvements I’d love to see in the @testmodule functionality from TestItemRunner: The ability to load a testing module from the REPL, so I could do something like TestEnv.activate() lo…

---

## [How to divide a project into files and submodules?](https://discourse.julialang.org/t/how-to-divide-a-project-into-files-and-submodules/131593)

<div class="topic-metadata">

**Author:** [@Snowy](https://discourse.julialang.org/u/Snowy)\
**Replies:** 5\
**Last updated:** [August 14, 2025, 5:42pm UTC](https://discourse.julialang.org/t/how-to-divide-a-project-into-files-and-submodules/131593 "2025-08-14T17:42:26Z")

</div>

Thanks, this seems like probably a little more of an elegant solution. If working on a large project, is the best solution here to create a module with defined structs then include them in other appropriate modules?

---

## [Genie modularize @app logic](https://discourse.julialang.org/t/genie-modularize-app-logic/131373)

<div class="topic-metadata">

**Author:** [@vh94](https://discourse.julialang.org/u/vh94)\
**Replies:** 0\
**Last updated:** [August 5, 2025, 12:40pm UTC](https://discourse.julialang.org/t/genie-modularize-app-logic/131373 "2025-08-05T12:40:21Z")

</div>

Is there a way to programmatically initialize @in and @out vars in GenieFramework.jl ? I would like to call a type of constructor from a module sever logic using namespaces , :tree, :ghost, to not have to initialize ev…

---

## [Revise not working with module scripts](https://discourse.julialang.org/t/revise-not-working-with-module-scripts/131339)

<div class="topic-metadata">

**Author:** [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Replies:** 1\
**Last updated:** [August 4, 2025, 4:04pm UTC](https://discourse.julialang.org/t/revise-not-working-with-module-scripts/131339 "2025-08-04T16:04:24Z")

</div>

I am trying to compare two versions of a script. I wrapped them in modules so I can compare their intermediate values by name in the REPL, but the values are not updated when I save. Is that expected? Is there a better w…

---

## [Does importing a submodule do anything?](https://discourse.julialang.org/t/does-importing-a-submodule-do-anything/86689)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 5\
**Last updated:** [April 29, 2025, 2:28pm UTC](https://discourse.julialang.org/t/does-importing-a-submodule-do-anything/86689 "2025-04-29T14:28:48Z")

</div>

The following codes do the same thing: module A x = 3 end @show A.x # 3 and module A x = 3 end import .A @show A.x # 3 Does import .A do anything at all in the second example? If not, why is it allowed?

---

## [Symbol is Base.isexported but not Base.isbindingresolved?](https://discourse.julialang.org/t/symbol-is-base-isexported-but-not-base-isbindingresolved/123471)

<div class="topic-metadata">

**Author:** [@ajwheeler](https://discourse.julialang.org/u/ajwheeler)\
**Replies:** 4\
**Last updated:** [December 5, 2024, 3:58pm UTC](https://discourse.julialang.org/t/symbol-is-base-isexported-but-not-base-isbindingresolved/123471 "2024-12-05T15:58:23Z")

</div>

Working on Group import hints by ajwheeler · Pull Request #56753 · JuliaLang/julia · GitHub, I was surprised to see that there are cases of symbols s and modules m for which Base.isbindingresolved(m, s) is false, but Bas…

---

## [Extend julia module](https://discourse.julialang.org/t/extend-julia-module/123407)

<div class="topic-metadata">

**Author:** [@Sergey](https://discourse.julialang.org/u/Sergey)\
**Replies:** 7\
**Last updated:** [December 4, 2024, 10:02am UTC](https://discourse.julialang.org/t/extend-julia-module/123407 "2024-12-04T10:02:25Z")

</div>

Hi. I try to understand modules in julia. And cant figure out how to extend julia module. Suppose i have a module: module Test t :: Float64 = 0 end how to add new function or variable to the module from another …

---

## [PackageCompiler app with proprietary modules, non "registered"](https://discourse.julialang.org/t/packagecompiler-app-with-proprietary-modules-non-registered/77285)

<div class="topic-metadata">

**Author:** [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Replies:** 0\
**Last updated:** [March 2, 2022, 9:44am UTC](https://discourse.julialang.org/t/packagecompiler-app-with-proprietary-modules-non-registered/77285 "2022-03-02T09:44:03Z")

</div>

I’m trying to use PackageCompiler with a microservice based on HTTP.jl. My project also depends on proprietary modules that are not FOSS projects in GitHub. Everything works fine if I run the code. PackageCompiler.create…

---

## [Recompilation triggered when re-running function from module](https://discourse.julialang.org/t/recompilation-triggered-when-re-running-function-from-module/120770)

<div class="topic-metadata">

**Author:** [@Rbthn](https://discourse.julialang.org/u/Rbthn)\
**Replies:** 5\
**Last updated:** [October 1, 2024, 1:36pm UTC](https://discourse.julialang.org/t/recompilation-triggered-when-re-running-function-from-module/120770 "2024-10-01T13:36:21Z")

</div>

Hello! I’m relatively new to Julia and have encountered some behavior I cannot explain. In a MWE, I have a function that takes an ODEProblem and algorithm and just calls DiffEq.solve() with these arguments. function my…

---

## [Warning about variable conflict from module export?](https://discourse.julialang.org/t/warning-about-variable-conflict-from-module-export/119841)

<div class="topic-metadata">

**Author:** [@aaoo](https://discourse.julialang.org/u/aaoo)\
**Replies:** 2\
**Last updated:** [September 25, 2024, 2:42am UTC](https://discourse.julialang.org/t/warning-about-variable-conflict-from-module-export/119841 "2024-09-25T02:42:37Z")

</div>

This may not work in v"1.10", got a warning on name conflicts. julia\> module Foo x = 1 y = 2 for n in names(@\_\_MODULE\_\_; all=true) if Base.isidentifier(n) && n ∉ (…

---

## [Change in behavior when loading a module twice](https://discourse.julialang.org/t/change-in-behavior-when-loading-a-module-twice/118370)

<div class="topic-metadata">

**Author:** [@Magnus\_Lilledahl](https://discourse.julialang.org/u/Magnus_Lilledahl)\
**Replies:** 4\
**Last updated:** [August 20, 2024, 9:52am UTC](https://discourse.julialang.org/t/change-in-behavior-when-loading-a-module-twice/118370 "2024-08-20T09:52:51Z")

</div>

I have a module Mod1 stored in a file Mod1.jl and a module Mod2 stored in a file Mod2.jl. ‘Mod1’ exports a function userfun that uses a function foo which is defined in Mod2. Mod2 also defines some new types. module Mod…

---

## [Cant use module normally](https://discourse.julialang.org/t/cant-use-module-normally/117973)

<div class="topic-metadata">

**Author:** [@martin\_sanchez](https://discourse.julialang.org/u/martin_sanchez)\
**Replies:** 4\
**Last updated:** [August 9, 2024, 12:55am UTC](https://discourse.julialang.org/t/cant-use-module-normally/117973 "2024-08-09T00:55:43Z")

</div>

In This tutorial they even have an online code executer in which they set the example of using a module. They first have a file mymodule.jl in which they write: \`module MyModule export sum\_function, resta function sum…

---

## [How can I use a Holy trait defined in a module outside of it?](https://discourse.julialang.org/t/how-can-i-use-a-holy-trait-defined-in-a-module-outside-of-it/116408)

<div class="topic-metadata">

**Author:** [@paalon](https://discourse.julialang.org/u/paalon)\
**Replies:** 3\
**Last updated:** [June 30, 2024, 7:49am UTC](https://discourse.julialang.org/t/how-can-i-use-a-holy-trait-defined-in-a-module-outside-of-it/116408 "2024-06-30T07:49:28Z")

</div>

I’m studying Julia’s Holy traits along with traits in Rust, Scala and the original traits paper, “Traits: A Mechanism for Fine-grained Reuse”. I want to use a trait Color defined in ColorModule outside of its module. I w…

---

## [Types must be first defined then called in a module? Why?](https://discourse.julialang.org/t/types-must-be-first-defined-then-called-in-a-module-why/114497)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 7\
**Last updated:** [May 21, 2024, 11:40am UTC](https://discourse.julialang.org/t/types-must-be-first-defined-then-called-in-a-module-why/114497 "2024-05-21T11:40:10Z")

</div>

module MyModule function myfun(t::MyType) println(plusone(t.x)) end struct MyType x::Float64 end function plusone(x) x + 1 end end ERROR: UndefVarError: \`MyType\` not defined

---

## [Refactoring Julia Modules for Shape Representation and Canvas Drawing](https://discourse.julialang.org/t/refactoring-julia-modules-for-shape-representation-and-canvas-drawing/114095)

<div class="topic-metadata">

**Author:** [@Akhil\_Akkapelli](https://discourse.julialang.org/u/Akhil_Akkapelli)\
**Replies:** 1\
**Last updated:** [May 10, 2024, 11:21am UTC](https://discourse.julialang.org/t/refactoring-julia-modules-for-shape-representation-and-canvas-drawing/114095 "2024-05-10T11:21:53Z")

</div>

I have two Julia modules, “Shape.jl” and “Canvas.jl”, which define shapes and a canvas for drawing them. The code works as intended, but I’m wondering if there’s a cleaner and more efficient way to structure these module…

---

## [Multimodule project: Error when calling function from imported module in Julia](https://discourse.julialang.org/t/multimodule-project-error-when-calling-function-from-imported-module-in-julia/113045)

<div class="topic-metadata">

**Author:** [@dmgcodevil](https://discourse.julialang.org/u/dmgcodevil)\
**Replies:** 1\
**Last updated:** [April 17, 2024, 7:52am UTC](https://discourse.julialang.org/t/multimodule-project-error-when-calling-function-from-imported-module-in-julia/113045 "2024-04-17T07:52:28Z")

</div>

I’m new to Julia. I want to organize my code into modules. I have three modules: ModuleA.jl : module ModuleA include("ModuleB.jl") export process using .ModuleB function process(foo::Foo) end end ModuleB.jl : modul…

---

## [Issue with Wildcard Import in Julia Module](https://discourse.julialang.org/t/issue-with-wildcard-import-in-julia-module/111613)

<div class="topic-metadata">

**Author:** [@Daniel\_S](https://discourse.julialang.org/u/Daniel_S)\
**Replies:** 4\
**Last updated:** [March 14, 2024, 2:23pm UTC](https://discourse.julialang.org/t/issue-with-wildcard-import-in-julia-module/111613 "2024-03-14T14:23:15Z")

</div>

I’m encountering an issue with wildcard imports (“import .ModuleName: \*”) in Julia. Specifically, when attempting to import all symbols from a module using the wildcard syntax, the symbols do not seem to be available in …

---

## [Underscore syntax and anonymous modules?](https://discourse.julialang.org/t/underscore-syntax-and-anonymous-modules/110003)

<div class="topic-metadata">

**Author:** [@sadish-d](https://discourse.julialang.org/u/sadish-d)\
**Replies:** 1\
**Last updated:** [February 9, 2024, 6:18pm UTC](https://discourse.julialang.org/t/underscore-syntax-and-anonymous-modules/110003 "2024-02-09T18:18:59Z")

</div>

So I can’t do module \_ end? Is that still consistent with “syntax requires a variable but the variable is never used”? It would be useful in creating different namespaces.

---

## [Idea: New julia CLI switches (\`-m\` and \`--pkg\`)](https://discourse.julialang.org/t/idea-new-julia-cli-switches-m-and-pkg/98897)

<div class="topic-metadata">

**Author:** [@pankgeorg](https://discourse.julialang.org/u/pankgeorg)\
**Replies:** 9\
**Last updated:** [January 2, 2024, 2:32pm UTC](https://discourse.julialang.org/t/idea-new-julia-cli-switches-m-and-pkg/98897 "2024-01-02T14:32:08Z")

</div>

\-m: shorthand for -e using Module: Module julia -e "import Pluto; Pluto.run()" is a pattern I happen to use very often With this idea it could get converted to julia -m Pluto which could even run pluto as-is (inv…

---

## [What functions are visible in REPL?](https://discourse.julialang.org/t/what-functions-are-visible-in-repl/107612)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 3\
**Last updated:** [December 14, 2023, 3:30pm UTC](https://discourse.julialang.org/t/what-functions-are-visible-in-repl/107612 "2023-12-14T15:30:45Z")

</div>

I am using some people’s package. I tried to look up some function in the REPL with ?. But it turned that the function could not be found. The function is definitely there in the package. Is it because the function is …

---

## [How do I get a list of functions defined in a module?](https://discourse.julialang.org/t/how-do-i-get-a-list-of-functions-defined-in-a-module/22266)

<div class="topic-metadata">

**Author:** [@Elmer\_Cusipuma](https://discourse.julialang.org/u/Elmer_Cusipuma)\
**Replies:** 9\
**Last updated:** [December 4, 2023, 3:18pm UTC](https://discourse.julialang.org/t/how-do-i-get-a-list-of-functions-defined-in-a-module/22266 "2023-12-04T15:18:09Z")

</div>

Is there a command in Julia 1.1 that lists all the methods that are available in a module? e.g. module MyMod test1() = 1 test2() = 2 test3() = 3 end Which would return: \[test1,test2,test3\]

---

## [Check out the functions in a module](https://discourse.julialang.org/t/check-out-the-functions-in-a-module/107075)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 2\
**Last updated:** [December 3, 2023, 2:33pm UTC](https://discourse.julialang.org/t/check-out-the-functions-in-a-module/107075 "2023-12-03T14:33:51Z")

</div>

In the console, after using some\_peoples\_package How can I obtain a list of all the functions imported?

---

## [Import struct without changing its "scope"](https://discourse.julialang.org/t/import-struct-without-changing-its-scope/106529)

<div class="topic-metadata">

**Author:** [@Yue-Zhengyuan](https://discourse.julialang.org/u/Yue-Zhengyuan)\
**Replies:** 7\
**Last updated:** [November 22, 2023, 4:50am UTC](https://discourse.julialang.org/t/import-struct-without-changing-its-scope/106529 "2023-11-22T04:50:21Z")

</div>

I have problems on importing struct from other files. Suppose I have the file structure: - Lattices.jl - Hamiltonians.jl - main.jl Lattices.jl defines a struct called Lattice: module Lattices export Lattice struct La…

---

## [Would it make sense to roll back module definitions which error half-way?](https://discourse.julialang.org/t/would-it-make-sense-to-roll-back-module-definitions-which-error-half-way/105228)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 0\
**Last updated:** [October 20, 2023, 11:25am UTC](https://discourse.julialang.org/t/would-it-make-sense-to-roll-back-module-definitions-which-error-half-way/105228 "2023-10-20T11:25:44Z")

</div>

Consider this: julia\> module M const a = 1 error("e") const b = 2 end ERROR: e Stacktrace: \[1\] error(s::String) @ Base ./error.jl:35 \[2\] top-level scope @ REPL\[1\]:3 julia\> M.a …

---

## [Problems with signature changes of imported local modules on include](https://discourse.julialang.org/t/problems-with-signature-changes-of-imported-local-modules-on-include/104842)

<div class="topic-metadata">

**Author:** [@hijit](https://discourse.julialang.org/u/hijit)\
**Replies:** 26\
**Last updated:** [October 19, 2023, 1:47pm UTC](https://discourse.julialang.org/t/problems-with-signature-changes-of-imported-local-modules-on-include/104842 "2023-10-19T13:47:27Z")

</div>

Hi I realized during the development of a Julia package that one of the big drawbacks of importing/using local modules is that the signatures of all functions tied to a Modules namespace are changed to be nested in the i…

---

## [Confused by behavior when changing ENV\["PYTHONPATH"\] in new module](https://discourse.julialang.org/t/confused-by-behavior-when-changing-env-pythonpath-in-new-module/104408)

<div class="topic-metadata">

**Author:** [@mgalenb](https://discourse.julialang.org/u/mgalenb)\
**Replies:** 0\
**Last updated:** [September 29, 2023, 6:48pm UTC](https://discourse.julialang.org/t/confused-by-behavior-when-changing-env-pythonpath-in-new-module/104408 "2023-09-29T18:48:01Z")

</div>

I am making a module (which has a local python env installed) and I am trying to add a path to ENV\[“PYTHONPATH”\] and then import a module I am hacking in module Test ENV\["PYTHONPATH"\]=joinpath(dirname(@\_\_FILE\_\_), "pyth…

---

## ["Under the hood" difference between import and using](https://discourse.julialang.org/t/under-the-hood-difference-between-import-and-using/103741)

<div class="topic-metadata">

**Author:** [@deaminase](https://discourse.julialang.org/u/deaminase)\
**Replies:** 9\
**Last updated:** [September 11, 2023, 5:27pm UTC](https://discourse.julialang.org/t/under-the-hood-difference-between-import-and-using/103741 "2023-09-11T17:27:36Z")

</div>

So, based on the docs I know that eg. import doesn’t bring in any exported identifiers to your namespace when importing a module, and if you want to add a method to a function without using its fully qualified name, you …

[Next page](https://discourse.julialang.org/tag/module/151.md?match_all_tags=true&page=1&tags%5B%5D=module)
