next | previous | forward | backward | up | top | index | toc | directory | Macaulay 2 web site

listLocalSymbols -- display of local symbols and their values

Description

Synopsis

  • Usage:
    listLocalSymbols f
  • Inputs:
  • Outputs:
    • a net, a compact display of the symbols in the local dictionaries attached to the closure f, and their values
i1 : x:=3; y:="hi there"; z:=2^30; f = x->x;
i5 : listLocalSymbols f

o5 = symbol   class     value      location of symbol
     ------   -----     -----      ------------------
     x      : ZZ     -- 3          stdio:1:1-1:1     
     y      : String -- "hi there" stdio:1:7-1:7     
     z      : ZZ     -- 1073741824 stdio:1:22-1:22   
i6 : listLocalSymbols symbol x

o6 = symbol   class     value      location of symbol
     ------   -----     -----      ------------------
     x      : ZZ     -- 3          stdio:1:1-1:1     
     y      : String -- "hi there" stdio:1:7-1:7     
     z      : ZZ     -- 1073741824 stdio:1:22-1:22   

Synopsis

  • Usage:
    listLocalSymbols
  • Outputs:
    • a net, a compact display of the symbols in the local dictionaries attached to current

This usage works only in the debugger, where current has a non-null value.

i7 : load "Macaulay2Doc/demo1.m2"
i8 : g 2
../Macaulay2Doc/demo1.m2:8:12:(1):[2]: error: division by zero
../Macaulay2Doc/demo1.m2:8:12:(1):[2]: --entering debugger (type help to see debugger commands)
../Macaulay2Doc/demo1.m2:8:11-8:13: --source code:
     b := 1/x;
ii9 : listLocalSymbols

oo9 = symbol   class              value                                          location of symbol
      ------   -----              -----                                          ------------------              
      x      : ZZ              -- 0                                              ../Macaulay2Doc/demo1.m2:6:6-6:6
      a      : String          -- "hi there"                                     ../Macaulay2Doc/demo1.m2:7:6-7:6
      b      : Nothing         -- null                                           ../Macaulay2Doc/demo1.m2:8:6-8:6
      f      : FunctionClosure -- {*Function[../Macaulay2Doc/demo1.m2:6:7-9:7]*} ../Macaulay2Doc/demo1.m2:6:1-6:1

Synopsis

  • Usage:
    listLocalSymbols(X,f)
  • Inputs:
  • Outputs:
    • a net, a compact display of the symbols in the local dictionaries attached to the closure f, and their values, provided their values are instances of the type X
ii10 : h := x -> y -> y+1;
ii11 : listLocalSymbols(ZZ,h 11)

oo11 = symbol   class    value location of symbol
       ------   -----    ----- ------------------              
       x      : ZZ    -- 0     ../Macaulay2Doc/demo1.m2:6:6-6:6
       x      : ZZ    -- 11    stdio:2:6-2:6                   

Synopsis

  • Usage:
    listLocalSymbols X
  • Outputs:
    • a net, a compact display of the symbols in the local dictionaries attached to current whose values have type X.

This usage works only in the debugger, where current has a non-null value.

ii12 : load "Macaulay2Doc/demo1.m2"
--warning: function g redefined
ii13 : g 2
../Macaulay2Doc/demo1.m2:8:12:(1):[2]: error: division by zero
../Macaulay2Doc/demo1.m2:8:12:(1):[2]: --entering debugger (type help to see debugger commands)
../Macaulay2Doc/demo1.m2:8:11-8:13: --source code:
     b := 1/x;
iii14 : listLocalSymbols ZZ

ooo14 = symbol   class    value location of symbol
        ------   -----    ----- ------------------              
        x      : ZZ    -- 0     ../Macaulay2Doc/demo1.m2:6:6-6:6

For the programmer

The object listLocalSymbols is a command.