像这样设置一个简单的包扩展:
src/Plotting.jl:
module Plotting
function plot(x::Vector)
# Some functionality for plotting a vector here
end
end # module
ext/PlottingContourExt.jl(也可以在 ext/PlottingContourExt/PlottingContourExt.jl 中):
module PlottingContourExt # Should be same name as the file (just like a normal package)
using Plotting, Contour
function Plotting.plot(c::Contour.ContourCollection)
# Some functionality for plotting a contour here
end
function newfunction()
...
end
end # module
我怎样才能
export
newfunction
?简单地在 export newfunction
模块中添加 PlottingContourExt
似乎不起作用。