Encapsulation of Julia's code. Is this a good idea?

Is it common for Julia users to encapsulate functionality in their own modules using the module keyword?

I looked at the modules, and they seem to be using more than they actually are, using the module keyword for parts of the code.

What is the best way?

+3
source share
1 answer

Julia has 3 levels of "Places where you can put the code"

  • include 'd
  • Submodules
  • packages that for our purposes have exactly 1 (non-sub) module.

I use a big fan of submodules, given that I came from python.

. , , , , . . include s.

Python , - " , ". - julia - , ( )

, . , ? ( )

, , :

, :

 - module A
     - module B (i.e A.B)
         - type C 

, using A.B
using B, B, , B.jl LOAD_PATH. , C. using A.B, A.B.C, B.C(). using B, B.C() B.C. , ( using) A.B.C. .

reload("A.B") . ( reload )


Base julia-, , . .

, , , , . , .

+6

Source: https://habr.com/ru/post/1659212/


All Articles