Lineinfo added by the parser and debugmode



Aside from Emacs, sometimes Maxima
can display a stack trace and file line numbers when it runs
into an error. The Maxima debugger isn't very strong, but I'd
like to try to preserve at least that functionality, and omitting
the line number information would make that unavailable.

I agree that it's a nuisance to have the debug info in the
car of expressions. My advice is to move the annotations
to a symbol property.

best,

Robert Dodier


On 7/2/11, Dieter Kaiser <drdieterkaiser at web.de> wrote:
> When reading from a file, the parser adds a lineinfo to each expression.
> This can be seen, when tracing the function add-lineinfo:
>
> (%i1) load(ntrig);
>   0: (ADD-LINEINFO ($LOAD))
>   0: ADD-LINEINFO returned ($LOAD)
>   0: (ADD-LINEINFO (DISPLAYINPUT))
>   0: ADD-LINEINFO returned (DISPLAYINPUT)
>   0: (ADD-LINEINFO ($EVAL_WHEN))
>   0: ADD-LINEINFO returned
>        ($EVAL_WHEN
>         (1 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac"
> SRC))
>   0: (ADD-LINEINFO (MLIST))
>   0: ADD-LINEINFO returned
>        (MLIST
>         (1 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac"
> SRC))
>   0: (ADD-LINEINFO ($MATCHDECLARE))
>   0: ADD-LINEINFO returned
>        ($MATCHDECLARE
>         (2 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac"
> SRC))
>   0: (ADD-LINEINFO (NODISPLAYINPUT))
>   0: ADD-LINEINFO returned
>        (NODISPLAYINPUT
>         (2 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac"
> SRC))
>   0: (ADD-LINEINFO ($TELLSIMPAFTER))
>   0: ADD-LINEINFO returned
>        ($TELLSIMPAFTER
>         (4 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac"
> SRC))
>   0: (ADD-LINEINFO (%SIN))
>   0: ADD-LINEINFO returned
>        (%SIN
>         (4 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac"
> SRC))
>
> [...]
> (%o1)     /usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac
>
> I think, this information is only used within the editor Emacs to jump
> into the file to debug the code.
>
> I would like to suggest to add the lineinfo only, if the option variable
> DEBUGMODE has the value TRUE. This can be done in the function
> ADD-LINEINFO. This way the option variable gets additional
> functionality. The standard value of the option variable DEBUGMODE is
> FALSE and we do not add unnecessary information to each expression.
>
> This is an example, when loading a file without adding a lineinfo to
> each expression:
>
> (%i1) :lisp (trace add-lineinfo)
> (ADD-LINEINFO)
> (%i1) load(ntrig);
>   0: (ADD-LINEINFO ($LOAD))
>   0: ADD-LINEINFO returned ($LOAD)
>   0: (ADD-LINEINFO (DISPLAYINPUT))
>   0: ADD-LINEINFO returned (DISPLAYINPUT)
>   0: (ADD-LINEINFO ($EVAL_WHEN))
>   0: ADD-LINEINFO returned ($EVAL_WHEN)
>   0: (ADD-LINEINFO (MLIST))
>   0: ADD-LINEINFO returned (MLIST)
>   0: (ADD-LINEINFO ($MATCHDECLARE))
>   0: ADD-LINEINFO returned ($MATCHDECLARE)
>   0: (ADD-LINEINFO (NODISPLAYINPUT))
>   0: ADD-LINEINFO returned (NODISPLAYINPUT)
>   0: (ADD-LINEINFO ($TELLSIMPAFTER))
>   0: ADD-LINEINFO returned ($TELLSIMPAFTER)
>   0: (ADD-LINEINFO (%SIN))
>   0: ADD-LINEINFO returned (%SIN)
>
> Dieter Kaiser
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>