Skip to content

rethinking Base.package_list #6873

@StefanKarpinski

Description

@StefanKarpinski

Package list is currently a map from absolute file paths to a floating-point load time:

julia> using DataFrames

julia> Base.package_list
["/Users/stefan/.julia/Reexport/src/Reexport.jl"=>1.400267862075036e9,
 "/Users/stefan/.julia/StatsBase/src/StatsBase.jl"=>1.400267862131899e9,
 "/Users/stefan/.julia/SortingAlgorithms/src/SortingAlgorithms.jl"=>1.400267864475314e9,
 "/Users/stefan/.julia/GZip/src/GZip.jl"=>1.400267864386872e9,
"/Users/stefan/.julia/DataFrames/src/DataFrames.jl"=>1.400267862040832e9,
"/Users/stefan/.julia/DataArrays/src/DataArrays.jl"=>1.400267862631807e9]

This made sense originally, but it's a bit weird now. This should probably be a map from package names to the file that was loaded, maybe paired with its load time. It should also be exported with a name like LOADED (to correspond with LOAD_PATH).

This is coming up now because I want to close the package interactions issue and the natural way to do that would be to have a map from package names to thunks to call and just let the programmer manipulate that map. Something like this:

LOAD_HOOKS["Color"] = function()
  # stuff to do when the Color package is loaded
end

Metadata

Metadata

Labels

designDesign of APIs or of the language itselfpackagesPackage management and loading

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions