# \#module

**URL:** https://discourse.julialang.org/tag/module/151.md?page=4

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

**Page:** 5

---

## [How do you evaluate a parameter/variable if you are not in Main eval or Core.Eval do not work?](https://discourse.julialang.org/t/how-do-you-evaluate-a-parameter-variable-if-you-are-not-in-main-eval-or-core-eval-do-not-work/42343)

<div class="topic-metadata">

**Author:** [@cbasile21](https://discourse.julialang.org/u/cbasile21)\
**Replies:** 4\
**Last updated:** [July 1, 2020, 3:44pm UTC](https://discourse.julialang.org/t/how-do-you-evaluate-a-parameter-variable-if-you-are-not-in-main-eval-or-core-eval-do-not-work/42343 "2020-07-01T15:44:19Z")

</div>

Hello, I would really appreciate your help with the following problem. I will want to learn how evaluate a variable outside of Main, and I could not find a way to do that yet. Expected: Eval will work for #println(Core…

---

## [How to import a local module into another in different separate files](https://discourse.julialang.org/t/how-to-import-a-local-module-into-another-in-different-separate-files/42058)

<div class="topic-metadata">

**Author:** [@abannsunny](https://discourse.julialang.org/u/abannsunny)\
**Replies:** 11\
**Last updated:** [June 26, 2020, 1:00pm UTC](https://discourse.julialang.org/t/how-to-import-a-local-module-into-another-in-different-separate-files/42058 "2020-06-26T13:00:40Z")

</div>

I wanted to know how to import a local module in a file into another in a different file. so for instance, I have a situation like this: #inside main.jl include("M2.jl") include("M1.jl") function DoSomething(inputStr…

---

## [Organisation into submodules and multiple dispatch](https://discourse.julialang.org/t/organisation-into-submodules-and-multiple-dispatch/40641)

<div class="topic-metadata">

**Author:** [@sparrowhawk](https://discourse.julialang.org/u/sparrowhawk)\
**Replies:** 7\
**Last updated:** [June 3, 2020, 6:15am UTC](https://discourse.julialang.org/t/organisation-into-submodules-and-multiple-dispatch/40641 "2020-06-03T06:15:29Z")

</div>

I want to have a supermodule that contains a function, which carries out different operations depending on the input type. Depending on the type, this function is defined in various submodules. The submodules can be supe…

---

## [How to structure a mid-sized OOP-like project physically and logically - Types.jl, Submodules or "deep Hierarchies"?](https://discourse.julialang.org/t/how-to-structure-a-mid-sized-oop-like-project-physically-and-logically-types-jl-submodules-or-deep-hierarchies/40410)

<div class="topic-metadata">

**Author:** [@PeterKeffer](https://discourse.julialang.org/u/PeterKeffer)\
**Replies:** 3\
**Last updated:** [May 29, 2020, 2:00pm UTC](https://discourse.julialang.org/t/how-to-structure-a-mid-sized-oop-like-project-physically-and-logically-types-jl-submodules-or-deep-hierarchies/40410 "2020-05-29T14:00:59Z")

</div>

Hey there Julians! I’m still a bloody beginner with Julia, but want to start with a medium size OOP-structured project. (I’m also a CS student, so I’m still learning how to engineer software the right way) I started wr…

---

## [Pass local module to a function?](https://discourse.julialang.org/t/pass-local-module-to-a-function/40021)

<div class="topic-metadata">

**Author:** [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Replies:** 1\
**Last updated:** [May 23, 2020, 2:01pm UTC](https://discourse.julialang.org/t/pass-local-module-to-a-function/40021 "2020-05-23T14:01:47Z")

</div>

I’m trying to create a minimal working example of a Documenter error I’m experiencing. However I’m having trouble passing the “local” module to the doctest function, This is what I’m trying: using Documenter module Fo…

---

## [Some clarity on modules and incremental compilation/loading times](https://discourse.julialang.org/t/some-clarity-on-modules-and-incremental-compilation-loading-times/39449)

<div class="topic-metadata">

**Author:** [@Libbum](https://discourse.julialang.org/u/Libbum)\
**Replies:** 6\
**Last updated:** [May 14, 2020, 12:20pm UTC](https://discourse.julialang.org/t/some-clarity-on-modules-and-incremental-compilation-loading-times/39449 "2020-05-14T12:20:52Z")

</div>

Hi all, I’ve read a bunch concerning modules and such, but haven’t managed to identify the best practice for my situation. My package currently has something like this: module Example include("file1.jl") # Some methods…

---

## [Can not cahnge variables defined in an external file](https://discourse.julialang.org/t/can-not-cahnge-variables-defined-in-an-external-file/39214)

<div class="topic-metadata">

**Author:** [@fedoroff](https://discourse.julialang.org/u/fedoroff)\
**Replies:** 7\
**Last updated:** [May 11, 2020, 2:40pm UTC](https://discourse.julialang.org/t/can-not-cahnge-variables-defined-in-an-external-file/39214 "2020-05-11T14:40:45Z")

</div>

Let us assume that I define some variables in a separate file “input.jl”. For example, let the content of “input.jl” be a = 123.0 Then, I want to use the name of this file as an input parameter to dynamically load the…

---

## [Documenter handling Internal (private) modules](https://discourse.julialang.org/t/documenter-handling-internal-private-modules/39242)

<div class="topic-metadata">

**Author:** [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Replies:** 1\
**Last updated:** [May 11, 2020, 3:38am UTC](https://discourse.julialang.org/t/documenter-handling-internal-private-modules/39242 "2020-05-11T03:38:23Z")

</div>

I am working on the documentation for module that mostly just bridges the gap between Julia and a C library. There are two methods that I expose that are fully written in Julia because they do not have a counterpart in …

---

## [How to use local module within a Project directory?](https://discourse.julialang.org/t/how-to-use-local-module-within-a-project-directory/26358)

<div class="topic-metadata">

**Author:** [@tuckermcclure](https://discourse.julialang.org/u/tuckermcclure)\
**Replies:** 13\
**Last updated:** [April 6, 2020, 4:45pm UTC](https://discourse.julialang.org/t/how-to-use-local-module-within-a-project-directory/26358 "2020-04-06T16:45:35Z")

</div>

When I’m not in a Project directory, I can make a file like so: # M1.jl module M1 export M1Type struct M1Type data::Real end end and then from that directory: push!(LOAD\_PATH, pwd() and then usin…

---

## [Import types "above" a module with ..: for consistency and brevity?](https://discourse.julialang.org/t/import-types-above-a-module-with-for-consistency-and-brevity/36754)

<div class="topic-metadata">

**Author:** [@tuckermcclure](https://discourse.julialang.org/u/tuckermcclure)\
**Replies:** 7\
**Last updated:** [April 3, 2020, 7:02pm UTC](https://discourse.julialang.org/t/import-types-above-a-module-with-for-consistency-and-brevity/36754 "2020-04-03T19:02:01Z")

</div>

You can import stuff from “above” with ..Thing, such as: module Mod # Define some common types. struct T1; field::Int64; end struct T2; field::Float64; end # Define a sub module. Maybe this would even live in a differ…

---

## [Where to define type aliases within a module's hierarchy](https://discourse.julialang.org/t/where-to-define-type-aliases-within-a-modules-hierarchy/35131)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 0\
**Last updated:** [February 25, 2020, 6:46pm UTC](https://discourse.julialang.org/t/where-to-define-type-aliases-within-a-modules-hierarchy/35131 "2020-02-25T18:46:21Z")

</div>

Is there a guideline on where to put type aliases in a module with multiple source files?

---

## [Module version standard/convention](https://discourse.julialang.org/t/module-version-standard-convention/34686)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 3\
**Last updated:** [February 17, 2020, 12:07am UTC](https://discourse.julialang.org/t/module-version-standard-convention/34686 "2020-02-17T00:07:06Z")

</div>

In the Python world, you can find out the current version of a module by querying \_version\_ attribute of the module. Is there any reason why we shouldn’t adopt a similar standard/convention so that one can dynamically f…

---

## [What exactly are the arguments of \`Base.require\`?](https://discourse.julialang.org/t/what-exactly-are-the-arguments-of-base-require/33373)

<div class="topic-metadata">

**Author:** [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Replies:** 12\
**Last updated:** [January 28, 2020, 6:41am UTC](https://discourse.julialang.org/t/what-exactly-are-the-arguments-of-base-require/33373 "2020-01-28T06:41:52Z")

</div>

It may be my stupidity, but I do not seem to find exactly what I should pass to Base.require. The docs are not very clear on what I should pass as first parameter (is it the current module? is it Main?). And the only me…

---

## [Is there a mechanism in Julia to load modules on demand?](https://discourse.julialang.org/t/is-there-a-mechanism-in-julia-to-load-modules-on-demand/33784)

<div class="topic-metadata">

**Author:** [@nxtruong](https://discourse.julialang.org/u/nxtruong)\
**Replies:** 6\
**Last updated:** [January 25, 2020, 6:56pm UTC](https://discourse.julialang.org/t/is-there-a-mechanism-in-julia-to-load-modules-on-demand/33784 "2020-01-25T18:56:21Z")

</div>

As I understand, using and import statements must be at the top level. However, sometimes I just want to import a module on-demand, in a function that uses that module. For example, a large module X contains both functio…

---

## [Custom modules usage](https://discourse.julialang.org/t/custom-modules-usage/31702)

<div class="topic-metadata">

**Author:** [@kirtsar](https://discourse.julialang.org/u/kirtsar)\
**Replies:** 2\
**Last updated:** [December 1, 2019, 6:51am UTC](https://discourse.julialang.org/t/custom-modules-usage/31702 "2019-12-01T06:51:55Z")

</div>

My LOAD\_PATH looks like: ... ~/progs/dev I have two modules in dev folder. However, I can use using only for one module, and the second one seems “invisible” to Julia for some reasons…

---

## [How to analyse module memory usage/memory leak?](https://discourse.julialang.org/t/how-to-analyse-module-memory-usage-memory-leak/31706)

<div class="topic-metadata">

**Author:** [@squaregoldfish](https://discourse.julialang.org/u/squaregoldfish)\
**Replies:** 0\
**Last updated:** [December 1, 2019, 3:36am UTC](https://discourse.julialang.org/t/how-to-analyse-module-memory-usage-memory-leak/31706 "2019-12-01T03:36:44Z")

</div>

I’m trying to analyse the memory usage of a module I’ve written, named InterpolationData. Calling varinfo(InterpolationData) gives the following: julia\> varinfo(InterpolationData) name size summa…

---

## [How to get all the symbols within a module?](https://discourse.julialang.org/t/how-to-get-all-the-symbols-within-a-module/31539)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 2\
**Last updated:** [November 27, 2019, 1:13am UTC](https://discourse.julialang.org/t/how-to-get-all-the-symbols-within-a-module/31539 "2019-11-27T01:13:24Z")

</div>

is there a way to list all the symbols in a module?

---

## [How to get a included .jl files path list in REPL](https://discourse.julialang.org/t/how-to-get-a-included-jl-files-path-list-in-repl/30647)

<div class="topic-metadata">

**Author:** [@AtsushiSakai](https://discourse.julialang.org/u/AtsushiSakai)\
**Replies:** 1\
**Last updated:** [November 3, 2019, 1:12pm UTC](https://discourse.julialang.org/t/how-to-get-a-included-jl-files-path-list-in-repl/30647 "2019-11-03T13:12:02Z")

</div>

Is there a way to get a path list of all included .jl files in REPL?

---

## [How to export programatically-generated variables from a module](https://discourse.julialang.org/t/how-to-export-programatically-generated-variables-from-a-module/29118)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 1\
**Last updated:** [September 24, 2019, 6:52pm UTC](https://discourse.julialang.org/t/how-to-export-programatically-generated-variables-from-a-module/29118 "2019-09-24T18:52:45Z")

</div>

There might be a much simpler solution to this that doesn’t even involve metaprogramming, but what I’m trying to do is generate some variables within a module that will hold data frames and then make those variables avai…

---

## [Precompile custom module fails but program still working](https://discourse.julialang.org/t/precompile-custom-module-fails-but-program-still-working/27859)

<div class="topic-metadata">

**Author:** [@wpkzz](https://discourse.julialang.org/u/wpkzz)\
**Replies:** 5\
**Last updated:** [August 23, 2019, 5:44pm UTC](https://discourse.julialang.org/t/precompile-custom-module-fails-but-program-still-working/27859 "2019-08-23T17:44:58Z")

</div>

I am trying to formalize my code in a more julian style and I have sepparated a lot of routines from a Jupyter Notebook to a Julia sort of script with all that I could put on a functions module in another file. I am also…

---

## [Problem adding SPICE dependency into a custom module](https://discourse.julialang.org/t/problem-adding-spice-dependency-into-a-custom-module/27711)

<div class="topic-metadata">

**Author:** [@Calum\_H](https://discourse.julialang.org/u/Calum_H)\
**Replies:** 1\
**Last updated:** [August 19, 2019, 4:54pm UTC](https://discourse.julialang.org/t/problem-adding-spice-dependency-into-a-custom-module/27711 "2019-08-19T16:54:12Z")

</div>

Hi all, I’m writing a custom module “MyModule” in my local users/calum/.julia/dev. In MyModule i have a few dependencies that I added manually to the project.toml: \[deps\] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fc…

---

## [Trouble importing a module that depends on another globally imported module](https://discourse.julialang.org/t/trouble-importing-a-module-that-depends-on-another-globally-imported-module/26482)

<div class="topic-metadata">

**Author:** [@zachmatson](https://discourse.julialang.org/u/zachmatson)\
**Replies:** 9\
**Last updated:** [July 19, 2019, 9:53pm UTC](https://discourse.julialang.org/t/trouble-importing-a-module-that-depends-on-another-globally-imported-module/26482 "2019-07-19T21:53:16Z")

</div>

I have a project which is structured like: Connect4Solver: -\>Connect4Board.jl -\>MCTS.jl Connect4Board.jl defines a module Connect4Board which defines a type Board. MCTS.jl defines a module MCTS which imports Connect4B…

---

## [\`deepcopy(::Module)\` and mocking for tests](https://discourse.julialang.org/t/deepcopy-module-and-mocking-for-tests/24214)

<div class="topic-metadata">

**Author:** [@NHDaly](https://discourse.julialang.org/u/NHDaly)\
**Replies:** 6\
**Last updated:** [July 18, 2019, 9:36pm UTC](https://discourse.julialang.org/t/deepcopy-module-and-mocking-for-tests/24214 "2019-07-18T21:36:42Z")

</div>

I have a crazy question/proposal. Currently, deepcopy isn’t defined for Modules: julia\> deepcopy(MyModule) ERROR: deepcopy of Modules not supported I think it might not be too hard to implement this. I wrote a somewha…

---

## [Use another function in the same module](https://discourse.julialang.org/t/use-another-function-in-the-same-module/26318)

<div class="topic-metadata">

**Author:** [@POKIN\_CHAN](https://discourse.julialang.org/u/POKIN_CHAN)\
**Replies:** 4\
**Last updated:** [July 13, 2019, 11:27am UTC](https://discourse.julialang.org/t/use-another-function-in-the-same-module/26318 "2019-07-13T11:27:01Z")

</div>

module ABC function F\_1(a:Int,b:Int) return a + b end function F\_2(c:Int, d:Int) result = F\_1(c+3,d+c) return result end end e.g. Main.ABC.F\_2(3,4) will have an error because F\_1 cannot be called…

---

## [Check for element type inside a module (Images)](https://discourse.julialang.org/t/check-for-element-type-inside-a-module-images/26085)

<div class="topic-metadata">

**Author:** [@Amin\_Yahyaabadi](https://discourse.julialang.org/u/Amin_Yahyaabadi)\
**Replies:** 1\
**Last updated:** [July 7, 2019, 3:37am UTC](https://discourse.julialang.org/t/check-for-element-type-inside-a-module-images/26085 "2019-07-07T03:37:55Z")

</div>

I am trying to check the type of the elements of an image that is passed to a function which is inside a module. Consider I define img as follows: using Images img = colorview(Gray, array); Then inside the function in…

---

## [Loading a module outside \`Main\` module](https://discourse.julialang.org/t/loading-a-module-outside-main-module/15282)

<div class="topic-metadata">

**Author:** [@ahmetumutdurmus](https://discourse.julialang.org/u/ahmetumutdurmus)\
**Replies:** 5\
**Last updated:** [June 26, 2019, 7:36am UTC](https://discourse.julialang.org/t/loading-a-module-outside-main-module/15282 "2019-06-26T07:36:25Z")

</div>

Hi, I am currently trying to create a module and load it back again for further use yet having trouble in doing so. Consider the trivial example: module MyModule export x, y x() = "x" y() = "y" p() = "p" end using …

---

## [Struct construction in own built modules](https://discourse.julialang.org/t/struct-construction-in-own-built-modules/25553)

<div class="topic-metadata">

**Author:** [@mrVeng](https://discourse.julialang.org/u/mrVeng)\
**Replies:** 5\
**Last updated:** [June 23, 2019, 9:14pm UTC](https://discourse.julialang.org/t/struct-construction-in-own-built-modules/25553 "2019-06-23T21:14:23Z")

</div>

Hi everyone, I am wondering how everyone properly defines structs for their own modules. I read that in Julia, one usually defines one base module where general packages are imported, file dependencies to own functions …

---

## [Own module and how to run it](https://discourse.julialang.org/t/own-module-and-how-to-run-it/24273)

<div class="topic-metadata">

**Author:** [@wiktorkujawa](https://discourse.julialang.org/u/wiktorkujawa)\
**Replies:** 3\
**Last updated:** [May 16, 2019, 10:44am UTC](https://discourse.julialang.org/t/own-module-and-how-to-run-it/24273 "2019-05-16T10:44:54Z")

</div>

I have to files: test.jl x=5 y=4 include("./file.jl") using .File xyzadd(x,y) xyzmultiply(x,y) and 2)file.jl module File export xyzadd,xyzmultiply function xyzadd(a,b) print("Add: ") return a+b end functi…

---

## [How to know already included modules in Julia 1.x](https://discourse.julialang.org/t/how-to-know-already-included-modules-in-julia-1-x/22747)

<div class="topic-metadata">

**Author:** [@AtsushiSakai](https://discourse.julialang.org/u/AtsushiSakai)\
**Replies:** 2\
**Last updated:** [April 4, 2019, 12:59pm UTC](https://discourse.julialang.org/t/how-to-know-already-included-modules-in-julia-1-x/22747 "2019-04-04T12:59:00Z")

</div>

Hi. I’m trying to know already included modules in Julia 1.x. For example, include("path/to/moduleA.jl") include("path/to/moduleB.jl") # I want to know module A and B have already included here. Does anyone know that? …

---

## [Error type mismatch](https://discourse.julialang.org/t/error-type-mismatch/22636)

<div class="topic-metadata">

**Author:** [@yosinlpet](https://discourse.julialang.org/u/yosinlpet)\
**Replies:** 1\
**Last updated:** [April 2, 2019, 1:46pm UTC](https://discourse.julialang.org/t/error-type-mismatch/22636 "2019-04-02T13:46:15Z")

</div>

Hello, I have an issue with a project in which two different modules (‘MultiPro’ and ‘ProfileMod’) call the same module ‘VortexElement’. However, since ‘MultiPro’ calls the ‘ProfileMod’ module, Julia does not understand …

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

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