next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc :: disassemble

disassemble -- disassemble pseudocode or a function

Synopsis

Description

i1 : disassemble res

o1 = (function restargs: true numparms: 1 framesize: 1 frameID: 192 (adjacent
     (global-fetch 328) (sequence (fetch 1 1) (adjacent (global-fetch 285)
     (sequence (fetch 0 1) (fetch 0 0))))))

It may be useful to disassemble code during debugging, as in the following demonstration.

i2 : load "Macaulay2Doc/demo1.m2"
i3 : code g

o3 = /home2/dan/src/M2/M2/Macaulay2/packages/Macaulay2Doc/demo1.m2:11:7-14:8: --source code:
     g = y -> (
          c := f(y-1);
          d := f(y-2);
          c+d)
i4 : g 2
/home2/dan/src/M2/M2/Macaulay2/packages/Macaulay2Doc/demo1.m2:8:12:(3):[2]: error: division by zero
/home2/dan/src/M2/M2/Macaulay2/packages/Macaulay2Doc/demo1.m2:8:12:(3):[2]: --entering debugger (type help to see debugger commands)
/home2/dan/src/M2/M2/Macaulay2/packages/Macaulay2Doc/demo1.m2:8:11-8:13: --source code:
     b := 1/x;
ii5 : code current

oo5 = /home2/dan/src/M2/M2/Macaulay2/packages/Macaulay2Doc/demo1.m2:8:11-8:13
           b := 1/x;
      -----------------------------------------------------------------------
      : --source code:
ii6 : disassemble current

oo6 = (2-OP / 1 (fetch 0 0))

See also