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

disassemble -- disassemble pseudocode or a function

Synopsis

Description

i1 : disassemble res

o1 = (function restargs: true numparms: 1 framesize: 1 frameID: 188 (adjacent
     (global-fetch 333) (sequence (fetch 1 1) (adjacent (global-fetch 290)
     (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 = /usr/share/Macaulay2/Macaulay2Doc/demo1.m2:11:7-14:8: --source code:
     g = y -> (
          c := f(y-1);
          d := f(y-2);
          c+d)
i4 : g 2
/usr/share/Macaulay2/Macaulay2Doc/demo1.m2:8:12:(3):[2]: error: division by zero
/usr/share/Macaulay2/Macaulay2Doc/demo1.m2:8:12:(3):[2]: --entering debugger (type help to see debugger commands)
/usr/share/Macaulay2/Macaulay2Doc/demo1.m2:8:11-8:13: --source code:
     b := 1/x;
ii5 : code current

oo5 = /usr/share/Macaulay2/Macaulay2Doc/demo1.m2:8:11-8:13:
           b := 1/x;
      -----------------------------------------------------------------------
      --source code:
ii6 : disassemble current

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

See also

For the programmer

The object disassemble is a compiled function.