由於在http://julia.readthedocs.org/en/latest/manual/modules/沒有太多有關模塊的信息,我想問一下以下內容。導入一個模塊並在julialang中使用
我想通過ijulia嘗試兩個模塊。這兩個模塊都在我的工作目錄中,名字爲 name-of-files.jul。我會將它們統稱爲module_1.jul和module_2.jul。
module_1.jul使用module_2.jul和我一起
using module_2
加載它在ijulia會議,如果我嘗試
using module_1
給出了一個錯誤。我也試過
include("module_1.jul")
這最後一句話,在執行時,升起一個錯誤,因爲module_1.jul找不到 變量「x」我知道被包含在module_1.jul(在這種情況下,我「裝」了使用包括(「module2.jul」)內module_1.jul
[Julia Wikibook](http://en.wikibooks.org/wiki/Introducing_Julia/Modules_and_packages)中有更多信息 – facuq