Thursday 21 April 2016

Julia: Standard modules

Main, Core and Base are the standard modules.

Main Module
It is top level module, Julia use Main as current module. Variables defined in Julia prompt goes to Main module.

julia> whos()
                          Base  23140 KB     Module : Base
                          Core   2823 KB     Module : Core
                          Main  25733 KB     Module : Main
                           ans      0 bytes  Void : nothing

julia> a=10
10

julia> b=20
20

julia> whos()
                          Base  23242 KB     Module : Base
                          Core   2823 KB     Module : Core
                          Main  25782 KB     Module : Main
                             a      8 bytes  Int64 : 10
                           ans      8 bytes  Int64 : 20
                             b      8 bytes  Int64 : 20

Core module
Core module contains almost all built in identifiers of the language. Every module implicitly specifies this module.

Base Module
It is the standard library for Julia, loaded implicitly by all modules.



Previous                                                 Next                                                 Home

No comments:

Post a Comment