Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
347 stars 231 forks source link

'help "RingElement"' fails after defining a polynomial ring #963

Closed jkyang92 closed 3 years ago

jkyang92 commented 5 years ago

From the command line, running the following sequence

QQ[x]
help "RingElement"

Produces the following error

stdio:2:1:(3): error: makeDocumentTag: package cannot be determined: 'o1' : here is the first use of 'o1'

Poking around in the documentation code suggests that this error occurs when trying to populate the "Types of ring element" subsection in the documentation, since o1 is now an subtype of the RingElement type, but the code can't figure out what package o1 is from.

Amusingly, if you instead run,

QQ[x]
o1 = null
help "RingElement"

there is no error, and both oo and ooo show up in the the "Types of ring element", which seems odd since it would suggest that the documentation code is perfectly happy with oo and ooo, but not o1.

DanGrayson commented 5 years ago

Thanks! That's a bug.

+ M2 --no-readline --print-width 111
Macaulay2, version 1.14
--loading configuration for package "FourTiTwo" from file /Users/dan/Library/Application Support/Macaulay2/init-FourTiTwo.m2
--loading configuration for package "Topcom" from file /Users/dan/Library/Application Support/Macaulay2/init-Topcom.m2
with packages: ConwayPolynomials, Elimination, IntegralClosure, InverseSystems, LLLBases, PrimaryDecomposition,
               ReesAlgebra, TangentCone, Truncations

i1 : QQ[x]

o1 = QQ[x]

o1 : PolynomialRing

i2 : help "RingElement"
stdio:2:1:(3): error: makeDocumentTag: package cannot be determined: 'o1'
: here is the first use of 'o1'

i3 : errorDepth = 0

o3 = 0

i4 : help "RingElement"
/Applications/Macaulay2-1.14/share/Macaulay2/Core/debugging.m2:20:6:(1):[14]: error: makeDocumentTag: package cannot be determined: 'o1'
: here is the first use of 'o1'
/Applications/Macaulay2-1.14/share/Macaulay2/Core/debugging.m2:20:6:(1):[14]: --entering debugger (type help to see debugger commands)
/Applications/Macaulay2-1.14/share/Macaulay2/Core/debugging.m2:20:6-20:27: --source code:
     olderror processArgs args)

ii5 : 
/Applications/Macaulay2-1.14/share/Macaulay2/Core/document.m2:171:27:(1):[13]: --entering debugger (type help to see debugger commands)
/Applications/Macaulay2-1.14/share/Macaulay2/Core/document.m2:171:27-171:84: --source code:
     if pkg === null then error("makeDocumentTag: package cannot be determined: ", nkey);

ii6 : 
/Applications/Macaulay2-1.14/share/Macaulay2/Core/methods.m2:105:83:(1):[12]: --entering debugger (type help to see debugger commands)
/Applications/Macaulay2-1.14/share/Macaulay2/Core/methods.m2:105:83-106:89: --source code:
               if f === null then noMethodSingle(methodFunction,arg,outputs) else (f o) arg
               );

ii7 : 
/Applications/Macaulay2-1.14/share/Macaulay2/Core/option.m2:15:8:(1):[11]: --entering debugger (type help to see debugger commands)
/Applications/Macaulay2-1.14/share/Macaulay2/Core/option.m2:15:8-17:34: --source code:
       uncurry(f, override (opts,args))
       )
  )

ii8 : 
/Applications/Macaulay2-1.14/share/Macaulay2/Core/document.m2:792:10:(1):[10]: --entering debugger (type help to see debugger commands)
/Applications/Macaulay2-1.14/share/Macaulay2/Core/document.m2:792:10-792:37: --source code:
     i = makeDocumentTag(i,Package=>null);

ii9 : i

oo9 = o1

ii10 : 
/Applications/Macaulay2-1.14/share/Macaulay2/Core/classes.m2:44:52:(1):[9]: --entering debugger (type help to see debugger commands)
/Applications/Macaulay2-1.14/share/Macaulay2/Core/classes.m2:44:52-44:60: --source code:
Function  \ VisibleList := VisibleList => (f,v) -> apply(v,f)

ii11 : 
/Applications/Macaulay2-1.14/share/Macaulay2/Core/document.m2:808:61:(1):[8]: --entering debugger (type help to see debugger commands)
/Applications/Macaulay2-1.14/share/Macaulay2/Core/document.m2:808:50-808:70: --source code:
smenu      := s -> ul (last \ sort \\ nonnull \\ optTO      \ toList s)

ii12 : 
/Applications/Macaulay2-1.14/share/Macaulay2/Core/document.m2:1226:11:(1):[7]: --entering debugger (type help to see debugger commands)
/Applications/Macaulay2-1.14/share/Macaulay2/Core/document.m2:1226:11-1226:93: --source code:
     b := smenu(toString \ select(syms, y -> instance(value y, Type) and parent value y === X));

ii13 : (toString \ select(syms, y -> instance(value y, Type) and parent value y === X))

oo13 = {oooo, o1}

oo13 : List

ii14 : s

oo14 = RingElement

oo14 : Symbol

ii15 : X

oo15 = RingElement

oo15 : Type
DanGrayson commented 5 years ago

By the way, the symbols oo and ooo belong to the package Core, so that explains the differing behavior.