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

current -- the pseudocode that produced an error

Synopsis

Description

Use value to evaluate the code again, for debugging purposes.
i1 : load "Macaulay2Doc/demo1.m2"
i2 : code g

o2 = /usr/share/Macaulay2/Macaulay2Doc/demo1.m2:11:7-14:8: --source code:
     g = y -> (
          c := f(y-1);
          d := f(y-2);
          c+d)
i3 : 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;
ii4 : code current

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

oo5 = (2-OP / 1 (fetch 0 0))
ii6 : value current
/usr/share/Macaulay2/Macaulay2Doc/demo1.m2:8:12:(3): error: division by zero
ii7 : x = 11

oo7 = 11
ii8 : value current

       1
oo8 = --
      11

oo8 : QQ
ii9 : continue

     34
o9 = --
     11

o9 : QQ

For the programmer

The object current is null.