From a07d17e81aa9c72f679d7cf3388d31bdd32ba7cf Mon Sep 17 00:00:00 2001
From: Tim Daly <daly@axiom-developer.org>
Date: Thu, 22 Jan 2015 01:37:08 -0500
Subject: books/bookvol5 remove $undoFlag and rename functions

---
 books/bookvol5.pamphlet        |   60 ++++++++++++++--------------------------
 changelog                      |    2 +
 patch                          |    2 +-
 src/axiom-website/patches.html |    2 +
 4 files changed, 26 insertions(+), 40 deletions(-)

diff --git a/books/bookvol5.pamphlet b/books/bookvol5.pamphlet
index bfce3ed..1001ae5 100644
--- a/books/bookvol5.pamphlet
+++ b/books/bookvol5.pamphlet
@@ -987,17 +987,6 @@ The \verb|$previousBindings| is a copy of the
 compute the delta(i)s stored in \verb|$frameRecord|.
 
 \section{Initial Undo Variables}
-\begin{verbatim}
-$undoFlag := true     --Default setting for undo is "on"
-$frameRecord  := nil  --Initial setting for frame record
-$previousBindings := nil
-\end{verbatim}
-
-\defdollar{undoFlag}
-\begin{chunk}{initvars}
-(defvar |$undoFlag| t "t means we record undo information")
-
-\end{chunk}
 
 \defdollar{frameRecord}
 \begin{chunk}{initvars}
@@ -1096,7 +1085,7 @@ $previousBindings := nil
  (let (tmp1 tmp2 systemDelta lastTailSeen env)
  (declare (special |$IOindex| |$InteractiveFrame| |$frameRecord|))
   (|writeInputLines| '|redo| (spaddifference |$IOindex| m))
-  (|recordFrame| '|normal|)
+  (recordFrame 'normal)
   (setq env (copy (caar |$InteractiveFrame|)))
   (do ((i 0 (1+ i)) (framelist |$frameRecord| (cdr framelist)))
       ((or (> i m) (atom framelist)) nil)
@@ -6814,10 +6803,10 @@ and the empty string.
                     <10 (PUT 0)
                     10> (|processInteractive1| 1 
                         ((|integer| (|posn| (0 "1" 1 1 "strings") . 0)) . "1"))
-                    11> (|recordFrame| |system|)
+                    11> (recordFrame |system|)
                     12> (|diffAlist| NIL NIL)
                     <12 (|diffAlist| NIL)
-                    <11 (|recordFrame| NIL)
+                    <11 (recordFrame NIL)
                     11> (GETL |other| |TimeTotal|)
                     <11 (GETL 0.0)
                     11> (GETL |gc| |TimeTotal|)
@@ -8415,11 +8404,11 @@ PositiveInteger
                     <13 (|printTypeAndTimeNormal| NIL)
                     <12 (|printTypeAndTime| NIL)
                     <11 (|recordAndPrint| |done|)
-                    11> (|recordFrame| |normal|)
+                    11> (recordFrame |normal|)
                     12> (|diffAlist| 
                          ((% (|value| (|PositiveInteger|) . 1))) NIL)
                     <12 (|diffAlist| ((% (|value|))))
-                    <11 (|recordFrame| ((% (|value|))))
+                    <11 (recordFrame ((% (|value|))))
                     11> (GETL |print| |TimeTotal|)
                     <11 (GETL 0.0)
                     11> (GETL |gc| |TimeTotal|)
@@ -10171,14 +10160,14 @@ This calls the analysis and output printing routines
  (let (|$e| object)
  (declare (special |$e| |$ProcessInteractiveValue| |$InteractiveFrame|))
   (setq |$e| |$InteractiveFrame|)
-  (|recordFrame| '|system|)
+  (recordFrame 'system)
   (|startTimingProcess| '|analysis|)
   (setq object (|interpretTopLevel| form posnForm))
   (|stopTimingProcess| '|analysis|)
   (|startTimingProcess| '|print|)
   (unless |$ProcessInteractiveValue|
     (|recordAndPrint| (|objValUnwrap| object) (|objMode| object)))
-  (|recordFrame| '|normal|)
+  (recordFrame 'normal)
   (|stopTimingProcess| '|print|)
   object))
 
@@ -41170,32 +41159,31 @@ Calls evaluateType on a signature.
 \calls{recordFrame}{diffAlist}
 \calls{recordFrame}{seq}
 \calls{recordFrame}{exit}
-\usesdollar{recordFrame}{undoFlag}
 \usesdollar{recordFrame}{frameRecord}
 \usesdollar{recordFrame}{InteractiveFrame}
 \usesdollar{recordFrame}{previousBindings}
 \begin{chunk}{defun recordFrame}
-(defun |recordFrame| (systemNormal)
+(defun recordFrame (systemNormal)
  (prog (currentAlist delta)
- (declare (special |$undoFlag| |$frameRecord| |$InteractiveFrame| 
-    |$previousBindings|))
+ (declare (special |$frameRecord| |$InteractiveFrame| |$previousBindings|))
   (return
    (seq
-    (cond 
-     ((null |$undoFlag|) nil)
-     (t 
-       (setq currentAlist (kar |$frameRecord|))
-       (setq delta 
-         (|diffAlist| (caar |$InteractiveFrame|) |$previousBindings|))
-       (cond
-        ((eq systemNormal '|system|)
+     (setq currentAlist (kar |$frameRecord|))
+     (setq delta (|diffAlist| (caar |$InteractiveFrame|) |$previousBindings|))
+     (cond
+        ((eq systemNormal 'system)
           (cond 
            ((null delta)
              (return nil))
            (t
              (setq delta (cons '|systemCommand| delta))))))
-       (setq |$frameRecord| (cons delta |$frameRecord|))
-       (setq |$previousBindings|
+     (setq |$frameRecord| (cons delta |$frameRecord|))
+     ; copy all but the individual properties
+     ; note that this loop makes no sense. In boot it read:
+     ; [cons(first x, [cons(first y,rest y) for y in rest x]) for x 
+     ;  in caar $InteractiveFrame
+     ; ... but cons(first y, rest y) == y
+     (setq |$previousBindings|
         (prog (tmp0)
          (setq tmp0 nil)
          (return
@@ -41220,7 +41208,7 @@ Calls evaluateType on a signature.
                     (exit
                      (setq tmp2 (cons (cons (car y) (cdr y)) tmp2))))))))
                 tmp0))))))))
-       (car |$frameRecord|))))))) 
+     (first |$frameRecord|)))))
 
 \end{chunk}
 
@@ -61851,7 +61839,6 @@ top\_level                   &                     & runspad \\
 \$quitTag                    &                     & runspad \\
 \$useInternalHistoryTable    & initvars            & initHist \\
                              & setHistoryCore      & setHistoryCore \\
-\$undoFlag                   & initvars            & recordFrame \\
 \end{tabular}
 
 \subsection{\$boot}
@@ -62003,11 +61990,6 @@ It appears that it can be thrown somewhere below ncTopLevel.
 The \verb|$useInternalHistoryTable| variable is set at load time by a call to
 initvars to a value of NIL. It is part of the history mechanism.
 
-\subsection{\$undoFlag}
-The \verb|$undoFlag| is used in recordFrame to decide whether to do
-undo recording. It is initially set to T in initvars.
-This is part of the undo mechanism.
-
 \eject
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Signatures}
diff --git a/changelog b/changelog
index a97a6cf..e925071 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20150122 tpd src/axiom-website/patches.html 20150122.02.tpd.patch
+20150122 tpd books/bookvol5 remove $undoFlag and rename functions
 20150122 tpd src/axiom-website/patches.html 20150122.01.tpd.patch
 20150122 tpd books/bookvol13 update the proof volume
 20150121 tpd src/axiom-website/patches.html 20150121.02.tpd.patch
diff --git a/patch b/patch
index 9e364c1..e9fbb2e 100644
--- a/patch
+++ b/patch
@@ -1,2 +1,2 @@
-books/bookvol13 update the proof volume
+books/bookvol5 remove $undoFlag and rename functions
 
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index b9732dd..e7651e2 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -4968,6 +4968,8 @@ src/input/bitcoin.input add additional information<br/>
 books/bookvol10.3 add Hex String to Integer conversion<br/>
 <a href="patches/20150122.01.tpd.patch">20150122.01.tpd.patch</a>
 books/bookvol13 update the proof volume<br/>
+<a href="patches/20150122.02.tpd.patch">20150122.02.tpd.patch</a>
+books/bookvol5 remove $undoFlag and rename functions<br/>
  </body>
 </html>
 
-- 
1.7.5.4

