It’s definitely not recommended in Julia. Any types or functions defined in that file will be defined twice, and those two definitions will be completely different, despite having the same name. This can lead to confusing situations. For some examples of real-world problems caused by multiple includes, see:
rdeits
13
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Warning: Method definition (::Type{SIM.simulation})() in module SIM at /home/Desktop/myFile.jl:57 overwritten at /home/Desktop/myFile.jl:57 | 5 | 437 | May 31, 2019 | |
| What does `include` do? | 27 | 1756 | October 25, 2024 | |
| How to include my module file as a package? | 24 | 2778 | March 18, 2022 | |
| How to avoid repeatedly calling include()? | 21 | 3263 | February 12, 2021 | |
| Avoiding redefinition of structs | 4 | 851 | September 3, 2019 |