How to define global variables to be shared later in Julia
问题 I have a module in file global.jl which defines a global multidimensional array named "data": module Global export data # GLOBAL DATA ARRAY data = zeros(Int32, 20, 12, 31, 24, 60, 5); end I have a main.jl which uses this global variable: include("global.jl") using .Global println(data[14,1,15,18,0,1]) And I get the following error: $ time /usr/local/julia-1.2.0/bin/julia main.jl ERROR: LoadError: BoundsError: attempt to access 20Ã12Ã31Ã24Ã60Ã5 Array{Int32,6} at index [14, 1, 15, 18, 0, 1]