# \[ANN\] PatModules.jl: a better module system for Julia

**URL:** <https://discourse.julialang.org/t/ann-patmodules-jl-a-better-module-system-for-julia/52226>\
**Category:** Package Announcements\
**Tags:** code-organization\
**Created:** [December 22, 2020, 1:09pm UTC](https://discourse.julialang.org/t/ann-patmodules-jl-a-better-module-system-for-julia/52226 "2020-12-22T13:09:19Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [December 22, 2020, 5:35pm UTC](https://discourse.julialang.org/t/ann-patmodules-jl-a-better-module-system-for-julia/52226/18 "2020-12-22T17:35:15Z")

</div>

> [@patrick-kidger](#):
>
> Still, for those curious, to give an explicit example of the sort of thing that this tries to fix - what is [`OrdinaryDiffEqConstantCache`](https://github.com/SciML/OrdinaryDiffEq.jl/blob/0e38705ac4ace80a51961d689ff64bea6b3bce73/src/nordsieck_utils.jl#L17) here? (From `OrdinaryDiffEq.jl` .)
> 
> It’s just implicitly assumed to exist, but the reader is given no help finding where it comes from. It’s unsurprising to find that this file is `include` d in the wrapping [`OrdinaryDiffEq.jl`](https://github.com/SciML/OrdinaryDiffEq.jl/blob/0e38705ac4ace80a51961d689ff64bea6b3bce73/src/OrdinaryDiffEq.jl#L155), but that doesn’t really help. All we know is that `OrdinaryDiffEqConstantCache` is something else that’s `include` d in the same file, which prompts a bit of a manhunt.

You may be interested to know about this technique to find this out using the REPL

> [@Find packages by function names](https://discourse.julialang.org/t/find-packages-by-function-names/48823/5):
>
> Similarly you can also load the package you are using and ask it where it got something from. Referring to it by qualified name of the scope where you find it. Say I say isposdef being used in the source code of Distributions.jl and i wanted to know where it came from: julia\> using Distributions julia\> @which Distributions.isposdef LinearAlgebra julia\> methods(Distributions.isposdef) # 7 methods for generic function "isposdef": [1] isposdef(D::LinearAlgebra.Diagonal) in LinearAlgebra at /u…

Though I admit having to load a package to ask where something is defines is a bit of a twist, and if you are just reading the code is kind of annoying.  
It’s a fair complaint.  
(Though, I personally prefer it to the trade-off of listing all imports. But I understand others disagree)  
Just thought i would bring up this “trick” of using the REPL to ask where something is defined even if you don’t know the module, as it is I think an under appreciated.

---

_[View the full topic](https://discourse.julialang.org/t/ann-patmodules-jl-a-better-module-system-for-julia/52226)._
