diff --git a/changelog b/changelog
index 89399dd..dddf97e 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,7 @@
+20090828 tpd src/axiom-website/patches.html 20090828.02.tpd.patch
+20090828 tpd src/interp/Makefile move htcheck.boot to htcheck.lisp
+20090828 tpd src/interp/htcheck.lisp added, rewritten from htcheck.boot
+20090828 tpd src/interp/htcheck.boot removed, rewritten to htcheck.lisp
 20090828 tpd src/axiom-website/patches.html 20090828.01.tpd.patch
 20090828 tpd src/interp/Makefile move package.boot to package.lisp
 20090828 tpd src/interp/package.lisp added, rewritten from package.boot
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 34f97ee..ff338ca 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -1930,5 +1930,7 @@ iterator.lisp rewrite from boot to lisp<br/>
 modemap.lisp rewrite from boot to lisp<br/>
 <a href="patches/20090828.01.tpd.patch">20090828.01.tpd.patch</a>
 package.lisp rewrite from boot to lisp<br/>
+<a href="patches/20090828.02.tpd.patch">20090828.02.tpd.patch</a>
+compiler.lisp rewrite from boot to lisp<br/>
  </body>
 </html>
diff --git a/src/interp/Makefile.pamphlet b/src/interp/Makefile.pamphlet
index c284472..8a6df3b 100644
--- a/src/interp/Makefile.pamphlet
+++ b/src/interp/Makefile.pamphlet
@@ -3905,52 +3905,26 @@ ${MID}/record.lisp: ${IN}/record.lisp.pamphlet
 
 @
 
-\subsection{htcheck.boot}
-<<htcheck.o (AUTO from OUT)>>=
-${AUTO}/htcheck.${O}: ${OUT}/htcheck.${O}
-	@ echo 453 making ${AUTO}/htcheck.${O} from ${OUT}/htcheck.${O}
-	@ cp ${OUT}/htcheck.${O} ${AUTO}
-
-@
+\subsection{htcheck.lisp}
 <<htcheck.o (OUT from MID)>>=
-${OUT}/htcheck.${O}: ${MID}/htcheck.clisp 
-	@ echo 454 making ${OUT}/htcheck.${O} from ${MID}/htcheck.clisp
-	@ (cd ${MID} ; \
+${OUT}/htcheck.${O}: ${MID}/htcheck.lisp
+	@ echo 136 making ${OUT}/htcheck.${O} from ${MID}/htcheck.lisp
+	@ ( cd ${MID} ; \
 	  if [ -z "${NOISE}" ] ; then \
-	   echo '(progn  (compile-file "${MID}/htcheck.clisp"' \
-             ':output-file "${OUT}/htcheck.${O}") (${BYE}))' |  ${DEPSYS} ; \
+	   echo '(progn  (compile-file "${MID}/htcheck.lisp"' \
+             ':output-file "${OUT}/htcheck.${O}") (${BYE}))' | ${DEPSYS} ; \
 	  else \
-	   echo '(progn  (compile-file "${MID}/htcheck.clisp"' \
-             ':output-file "${OUT}/htcheck.${O}") (${BYE}))' |  ${DEPSYS} \
+	   echo '(progn  (compile-file "${MID}/htcheck.lisp"' \
+             ':output-file "${OUT}/htcheck.${O}") (${BYE}))' | ${DEPSYS} \
              >${TMP}/trace ; \
 	  fi )
 
 @
-<<htcheck.clisp (MID from IN)>>=
-${MID}/htcheck.clisp: ${IN}/htcheck.boot.pamphlet
-	@ echo 455 making ${MID}/htcheck.clisp from ${IN}/htcheck.boot.pamphlet
+<<htcheck.lisp (MID from IN)>>=
+${MID}/htcheck.lisp: ${IN}/htcheck.lisp.pamphlet
+	@ echo 137 making ${MID}/htcheck.lisp from ${IN}/htcheck.lisp.pamphlet
 	@ (cd ${MID} ; \
-	   ${TANGLE} ${IN}/htcheck.boot.pamphlet >htcheck.boot ; \
-	  if [ -z "${NOISE}" ] ; then \
-	   echo '(progn (boottran::boottocl "htcheck.boot") (${BYE}))' \
-                | ${DEPSYS} ; \
-	  else \
-	   echo '(progn (boottran::boottocl "htcheck.boot") (${BYE}))' \
-                | ${DEPSYS} >${TMP}/trace ; \
-	  fi ; \
-	  rm htcheck.boot )
-
-@
-<<htcheck.boot.dvi (DOC from IN)>>=
-${DOC}/htcheck.boot.dvi: ${IN}/htcheck.boot.pamphlet 
-	@echo 456 making ${DOC}/htcheck.boot.dvi \
-                  from ${IN}/htcheck.boot.pamphlet
-	@(cd ${DOC} ; \
-	cp ${IN}/htcheck.boot.pamphlet ${DOC} ; \
-	${DOCUMENT} ${NOISE} htcheck.boot ; \
-	rm -f ${DOC}/htcheck.boot.pamphlet ; \
-	rm -f ${DOC}/htcheck.boot.tex ; \
-	rm -f ${DOC}/htcheck.boot )
+	   ${TANGLE} ${IN}/htcheck.lisp.pamphlet >htcheck.lisp )
 
 @
 
@@ -5359,10 +5333,8 @@ clean:
 <<hashcode.clisp (MID from IN)>>
 <<hashcode.boot.dvi (DOC from IN)>>
 
-<<htcheck.o (AUTO from OUT)>>
 <<htcheck.o (OUT from MID)>>
-<<htcheck.clisp (MID from IN)>>
-<<htcheck.boot.dvi (DOC from IN)>>
+<<htcheck.lisp (MID from IN)>>
 
 <<ht-util.o (AUTO from OUT)>>
 <<ht-util.o (OUT from MID)>>
diff --git a/src/interp/htcheck.boot.pamphlet b/src/interp/htcheck.boot.pamphlet
deleted file mode 100644
index 0fa6c18..0000000
--- a/src/interp/htcheck.boot.pamphlet
+++ /dev/null
@@ -1,149 +0,0 @@
-\documentclass{article}
-\usepackage{axiom}
-\begin{document}
-\title{\$SPAD/src/interp htcheck.boot}
-\author{The Axiom Team}
-\maketitle
-\begin{abstract}
-\end{abstract}
-\eject
-\tableofcontents
-\eject
-\section{License}
-<<license>>=
--- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
--- All rights reserved.
---
--- Redistribution and use in source and binary forms, with or without
--- modification, are permitted provided that the following conditions are
--- met:
---
---     - Redistributions of source code must retain the above copyright
---       notice, this list of conditions and the following disclaimer.
---
---     - Redistributions in binary form must reproduce the above copyright
---       notice, this list of conditions and the following disclaimer in
---       the documentation and/or other materials provided with the
---       distribution.
---
---     - Neither the name of The Numerical ALgorithms Group Ltd. nor the
---       names of its contributors may be used to endorse or promote products
---       derived from this software without specific prior written permission.
---
--- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
--- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
--- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
--- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
--- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
--- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
--- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
--- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
--- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
--- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
--- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-@
-<<*>>=
-<<license>>
-
-$primitiveHtCommands := '(
-  ("\ContinueButton"     . 1)
-  ("\andexample"         . 1)
-  ("\autobutt" .    0)
-  ("\autobuttons".  0)
-  ("\begin"  .      1)
-  ("\beginscroll".  0)
-  ("\bound"  .      1)
-  ("\fbox"    .      1)
-  ("\centerline" .      1)
-  ("\downlink" .    2)
-  ("\em"     .      0)
-  ("\end"    .      1)
-  ("\endscroll"  .  0)
-  ("\example"            . 1)
-  ("\free"   .      1)
-  ("\graphpaste" .  1)
-  ("\helppage" .    1)
-  ("\htbmdir"            . 0)
-  ("\htbmfile"   .  1)
-  ("\indent" .      1)
-  ("\inputbitmap"        . 1)
-  ("\inputstring" . 3)
-  ("\item"   .      0)
-  ("\keyword"            . 1)
-  ("\link"               . 2)
-  ("\lispdownlink"       . 2)
-  ("\lispmemolink"       . 2)
-  ("\lispwindowlink"     . 2)
-  ("\menudownlink"       . 2)
-  ("\menuitemstyle"      . 1)
-  ("\menulink"           . 2)
-  ("\menulispdownlink"   . 2)
-  ("\menulispmemolink"   . 2)
-  ("\menulispwindowlink" . 2)
-  ("\menumemolink"       . 2)
-  ("\menuwindowlink"     . 2)
-  ("\newline" .     0)
-  ("\radioboxes" .  3)
-  ("\space"  .      1)
-  ("\spadcommand" . 1)
-  ("\stringvalue" . 1)
-  ("\tab"    .      1)
-  ("\table"              . 1)
-  ("\vspace" .      1)
-  ("\windowlink"         . 2))
-
-buildHtMacroTable() ==
-  $htMacroTable := MAKE_-HASHTABLE 'UEQUAL
-  fn := CONCAT(getEnv '"AXIOM", '"/doc/util.ht")
-  if PROBE_-FILE(fn) then
-    instream := MAKE_-INSTREAM fn
-    while not EOFP instream repeat
-      line := READLINE instream
-      getHtMacroItem line is [string,:numOfArgs] =>
-        HPUT($htMacroTable,string,numOfArgs)
-    for [s,:n] in $primitiveHtCommands repeat HPUT($htMacroTable,s,n)
-  else
-    sayBrightly '"Warning: macro table not found"
-  $htMacroTable
-
-getHtMacroItem line ==
-  null stringPrefix?('"\newcommand{",line) => nil
-  k := charPosition(char '_},line,11)
-  command := SUBSTRING(line,12,k - 12)
-  numOfArgs :=
-    m := #line
-    i := charPosition(char '_[,line,k)
-    i = m => 0
-    j := charPosition(char '_],line,i + 1)
-    digitString := SUBSTRING(line,i + 1,j - i - 1)
-    and/[DIGITP digitString.i for i in 0..MAXINDEX digitString]
-      => PARSE_-INTEGER digitString
-    return nil
-  [command,:numOfArgs]
-
-spadSysChoose(tree,form) ==     --tree is ((word . tree) ..)
-  null form => true
-  null tree => false
-  lookupOn :=
-    form is [key,arg] => key
-    form
-  newTree := LASSOC(lookupOn,tree) => spadSysBranch(newTree,IFCAR IFCDR form)
-  false
-
-spadSysBranch(tree,arg) ==  --tree is (msg kind TREEorSomethingElse ...)
-  null arg => true
-  kind := tree.2
-  kind = 'TREE => spadSysChoose(tree.4,arg)
-  kind = 'LITERALS => MEMBER(arg,tree.4)
-  kind = 'INTEGER  => INTEGERP arg
-  kind = 'FUNCTION => atom arg
-  systemError '"unknown tree branch"
-
-buildHtMacroTable()
-@
-\eject
-\begin{thebibliography}{99}
-\bibitem{1} nothing
-\end{thebibliography}
-\end{document}
diff --git a/src/interp/htcheck.lisp.pamphlet b/src/interp/htcheck.lisp.pamphlet
new file mode 100644
index 0000000..fa3848e
--- /dev/null
+++ b/src/interp/htcheck.lisp.pamphlet
@@ -0,0 +1,269 @@
+\documentclass{article}
+\usepackage{axiom}
+\begin{document}
+\title{\$SPAD/src/interp htcheck.lisp}
+\author{The Axiom Team}
+\maketitle
+\begin{abstract}
+\end{abstract}
+\eject
+\tableofcontents
+\eject
+<<*>>=
+(IN-PACKAGE "BOOT" )
+
+;$primitiveHtCommands := '(
+;  ("\ContinueButton"     . 1)
+;  ("\andexample"         . 1)
+;  ("\autobutt" .    0)
+;  ("\autobuttons".  0)
+;  ("\begin"  .      1)
+;  ("\beginscroll".  0)
+;  ("\bound"  .      1)
+;  ("\fbox"    .      1)
+;  ("\centerline" .      1)
+;  ("\downlink" .    2)
+;  ("\em"     .      0)
+;  ("\end"    .      1)
+;  ("\endscroll"  .  0)
+;  ("\example"            . 1)
+;  ("\free"   .      1)
+;  ("\graphpaste" .  1)
+;  ("\helppage" .    1)
+;  ("\htbmdir"            . 0)
+;  ("\htbmfile"   .  1)
+;  ("\indent" .      1)
+;  ("\inputbitmap"        . 1)
+;  ("\inputstring" . 3)
+;  ("\item"   .      0)
+;  ("\keyword"            . 1)
+;  ("\link"               . 2)
+;  ("\lispdownlink"       . 2)
+;  ("\lispmemolink"       . 2)
+;  ("\lispwindowlink"     . 2)
+;  ("\menudownlink"       . 2)
+;  ("\menuitemstyle"      . 1)
+;  ("\menulink"           . 2)
+;  ("\menulispdownlink"   . 2)
+;  ("\menulispmemolink"   . 2)
+;  ("\menulispwindowlink" . 2)
+;  ("\menumemolink"       . 2)
+;  ("\menuwindowlink"     . 2)
+;  ("\newline" .     0)
+;  ("\radioboxes" .  3)
+;  ("\space"  .      1)
+;  ("\spadcommand" . 1)
+;  ("\stringvalue" . 1)
+;  ("\tab"    .      1)
+;  ("\table"              . 1)
+;  ("\vspace" .      1)
+;  ("\windowlink"         . 2))
+
+(SPADLET |$primitiveHtCommands|
+         '(("\\ContinueButton" . 1) ("\\andexample" . 1)
+           ("\\autobutt" . 0) ("\\autobuttons" . 0) ("\\begin" . 1)
+           ("\\beginscroll" . 0) ("\\bound" . 1) ("\\fbox" . 1)
+           ("\\centerline" . 1) ("\\downlink" . 2) ("\\em" . 0)
+           ("\\end" . 1) ("\\endscroll" . 0) ("\\example" . 1)
+           ("\\free" . 1) ("\\graphpaste" . 1) ("\\helppage" . 1)
+           ("\\htbmdir" . 0) ("\\htbmfile" . 1) ("\\indent" . 1)
+           ("\\inputbitmap" . 1) ("\\inputstring" . 3) ("\\item" . 0)
+           ("\\keyword" . 1) ("\\link" . 2) ("\\lispdownlink" . 2)
+           ("\\lispmemolink" . 2) ("\\lispwindowlink" . 2)
+           ("\\menudownlink" . 2) ("\\menuitemstyle" . 1)
+           ("\\menulink" . 2) ("\\menulispdownlink" . 2)
+           ("\\menulispmemolink" . 2) ("\\menulispwindowlink" . 2)
+           ("\\menumemolink" . 2) ("\\menuwindowlink" . 2)
+           ("\\newline" . 0) ("\\radioboxes" . 3) ("\\space" . 1)
+           ("\\spadcommand" . 1) ("\\stringvalue" . 1) ("\\tab" . 1)
+           ("\\table" . 1) ("\\vspace" . 1) ("\\windowlink" . 2)))
+
+;buildHtMacroTable() ==
+;  $htMacroTable := MAKE_-HASHTABLE 'UEQUAL
+;  fn := CONCAT(getEnv '"AXIOM", '"/doc/util.ht")
+;  if PROBE_-FILE(fn) then
+;    instream := MAKE_-INSTREAM fn
+;    while not EOFP instream repeat
+;      line := READLINE instream
+;      getHtMacroItem line is [string,:numOfArgs] =>
+;        HPUT($htMacroTable,string,numOfArgs)
+;    for [s,:n] in $primitiveHtCommands repeat HPUT($htMacroTable,s,n)
+;  else
+;    sayBrightly '"Warning: macro table not found"
+;  $htMacroTable
+
+(DEFUN |buildHtMacroTable| ()
+  (PROG (|fn| |instream| |line| |ISTMP#1| |string| |numOfArgs| |s| |n|)
+    (RETURN
+      (SEQ (PROGN
+             (SPADLET |$htMacroTable| (MAKE-HASHTABLE 'UEQUAL))
+             (SPADLET |fn|
+                      (CONCAT (|getEnv| (MAKESTRING "AXIOM"))
+                              (MAKESTRING "/doc/util.ht")))
+             (COND
+               ((PROBE-FILE |fn|)
+                (SPADLET |instream| (MAKE-INSTREAM |fn|))
+                (DO () ((NULL (NULL (EOFP |instream|))) NIL)
+                  (SEQ (EXIT (PROGN
+                               (SPADLET |line| (READLINE |instream|))
+                               (COND
+                                 ((PROGN
+                                    (SPADLET |ISTMP#1|
+                                     (|getHtMacroItem| |line|))
+                                    (AND (PAIRP |ISTMP#1|)
+                                     (PROGN
+                                       (SPADLET |string|
+                                        (QCAR |ISTMP#1|))
+                                       (SPADLET |numOfArgs|
+                                        (QCDR |ISTMP#1|))
+                                       'T)))
+                                  (HPUT |$htMacroTable| |string|
+                                        |numOfArgs|)))))))
+                (DO ((G166089 |$primitiveHtCommands| (CDR G166089))
+                     (G166066 NIL))
+                    ((OR (ATOM G166089)
+                         (PROGN (SETQ G166066 (CAR G166089)) NIL)
+                         (PROGN
+                           (PROGN
+                             (SPADLET |s| (CAR G166066))
+                             (SPADLET |n| (CDR G166066))
+                             G166066)
+                           NIL))
+                     NIL)
+                  (SEQ (EXIT (HPUT |$htMacroTable| |s| |n|)))))
+               ('T
+                (|sayBrightly|
+                    (MAKESTRING "Warning: macro table not found"))))
+             |$htMacroTable|)))))
+
+;getHtMacroItem line ==
+;  null stringPrefix?('"\newcommand{",line) => nil
+;  k := charPosition(char '_},line,11)
+;  command := SUBSTRING(line,12,k - 12)
+;  numOfArgs :=
+;    m := #line
+;    i := charPosition(char '_[,line,k)
+;    i = m => 0
+;    j := charPosition(char '_],line,i + 1)
+;    digitString := SUBSTRING(line,i + 1,j - i - 1)
+;    and/[DIGITP digitString.i for i in 0..MAXINDEX digitString]
+;      => PARSE_-INTEGER digitString
+;    return nil
+;  [command,:numOfArgs]
+
+(DEFUN |getHtMacroItem| (|line|)
+  (PROG (|k| |command| |m| |i| |j| |digitString| |numOfArgs|)
+    (RETURN
+      (SEQ (COND
+             ((NULL (|stringPrefix?| (MAKESTRING "\\newcommand{")
+                        |line|))
+              NIL)
+             ('T (SPADLET |k| (|charPosition| (|char| '}) |line| 11))
+              (SPADLET |command|
+                       (SUBSTRING |line| 12 (SPADDIFFERENCE |k| 12)))
+              (SPADLET |numOfArgs|
+                       (PROGN
+                         (SPADLET |m| (|#| |line|))
+                         (SPADLET |i|
+                                  (|charPosition| (|char| '[) |line|
+                                      |k|))
+                         (COND
+                           ((BOOT-EQUAL |i| |m|) 0)
+                           ('T
+                            (SPADLET |j|
+                                     (|charPosition| (|char| ']) |line|
+                                      (PLUS |i| 1)))
+                            (SPADLET |digitString|
+                                     (SUBSTRING |line| (PLUS |i| 1)
+                                      (SPADDIFFERENCE
+                                       (SPADDIFFERENCE |j| |i|) 1)))
+                            (COND
+                              ((PROG (G166110)
+                                 (SPADLET G166110 'T)
+                                 (RETURN
+                                   (DO
+                                    ((G166116 NIL (NULL G166110))
+                                     (G166117
+                                      (MAXINDEX |digitString|))
+                                     (|i| 0 (QSADD1 |i|)))
+                                    ((OR G166116
+                                      (QSGREATERP |i| G166117))
+                                     G166110)
+                                     (SEQ
+                                      (EXIT
+                                       (SETQ G166110
+                                        (AND G166110
+                                         (DIGITP
+                                          (ELT |digitString| |i|)))))))))
+                               (PARSE-INTEGER |digitString|))
+                              ('T (RETURN NIL)))))))
+              (CONS |command| |numOfArgs|)))))))
+
+;spadSysChoose(tree,form) ==     --tree is ((word . tree) ..)
+;  null form => true
+;  null tree => false
+;  lookupOn :=
+;    form is [key,arg] => key
+;    form
+;  newTree := LASSOC(lookupOn,tree) => spadSysBranch(newTree,IFCAR IFCDR form)
+;  false
+
+(DEFUN |spadSysChoose| (|tree| |form|)
+  (PROG (|key| |ISTMP#1| |arg| |lookupOn| |newTree|)
+    (RETURN
+      (COND
+        ((NULL |form|) 'T)
+        ((NULL |tree|) NIL)
+        ('T
+         (SPADLET |lookupOn|
+                  (COND
+                    ((AND (PAIRP |form|)
+                          (PROGN
+                            (SPADLET |key| (QCAR |form|))
+                            (SPADLET |ISTMP#1| (QCDR |form|))
+                            (AND (PAIRP |ISTMP#1|)
+                                 (EQ (QCDR |ISTMP#1|) NIL)
+                                 (PROGN
+                                   (SPADLET |arg| (QCAR |ISTMP#1|))
+                                   'T))))
+                     |key|)
+                    ('T |form|)))
+         (COND
+           ((SPADLET |newTree| (LASSOC |lookupOn| |tree|))
+            (|spadSysBranch| |newTree| (IFCAR (IFCDR |form|))))
+           ('T NIL)))))))
+
+;spadSysBranch(tree,arg) ==  --tree is (msg kind TREEorSomethingElse ...)
+;  null arg => true
+;  kind := tree.2
+;  kind = 'TREE => spadSysChoose(tree.4,arg)
+;  kind = 'LITERALS => MEMBER(arg,tree.4)
+;  kind = 'INTEGER  => INTEGERP arg
+;  kind = 'FUNCTION => atom arg
+;  systemError '"unknown tree branch"
+
+(DEFUN |spadSysBranch| (|tree| |arg|)
+  (PROG (|kind|)
+    (RETURN
+      (COND
+        ((NULL |arg|) 'T)
+        ('T (SPADLET |kind| (ELT |tree| 2))
+         (COND
+           ((BOOT-EQUAL |kind| 'TREE)
+            (|spadSysChoose| (ELT |tree| 4) |arg|))
+           ((BOOT-EQUAL |kind| 'LITERALS)
+            (|member| |arg| (ELT |tree| 4)))
+           ((BOOT-EQUAL |kind| 'INTEGER) (INTEGERP |arg|))
+           ((BOOT-EQUAL |kind| 'FUNCTION) (ATOM |arg|))
+           ('T (|systemError| (MAKESTRING "unknown tree branch")))))))))
+
+;buildHtMacroTable()
+
+(|buildHtMacroTable|) 
+
+@
+\eject
+\begin{thebibliography}{99}
+\bibitem{1} nothing
+\end{thebibliography}
+\end{document}
