1
指這一段:Pkg.installed(「anInvalidPackage」)應該什麼都不返回或拋出錯誤?
installed(pkg) → Void | VersionNumber
If pkg is installed, return the installed version number, otherwise return nothing.
Pkg.installed("anInvalidPackage")
函數返回nothing
但它拋出一個錯誤:
julia> VERSION
v"0.5.0"
julia> Pkg.installed("anInvalidPackage")
ERROR: anInvalidPackage is not a package (not registered or installed)
in installed(::String) at .\pkg\entry.jl:123
in (::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#installed,Tuple{String}})
() at .\pkg\dir.jl:31
in cd(::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#installed,Tuple{String}
}, ::String) at .\file.jl:48
in #cd#1 at .\pkg\dir.jl:31
in installed(::String) at .\pkg\pkg.jl:129
編輯:issue
奇怪,怎麼去掉 「的」 從字符串... 「 – daycaster
@daycaster錯字 –
」那麼,沃森,這是消除了這一線的調查!「 :) – daycaster