Description
For a symbol interpreted function f, returns a FilePosition{n,i,c,j,d,k,e} describing the location of the definition in the source code:
The name of the source file is n;
the code occupies line i column c through line j column d;
the central point of interest located at line k column e.
i1 : locate needs
o1 = ${prefix}/share/Macaulay2/Core/Core.m2:148:8-148:68
o1 : FilePosition
|
i2 : code needs
o2 = ${prefix}/share/Macaulay2/Core/Core.m2:148:8-148:68: --source
code:
needs = filename -> (loadPath(path, filename, simpleNeeds, notify);)
|
If f is a sequence, then lookup is applied first, and the location of the resulting function is provided.
i3 : locate(jacobian, Matrix)
o3 = ${prefix}/share/Macaulay2/Core/matrix.m2:550:29-550:66
o3 : FilePosition
|
In particular, the output of methods can be used as an input to locate.
i4 : locate methods jacobian
o4 = {0 => (${prefix}/share/Macaulay2/Core/matrix.m2:550:29-550:66) }
{1 => (${prefix}/share/Macaulay2/Core/matrix.m2:551:27-551:62) }
{2 => (${prefix}/share/Macaulay2/Core/matrix.m2:552:34-552:60) }
{3 => (${prefix}/share/Macaulay2/Core/matrix1.m2:512:28-512:56)}
o4 : NumberedVerticalList
|
i5 : methods doc
o5 = {0 => (doc, String)}
o5 : NumberedVerticalList
|
i6 : locate 0
o6 = ${prefix}/share/Macaulay2/SimpleDoc.m2:42:14-49:83
o6 : FilePosition
|
i7 : peek oo
o7 = FilePosition{${prefix}/share/Macaulay2/SimpleDoc.m2,
------------------------------------------------------------------------
42, 14, 49, 83, 42, 14}
|
If the function f is compiled, or if f is null, then a location is not available and null is returned.