File: locate-doc.m2

package info (click to toggle)
macaulay2 1.25.05%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 172,152 kB
  • sloc: cpp: 107,824; ansic: 16,193; javascript: 4,189; makefile: 3,899; lisp: 702; yacc: 604; sh: 476; xml: 177; perl: 114; lex: 65; python: 33
file content (58 lines) | stat: -rw-r--r-- 1,566 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
--- status: moved February 2021
--- author(s):
--- notes:

doc ///
Node
  Key
    locate
   (locate, Symbol)
   (locate, Sequence)
   (locate, Pseudocode)
   (locate, Function)
   (locate, FunctionBody)
   (locate, Command)
   (locate, Nothing)
   (locate, Package)
   (locate, List)
   (locate, ZZ)
  Headline
    locate source code
  Usage
    locate f
  Inputs
    x:{Function,Sequence,Symbol,List,ZZ}
  Outputs
    :{FilePosition,List,Nothing}
      {\tt {filename, start,startcol, stop,stopcol, pos,poscol}}, respectively
  Description
    Text
      For a symbol interpreted function {\tt f}, returns a {\tt FilePosition{n,i,c,j,d,k,e}}
      describing the location of the definition in the source code:
    Tree
      :The name of the source file is {\tt n};
      :the code occupies line {\tt i} column {\tt c} through line {\tt j} column {\tt d};
      :the central point of interest located at line {\tt k} column {\tt e}.
    Example
      locate needs
      code needs
    Text
      If {\tt f} is a sequence, then @TO "lookup"@ is applied first,
      and the location of the resulting function is provided.
    Example
      locate(jacobian, Matrix)
    Text
      In particular, the output of @TO "methods"@ can be used as an input to @TT "locate"@.
    Example
      locate methods jacobian
      methods doc
      locate 0
      peek oo
    Text
      If the function {\tt f} is compiled, or if {\tt f} is @TO "null"@,
      then a location is not available and @TO "null"@ is returned.
  SeeAlso
    code
    methods
    (locate, DocumentTag)
///