diff --git a/changelog b/changelog index ca336c0..001a035 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,4 @@ +20071218 acr src/algebra/axserver.spad fix lastType output re: errors 20071217 tpd src/algebra/variable.spad ignore regression test gensym (7041) 20071217 tpd src/algebra/lodo.spad ignore regression test gensym (7042) 20071217 acr src/algebra/mathml.spad fix hex(10) mathml rendering (7015) diff --git a/src/algebra/axserver.spad.pamphlet b/src/algebra/axserver.spad.pamphlet index 77910f1..6862900 100644 --- a/src/algebra/axserver.spad.pamphlet +++ b/src/algebra/axserver.spad.pamphlet @@ -518,18 +518,57 @@ This is done in the call to replace-entitites (see http.lisp) CLOSE(q)$Lisp CLOSE(s)$Lisp +@ +\subsection{lastType} +To examine the \$internalHistoryTable use the following line +\begin{verbatim} + )lisp |$internalHistoryTable| +\end{verbatim} +We need to pick out first member of internalHistoryTable and then pick out +the element with \% as first element. Here is an example showing just +the first element of the list, which correponds to the last command. + +Note that the last command does not necessarily correspond to the last +element of the first element of \$internalHistoryTable as it is in this +example. +\begin{verbatim} + ( + (4 NIL + (x (value (BasicOperator) WRAPPED . #)) + (y (value (BasicOperator) WRAPPED . #)) + (% (value (Matrix (Polynomial (Integer))) WRAPPED . #)) + ) + ... + ) +\end{verbatim} +We also need to check for input error in which case the \$internalHistoryTable +is not changed and the type retrieved would be that for the last correct +input. +<>= lastType():String == --- The last history entry is the first item in the $internalHistoryTable --- list so car(_$internalHistoryTable$Lisp) selects it. Here's an example: --- (3 (x+y)**3 (% (value (Polynomial (Integer)) --- WRAPPED 1 y (3 0 . 1) (2 1 x (1 0 . 3)) (1 1 x (2 0 . 3)) --- (0 1 x (3 0 . 1))))) --- This corresponds to the input "(x+y)**3" being issued as the third --- command after starting axiom. --- The following line selects the type information. - string car(cdr(car(cdr(car(cdr(cdr(car(_$internalHistoryTable$Lisp)_ - $Lisp)$Lisp)$Lisp)$Lisp)$Lisp)$Lisp)$Lisp)$Lisp + SETQ(first$Lisp,FIRST(_$internalHistoryTable$Lisp)$Lisp)$Lisp + count:Integer := 0 + hisLength:Integer := LIST_-LENGTH(_$internalHistoryTable$Lisp)$Lisp + length:Integer := LIST_-LENGTH(first$Lisp)$Lisp + -- This initializes stepSav. The test is a bit of a hack, maybe I'll + -- figure out the right way to do it later. + if string stepSav$Lisp = "#" then SETQ(stepSav$Lisp, 0$Lisp)$Lisp + -- If hisLength = 0 then the history table has been reset to NIL + -- and we're starting numbering over + if hisLength = 0 then SETQ(stepSav$Lisp, 0$Lisp)$Lisp + if hisLength > 0 and + car(car(_$internalHistoryTable$Lisp)$Lisp)$Lisp ^= stepSav$Lisp then + SETQ(stepSav$Lisp,car(car(_$internalHistoryTable$Lisp)$Lisp)$Lisp)$Lisp + while count < length repeat + position(char "%",string FIRST(first$Lisp)$Lisp) = 2 => + count := length+1 + count := count +1 + SETQ(first$Lisp,REST(first$Lisp)$Lisp)$Lisp + count = length + 1 => + string SECOND(SECOND(FIRST(first$Lisp)$Lisp)$Lisp)$Lisp + "" + lastStep():String == string car(car(_$internalHistoryTable$Lisp)$Lisp)$Lisp