Subject: Lineinfo added by the parser and debugmode
From: Dieter Kaiser
Date: Sat, 02 Jul 2011 18:00:44 +0200
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