# \#namespaces

**URL:** https://discourse.julialang.org/tag/namespaces/861.md

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

---

## [Namespacing Symbols in \`ModelingToolkit.calculate\_jacobian\`](https://discourse.julialang.org/t/namespacing-symbols-in-modelingtoolkit-calculate-jacobian/123337)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 2\
**Last updated:** [December 3, 2024, 4:41pm UTC](https://discourse.julialang.org/t/namespacing-symbols-in-modelingtoolkit-calculate-jacobian/123337 "2024-12-03T16:41:07Z")

</div>

I (think I) need to retrieve the Jacobian of an ODESystem, but with namespaces for each symbol. For example, calling calculate\_jacobian on a system below produces a matrix with symbols without namespaces. using Astrodyn…

---

## [Avoid namespace pollution from startup.jl](https://discourse.julialang.org/t/avoid-namespace-pollution-from-startup-jl/116743)

<div class="topic-metadata">

**Author:** [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)\
**Replies:** 11\
**Last updated:** [July 8, 2024, 2:30pm UTC](https://discourse.julialang.org/t/avoid-namespace-pollution-from-startup-jl/116743 "2024-07-08T14:30:13Z")

</div>

I have startup.jl file that I’m mostly happy with. Any time Julia is updated and I start an interactive session without explicitly activating some environment, startup.jl adds a few key packages to the base environment.…

---

## [Why it is possible to use a global variable in a custom function that declares later than the function declaration?](https://discourse.julialang.org/t/why-it-is-possible-to-use-a-global-variable-in-a-custom-function-that-declares-later-than-the-function-declaration/114034)

<div class="topic-metadata">

**Author:** [@Monkiesh](https://discourse.julialang.org/u/Monkiesh)\
**Replies:** 3\
**Last updated:** [May 9, 2024, 8:14am UTC](https://discourse.julialang.org/t/why-it-is-possible-to-use-a-global-variable-in-a-custom-function-that-declares-later-than-the-function-declaration/114034 "2024-05-09T08:14:30Z")

</div>

Hi Julianners, I am new to Julia. Recently, I find it’s weird that I can use a global variable declares later when I am writing a function. Here is an example: function p(a::Int) return a+b end b = 2 c = p(1) @sho…

---

## [VSCode REPL Namespaces/Modules](https://discourse.julialang.org/t/vscode-repl-namespaces-modules/103170)

<div class="topic-metadata">

**Author:** [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Replies:** 6\
**Last updated:** [December 14, 2023, 3:43pm UTC](https://discourse.julialang.org/t/vscode-repl-namespaces-modules/103170 "2023-12-14T15:43:29Z")

</div>

How is this still happening? How are you living with this? I expected the REPL module switching released with Julia 1.9 to fix this issue. (DataFrames) julia\> x = 3 # Ctrl + Enter 3 (DataFrames) julia\> x # Typed in…

---

## [MethodErrors suggest fixes that may depend on internal bindings](https://discourse.julialang.org/t/methoderrors-suggest-fixes-that-may-depend-on-internal-bindings/106468)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 5\
**Last updated:** [November 21, 2023, 6:35pm UTC](https://discourse.julialang.org/t/methoderrors-suggest-fixes-that-may-depend-on-internal-bindings/106468 "2023-11-21T18:35:21Z")

</div>

On Julia v1.11: julia\> using FillArrays, LinearAlgebra julia\> Zeros(2,2) \* UpperTriangular(Zeros(2,2)) ERROR: MethodError: \*(::Zeros{Float64, 2, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}, ::UpperTriangular{Float64, …

---

## [Missing functions in namespace from BioSequences](https://discourse.julialang.org/t/missing-functions-in-namespace-from-biosequences/97871)

<div class="topic-metadata">

**Author:** [@gus-pendleton](https://discourse.julialang.org/u/gus-pendleton)\
**Replies:** 4\
**Last updated:** [April 26, 2023, 4:40am UTC](https://discourse.julialang.org/t/missing-functions-in-namespace-from-biosequences/97871 "2023-04-26T04:40:37Z")

</div>

I feel like I’m missing something fundamental, but I’m unable to follow many of the examples in the BioSequences documentation, because many of the functions they use remain undefined in my namespace. A few key ones that…

---

## [Methods imported from submodules are overwritten, not extended](https://discourse.julialang.org/t/methods-imported-from-submodules-are-overwritten-not-extended/87995)

<div class="topic-metadata">

**Author:** [@tom-plaa](https://discourse.julialang.org/u/tom-plaa)\
**Replies:** 3\
**Last updated:** [September 30, 2022, 2:00pm UTC](https://discourse.julialang.org/t/methods-imported-from-submodules-are-overwritten-not-extended/87995 "2022-09-30T14:00:06Z")

</div>

I assumed that by defining different argument requirements I would get different methods for an already imported function from a submodule, but it seems I am getting an overwrite instead of an extension. What’s the idiom…

---

## [WARNING: using x.x in module Main conflicts with an existing identifier](https://discourse.julialang.org/t/warning-using-x-x-in-module-main-conflicts-with-an-existing-identifier/80819)

<div class="topic-metadata">

**Author:** [@BrianOConner](https://discourse.julialang.org/u/BrianOConner)\
**Replies:** 7\
**Last updated:** [May 12, 2022, 4:24am UTC](https://discourse.julialang.org/t/warning-using-x-x-in-module-main-conflicts-with-an-existing-identifier/80819 "2022-05-12T04:24:55Z")

</div>

Hi, this is basically my first day with Julia. I know that this question came up a few times in different context, but I did not really think the answers there where helpful. I tried to get random program and run it. I…

---

## [Re-evaluate function in another module](https://discourse.julialang.org/t/re-evaluate-function-in-another-module/80472)

<div class="topic-metadata">

**Author:** [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Replies:** 1\
**Last updated:** [May 4, 2022, 1:30pm UTC](https://discourse.julialang.org/t/re-evaluate-function-in-another-module/80472 "2022-05-04T13:30:56Z")

</div>

Consider the following: module A export foo whoami() = "A" foo() = whoami() end module B using Main.A whoami() = "B" end B.foo() # "A" I understand why that’s the case but is there a way to call A…

---

## [Notebooks Need Modules, i.e. Multiple Separate Global Namespaces](https://discourse.julialang.org/t/notebooks-need-modules-i-e-multiple-separate-global-namespaces/68541)

<div class="topic-metadata">

**Author:** [@Luapulu](https://discourse.julialang.org/u/Luapulu)\
**Replies:** 13\
**Last updated:** [January 1, 2022, 7:53pm UTC](https://discourse.julialang.org/t/notebooks-need-modules-i-e-multiple-separate-global-namespaces/68541 "2022-01-01T19:53:12Z")

</div>

For context, a typical workflow for me, using a Pluto or Jupyter notebook, looks like this Read in some data / create some initial data Do some processing Plot some intermediate results Do some more processing Plot fin…

---

## [Namespacing of methods](https://discourse.julialang.org/t/namespacing-of-methods/72677)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 8\
**Last updated:** [December 7, 2021, 1:34am UTC](https://discourse.julialang.org/t/namespacing-of-methods/72677 "2021-12-07T01:34:30Z")

</div>

After a couple of months of using Julia, I’m still a little confused about how methods interact with packages/namespaces. That is, situations where a package adds additional methods to a function originally defined in an…

---

## [UsingMerge: merge method definitions when using a package](https://discourse.julialang.org/t/usingmerge-merge-method-definitions-when-using-a-package/61885)

<div class="topic-metadata">

**Author:** [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Replies:** 0\
**Last updated:** [May 26, 2021, 8:40pm UTC](https://discourse.julialang.org/t/usingmerge-merge-method-definitions-when-using-a-package/61885 "2021-05-26T20:40:37Z")

</div>

This package (now registered) exports a single macro @usingmerge which differs from using in that it “merges” the exported definitions automatically. The wish for this started in this thread. At the time I was v…

---

## [Namespace problems when running Optim in parallel?](https://discourse.julialang.org/t/namespace-problems-when-running-optim-in-parallel/2275)

<div class="topic-metadata">

**Author:** [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Replies:** 2\
**Last updated:** [November 5, 2021, 10:11am UTC](https://discourse.julialang.org/t/namespace-problems-when-running-optim-in-parallel/2275 "2021-11-05T10:11:33Z")

</div>

Hi, I keep running into errors such as: ERROR: LoadError: On worker 2: MethodError: no method matching minimizer(::Optim.MultivariateOptimizationResults{Float64,1,Optim.NewtonTrustRegion{Float64}}) or, the comical E…

---

## [Namespace with lexical access](https://discourse.julialang.org/t/namespace-with-lexical-access/68010)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 1\
**Last updated:** [September 10, 2021, 9:46pm UTC](https://discourse.julialang.org/t/namespace-with-lexical-access/68010 "2021-09-10T21:46:50Z")

</div>

I often want to use a namespace for calculating stuff like this FOO = 1 namespace A x = FOO + 1 end This is almost like a module except modules need to import names from the enclosing lexical module, which can be inco…

---

## [How to properly bring in a module and use its namespace](https://discourse.julialang.org/t/how-to-properly-bring-in-a-module-and-use-its-namespace/66999)

<div class="topic-metadata">

**Author:** [@Tyler\_Ingebrand](https://discourse.julialang.org/u/Tyler_Ingebrand)\
**Replies:** 8\
**Last updated:** [August 27, 2021, 5:26pm UTC](https://discourse.julialang.org/t/how-to-properly-bring-in-a-module-and-use-its-namespace/66999 "2021-08-27T17:26:17Z")

</div>

Hello, Julia noob here. I am trying to take some code that worked in a previous version of Julia (0.6 I think?) and get it working in the current version (1.6.2). The problem I am having is in the previous version, they …

---

## [Opinions for exporting common names](https://discourse.julialang.org/t/opinions-for-exporting-common-names/64995)

<div class="topic-metadata">

**Author:** [@DrChainsaw](https://discourse.julialang.org/u/DrChainsaw)\
**Replies:** 29\
**Last updated:** [July 23, 2021, 11:38am UTC](https://discourse.julialang.org/t/opinions-for-exporting-common-names/64995 "2021-07-23T11:38:36Z")

</div>

As title says, what are your favourite ways to deal with functions/types which are central to the functionality of a package but for which the best name carry a high risk of collisions? Concrete examples in my case are f…

---

## [Is \`using Package: function\` supposed to save precompile time, or just prevent namespace collisions?](https://discourse.julialang.org/t/is-using-package-function-supposed-to-save-precompile-time-or-just-prevent-namespace-collisions/64898)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 1\
**Last updated:** [July 19, 2021, 4:50am UTC](https://discourse.julialang.org/t/is-using-package-function-supposed-to-save-precompile-time-or-just-prevent-namespace-collisions/64898 "2021-07-19T04:50:09Z")

</div>

I often import a package even though I am only planning on using one or two functions from it: julia\> @time using Distributions 1.420353 seconds (1.77 M allocations: 113.360 MiB, 0.27% compilation time) I am thinking…

---

## [Functions from different modules with the same name](https://discourse.julialang.org/t/functions-from-different-modules-with-the-same-name/61505)

<div class="topic-metadata">

**Author:** [@pg261](https://discourse.julialang.org/u/pg261)\
**Replies:** 16\
**Last updated:** [May 20, 2021, 1:03pm UTC](https://discourse.julialang.org/t/functions-from-different-modules-with-the-same-name/61505 "2021-05-20T13:03:32Z")

</div>

Hi ! I have a problem which I thought should never happen with Julia. The result is even worse when using Pluto. I use two modules, which have a function with the same name, but taking parameters of different types. I …

---

## [How namespace of Base.Iterators works](https://discourse.julialang.org/t/how-namespace-of-base-iterators-works/58854)

<div class="topic-metadata">

**Author:** [@Tbl](https://discourse.julialang.org/u/Tbl)\
**Replies:** 6\
**Last updated:** [April 9, 2021, 12:44pm UTC](https://discourse.julialang.org/t/how-namespace-of-base-iterators-works/58854 "2021-04-09T12:44:49Z")

</div>

I like to code using more functional-like style working with iterators, so Base.Iterators comes in handy, but I have problem understanding how its namespace is structured. It is part of the Base, yet it is not by defau…

---

## [Excessive namespace using @reexport](https://discourse.julialang.org/t/excessive-namespace-using-reexport/56823)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 3\
**Last updated:** [March 11, 2021, 1:07pm UTC](https://discourse.julialang.org/t/excessive-namespace-using-reexport/56823 "2021-03-11T13:07:18Z")

</div>

Hi, I’m writing a module that makes use of the Distributions package. Its API has arguments that are Distribution types. So in order to be used in another environment, it is practically mandatory that the Distributions …

---

## [Modules and namespaces](https://discourse.julialang.org/t/modules-and-namespaces/45027)

<div class="topic-metadata">

**Author:** [@Holdmycoffee](https://discourse.julialang.org/u/Holdmycoffee)\
**Replies:** 6\
**Last updated:** [August 16, 2020, 9:36pm UTC](https://discourse.julialang.org/t/modules-and-namespaces/45027 "2020-08-16T21:36:28Z")

</div>

Hey everyone, so I have a weird namespace issue. I import a struct “parameter” into a module QuadratureTypes, then import a function which takes an instance of parameter as input from QadratureTypes into another module, …

---

## [Julep: Taking multiple dispatch,export,import,binary compilation seriously](https://discourse.julialang.org/t/julep-taking-multiple-dispatch-export-import-binary-compilation-seriously/10882)

<div class="topic-metadata">

**Author:** [@TsurHerman](https://discourse.julialang.org/u/TsurHerman)\
**Replies:** 120\
**Last updated:** [May 18, 2018, 6:56pm UTC](https://discourse.julialang.org/t/julep-taking-multiple-dispatch-export-import-binary-compilation-seriously/10882 "2018-05-18T18:56:14Z")

</div>

I want to formalize a julep for a design idea, I am asking the help of the community , please read and criticise freely. The problems it is addressing: Type piracy: It is too easy to break code in module M, even with…

---

## [Function name conflict: ADL / function merging?](https://discourse.julialang.org/t/function-name-conflict-adl-function-merging/10335)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 212\
**Last updated:** [April 30, 2018, 11:26pm UTC](https://discourse.julialang.org/t/function-name-conflict-adl-function-merging/10335 "2018-04-30T23:26:44Z")

</div>

Is there any reason why Julia needs me to fully qualify the function name when the argument types are clear and there shouldn’t be any problem with multiple dispatch? Case 1: load JuliaDB before defining Foo julia\> usi…

---

## [CxxWrap namespace rename](https://discourse.julialang.org/t/cxxwrap-namespace-rename/3754)

<div class="topic-metadata">

**Author:** [@barche](https://discourse.julialang.org/u/barche)\
**Replies:** 1\
**Last updated:** [May 16, 2017, 11:01pm UTC](https://discourse.julialang.org/t/cxxwrap-namespace-rename/3754 "2017-05-16T23:01:27Z")

</div>

Hi all, Following @SylvainCorlay 's work, we are thinking of splitting off the C++ part of CxxWrap into a separate C++ project. This would simplify things for e.g. Linux distributions, where the binaries could be distri…
