सरल कोड bellow प्रिंटआउट होगा की आवश्यकता है-से एक के लिए परिणाम पैकेज:
whorequires(pkgname) = whorequires(pkgname, 0);
function whorequires(pkgname, i)
deps = Pkg.dependents(pkgname);
[print('-') for j=1:i];
println(pkgname);
length(deps) > 0 && [whorequires(dep,i+1) for dep in deps];
end
julia> whorequires("JuliaParser");
JuliaParser
-CodeTools
--Atom
-ASTInterpreter
--Gallium
-Jewel
संपादित
whorequires(pkgname) = whorequires(pkgname, 0, Dict{ASCIIString,Vector{ASCIIString}}());
function whorequires(pkgname, i, m)
[print('-') for j=1:i];
if (haskey(m,pkgname))
println("$pkgname *[duplicated]* is required by ", length(m[pkgname]), " packages");
else
println(pkgname);
m[pkgname] = Pkg.dependents(pkgname);
if (length(m[pkgname]) > 0)
for dep in m[pkgname]
whorequires(dep,i+1,m);
end
end
end
end
(@amrods द्वारा टिप्पणी की इस मुद्दे को कवर करने के लिए)
स्रोत
2016-04-15 17:26:51
धन्यवाद @ डेडकास्टर, लेकिन यहां 'आश्रितों()' के बारे में कुछ भी क्यों नहीं है [http://docs.julialang.org/en/release-0.4/stdlib/pkg/]? –
@RezaAfzalanYes, यह प्रलेखित प्रतीत नहीं होता है। और क्या यह एक बार 'whorequires() 'का अनुचित अनुचित नाम था? :) – daycaster