Skip to content

Commit

Permalink
fixed an issue in (package, Symbol)
Browse files Browse the repository at this point in the history
Before this, after debug Core, documentableMethods would fail.
  • Loading branch information
mahrud committed Aug 2, 2024
1 parent 7bee6fd commit 5c94d17
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions M2/Macaulay2/m2/packages.m2
Original file line number Diff line number Diff line change
Expand Up @@ -542,20 +542,12 @@ package Thing := x -> if (d := dictionary x) =!
package Symbol := s -> (
if instance(value s, Package) then return value s;
n := toString s;
r := scan(values PackageDictionary, pkg ->
if (pkg = value pkg).?Dictionary and pkg.Dictionary#?n and pkg.Dictionary#n === s then break pkg);
if r =!= null then return r;
scan(dictionaryPath, d -> if d#?n and d#n === s then if package d =!= null then break package d))
scan(dictionaryPath, dict -> if dict#?n and dict#n === s then break package dict))
package Function :=
package HashTable := x -> if hasAttribute(x, ReverseDictionary) then package getAttribute(x, ReverseDictionary)
package Dictionary := d -> (
if currentPackage =!= null
and ( currentPackage.?Dictionary
and currentPackage.Dictionary === d
or currentPackage#?"private dictionary"
and currentPackage#"private dictionary" === d) then currentPackage
else scan(values PackageDictionary, pkg ->
if (pkg = value pkg).?Dictionary and pkg.Dictionary === d then break pkg))
scan(unique prepend_currentPackage loadedPackages,
pkg -> if pkg.Dictionary === d or pkg#"private dictionary" === d then break pkg))

-- TODO: should this reset the values of exported mutable symbols?
use Package := pkg -> (
Expand Down

0 comments on commit 5c94d17

Please sign in to comment.