diff --git a/changelog b/changelog
index f37d3de..929859f 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,8 @@
+20090813 tpd src/axiom-website/patches.html 20090813.03.tpd.patch
+20090813 tpd src/interp/Makefile move compat.boot to compat.lisp
+20090813 tpd src/interp/debugsys.lisp change astr.clisp to compat.lisp
+20090813 tpd src/interp/compat.lisp added, rewritten from compat.boot
+20090813 tpd src/interp/compat.boot removed, rewritten to compat.lisp
 20090813 tpd src/axiom-website/patches.html 20090813.02.tpd.patch
 20090813 tpd src/interp/Makefile move clammed.boot to clammed.lisp
 20090813 tpd src/interp/debugsys.lisp change astr.clisp to clammed.lisp
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 7d3c9a8..62f8b3b 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -1782,6 +1782,8 @@ cformat.lisp rewrite from boot to lisp<br/>
 clam.lisp rewrite from boot to lisp<br/>
 <a href="patches/20090813.02.tpd.patch">20090813.02.tpd.patch</a>
 clammed.lisp rewrite from boot to lisp<br/>
+<a href="patches/20090813.03.tpd.patch">20090813.03.tpd.patch</a>
+compat.lisp rewrite from boot to lisp<br/>
 
  </body>
 </html>
diff --git a/src/interp/Makefile.pamphlet b/src/interp/Makefile.pamphlet
index daccb8f..6654d39 100644
--- a/src/interp/Makefile.pamphlet
+++ b/src/interp/Makefile.pamphlet
@@ -417,7 +417,6 @@ DOCFILES=${DOC}/as.boot.dvi \
 	 ${DOC}/category.boot.dvi \
 	 ${DOC}/c-doc.boot.dvi \
 	 ${DOC}/cfuns.lisp.dvi \
-	 ${DOC}/compat.boot.dvi \
 	 ${DOC}/compiler.boot.dvi \
 	 ${DOC}/compress.boot.dvi \
 	 ${DOC}/cparse.boot.dvi ${DOC}/cstream.boot.dvi \
@@ -2589,45 +2588,26 @@ ${MID}/clammed.lisp: ${IN}/clammed.lisp.pamphlet
 
 @
 
-\subsection{compat.boot \cite{63}}
+\subsection{compat.lisp}
 <<compat.o (OUT from MID)>>=
-${OUT}/compat.${O}: ${MID}/compat.clisp 
-	@ echo 228 making ${OUT}/compat.${O} from ${MID}/compat.clisp
-	@ (cd ${MID} ; \
+${OUT}/compat.${O}: ${MID}/compat.lisp
+	@ echo 136 making ${OUT}/compat.${O} from ${MID}/compat.lisp
+	@ ( cd ${MID} ; \
 	  if [ -z "${NOISE}" ] ; then \
-	   echo '(progn  (compile-file "${MID}/compat.clisp"' \
+	   echo '(progn  (compile-file "${MID}/compat.lisp"' \
              ':output-file "${OUT}/compat.${O}") (${BYE}))' | ${DEPSYS} ; \
 	  else \
-	   echo '(progn  (compile-file "${MID}/compat.clisp"' \
+	   echo '(progn  (compile-file "${MID}/compat.lisp"' \
              ':output-file "${OUT}/compat.${O}") (${BYE}))' | ${DEPSYS} \
              >${TMP}/trace ; \
 	  fi )
 
 @
-<<compat.clisp (MID from IN)>>=
-${MID}/compat.clisp: ${IN}/compat.boot.pamphlet
-	@ echo 229 making ${MID}/compat.clisp from ${IN}/compat.boot.pamphlet
+<<compat.lisp (MID from IN)>>=
+${MID}/compat.lisp: ${IN}/compat.lisp.pamphlet
+	@ echo 137 making ${MID}/compat.lisp from ${IN}/compat.lisp.pamphlet
 	@ (cd ${MID} ; \
-	  ${TANGLE} ${IN}/compat.boot.pamphlet >compat.boot ; \
-	  if [ -z "${NOISE}" ] ; then \
-	   echo '(progn (boottran::boottocl "compat.boot") (${BYE}))' \
-                | ${DEPSYS} ; \
-	  else \
-	   echo '(progn (boottran::boottocl "compat.boot") (${BYE}))' \
-                | ${DEPSYS} >${TMP}/trace ; \
-	  fi ; \
-	  rm compat.boot )
-
-@
-<<compat.boot.dvi (DOC from IN)>>=
-${DOC}/compat.boot.dvi: ${IN}/compat.boot.pamphlet 
-	@echo 230 making ${DOC}/compat.boot.dvi from ${IN}/compat.boot.pamphlet
-	@(cd ${DOC} ; \
-	cp ${IN}/compat.boot.pamphlet ${DOC} ; \
-	${DOCUMENT} ${NOISE} compat.boot ; \
-	rm -f ${DOC}/compat.boot.pamphlet ; \
-	rm -f ${DOC}/compat.boot.tex ; \
-	rm -f ${DOC}/compat.boot )
+	   ${TANGLE} ${IN}/compat.lisp.pamphlet >compat.lisp )
 
 @
 
@@ -6799,8 +6779,7 @@ clean:
 <<clammed.lisp (MID from IN)>>
 
 <<compat.o (OUT from MID)>>
-<<compat.clisp (MID from IN)>>
-<<compat.boot.dvi (DOC from IN)>>
+<<compat.lisp (MID from IN)>>
 
 <<compiler.o (AUTO from OUT)>>
 <<compiler.o (OUT from MID)>>
@@ -7369,7 +7348,6 @@ pp
 \bibitem{57} {\bf \$SPAD/src/interp/nag-s.boot.pamphlet}
 \bibitem{58} {\bf \$SPAD/src/interp/category.boot.pamphlet}
 \bibitem{60} {\bf \$SPAD/src/interp/c-doc.boot.pamphlet}
-\bibitem{63} {\bf \$SPAD/src/interp/compat.boot.pamphlet}
 \bibitem{64} {\bf \$SPAD/src/interp/compiler.boot.pamphlet}
 \bibitem{65} {\bf \$SPAD/src/interp/profile.boot.pamphlet}
 \bibitem{66} {\bf \$SPAD/src/interp/compress.boot.pamphlet}
diff --git a/src/interp/compat.boot.pamphlet b/src/interp/compat.boot.pamphlet
deleted file mode 100644
index 26e1181..0000000
--- a/src/interp/compat.boot.pamphlet
+++ /dev/null
@@ -1,111 +0,0 @@
-\documentclass{article}
-\usepackage{axiom}
-\begin{document}
-\title{\$SPAD/src/interp compat.boot}
-\author{The Axiom Team}
-\maketitle
-\begin{abstract}
-\end{abstract}
-\eject
-\tableofcontents
-\eject
-\section{readline}
-Reads a line, defaulting stream to *standard-input*
-
-This was commented out in the NAG version, probably due to the
-use of the saturn GUI interface but the real reason is uncertain.
-<<readline>>=
-READLINE(:s) ==
-  s => read_-line(first s)
-  read_-line(_*STANDARD_-INPUT_*)
-
-@
-\section{compat.boot}
-\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>>
-
--- some functions that may need to be changed on different lisp
--- systems.
- 
--- tests if x is an identifier beginning with #
- 
-isSharpVar x ==
-  IDENTP x and SCHAR(SYMBOL_-NAME x,0) = char "#"
- 
-isSharpVarWithNum x ==
-  null isSharpVar x => nil
-  (n := QCSIZE(p := PNAME x)) < 2 => nil
-  ok := true
-  c := 0
-  for i in 1..(n-1) while ok repeat
-    d := ELT(p,i)
-    ok := DIGITP d => c := 10*c + DIG2FIX d
-  if ok then c else nil
- 
--- RREAD which takes erroval to return if key is missing
-rread(key,rstream,errorval) ==
-  if IDENTP key then key := PNAME key
-  RREAD(key,rstream,errorval)	
-
-rwrite(key,val,stream) ==
-  if IDENTP key then key := PNAME key
-  RWRITE(key,val,stream) 
-
--- issuing commands to the operating system
- 
-system() ==
-  -- VM version of system command
-  string := getSystemCommandLine()
-  if string = '"" then string := '"sh"
-  sayMessage ["   Return Code = ", OBEY string]
-  terminateSystemCommand()
-
-editFile file ==
-  MEMQ(INTERN('"WIN32",FIND_-PACKAGE("KEYWORD")),_*FEATURES_*) => 
-    OBEY STRCONC('"notepad ", namestring pathname file)
-  OBEY STRCONC('"$AXIOM/lib/SPADEDIT ",namestring pathname file)
-
-makeBigFloat(mantissa,expon) ==
-  [$BFtag,mantissa,:expon]
-
-<<readline>>
-@
-\eject
-\begin{thebibliography}{99}
-\bibitem{1} nothing
-\end{thebibliography}
-\end{document}
diff --git a/src/interp/compat.lisp.pamphlet b/src/interp/compat.lisp.pamphlet
new file mode 100644
index 0000000..dea9247
--- /dev/null
+++ b/src/interp/compat.lisp.pamphlet
@@ -0,0 +1,134 @@
+\documentclass{article}
+\usepackage{axiom}
+\begin{document}
+\title{\$SPAD/src/interp compat.lisp}
+\author{The Axiom Team}
+\maketitle
+\begin{abstract}
+\end{abstract}
+\eject
+\tableofcontents
+\eject
+<<*>>=
+(IN-PACKAGE "BOOT" )
+
+;-- some functions that may need to be changed on different lisp
+;-- systems.
+;
+;-- tests if x is an identifier beginning with #
+;
+;isSharpVar x ==
+;  IDENTP x and SCHAR(SYMBOL_-NAME x,0) = char "#"
+
+(DEFUN |isSharpVar| (|x|)
+ (AND (IDENTP |x|)
+      (BOOT-EQUAL (SCHAR (SYMBOL-NAME |x|) 0) (|char| (QUOTE |#|))))) 
+;
+;isSharpVarWithNum x ==
+;  null isSharpVar x => nil
+;  (n := QCSIZE(p := PNAME x)) < 2 => nil
+;  ok := true
+;  c := 0
+;  for i in 1..(n-1) while ok repeat
+;    d := ELT(p,i)
+;    ok := DIGITP d => c := 10*c + DIG2FIX d
+;  if ok then c else nil
+
+(DEFUN |isSharpVarWithNum| (|x|)
+ (PROG (|p| |n| |d| |ok| |c|)
+  (RETURN
+   (SEQ
+    (COND
+     ((NULL (|isSharpVar| |x|)) NIL)
+     ((> 2 (SPADLET |n| (QCSIZE (SPADLET |p| (PNAME |x|))))) NIL)
+     ((QUOTE T)
+      (SPADLET |ok| (QUOTE T))
+      (SPADLET |c| 0)
+      (DO ((#0=#:G166068 (SPADDIFFERENCE |n| 1)) (|i| 1 (QSADD1 |i|)))
+          ((OR (QSGREATERP |i| #0#) (NULL |ok|)) NIL)
+       (SEQ
+        (EXIT
+         (PROGN
+          (SPADLET |d| (ELT |p| |i|))
+          (COND
+           ((SPADLET |ok| (DIGITP |d|))
+            (SPADLET |c| (PLUS (TIMES 10 |c|) (DIG2FIX |d|)))))))))
+      (COND
+       (|ok| |c|)
+       ((QUOTE T) NIL)))))))) 
+;
+;-- RREAD which takes erroval to return if key is missing
+;rread(key,rstream,errorval) ==
+;  if IDENTP key then key := PNAME key
+;  RREAD(key,rstream,errorval)
+
+(DEFUN |rread| (|key| |rstream| |errorval|)
+ (PROGN
+  (COND ((IDENTP |key|) (SPADLET |key| (PNAME |key|))))
+  (RREAD |key| |rstream| |errorval|))) 
+
+;rwrite(key,val,stream) ==
+;  if IDENTP key then key := PNAME key
+;  RWRITE(key,val,stream)
+
+(DEFUN |rwrite| (|key| |val| |stream|)
+ (PROGN
+  (COND ((IDENTP |key|) (SPADLET |key| (PNAME |key|))))
+  (RWRITE |key| |val| |stream|))) 
+
+;-- issuing commands to the operating system
+;
+;system() ==
+;  -- VM version of system command
+;  string := getSystemCommandLine()
+;  if string = '"" then string := '"sh"
+;  sayMessage ["   Return Code = ", OBEY string]
+;  terminateSystemCommand()
+
+(DEFUN |system| NIL
+ (PROG (|string|)
+  (RETURN
+   (PROGN
+    (SPADLET |string| (|getSystemCommandLine|))
+    (COND
+     ((BOOT-EQUAL |string| (MAKESTRING ""))
+      (SPADLET |string| (MAKESTRING "sh"))))
+    (|sayMessage|
+     (CONS (QUOTE |   Return Code = |) (CONS (OBEY |string|) NIL)))
+    (|terminateSystemCommand|))))) 
+
+;editFile file ==
+;  MEMQ(INTERN('"WIN32",FIND_-PACKAGE("KEYWORD")),_*FEATURES_*) =>
+;    OBEY STRCONC('"notepad ", namestring pathname file)
+;  OBEY STRCONC('"$AXIOM/lib/SPADEDIT ",namestring pathname file)
+
+(DEFUN |editFile| (|file|)
+ (COND
+  ((MEMQ (INTERN "WIN32" (FIND-PACKAGE (QUOTE KEYWORD))) *FEATURES*)
+   (OBEY (STRCONC "notepad " (|namestring| (|pathname| |file|)))))
+  ((QUOTE T)
+   (OBEY
+    (STRCONC "$AXIOM/lib/SPADEDIT " (|namestring| (|pathname| |file|))))))) 
+
+;makeBigFloat(mantissa,expon) ==
+;  [$BFtag,mantissa,:expon]
+
+(DEFUN |makeBigFloat| (|mantissa| |expon|)
+ (CONS |$BFtag| (CONS |mantissa| |expon|))) 
+
+;READLINE(:s) ==
+;  s => read_-line(first s)
+;  read_-line(_*STANDARD_-INPUT_*)
+
+(DEFUN READLINE (&REST #0=#:G166110 &AUX |s|)
+ (DSETQ |s| #0#)
+ (COND 
+  (|s| (|read-line| (CAR |s|)))
+  ((QUOTE T) (|read-line| *STANDARD-INPUT*)))) 
+
+@
+\eject
+\begin{thebibliography}{99}
+\bibitem{1} nothing
+\end{thebibliography}
+\end{document}
diff --git a/src/interp/debugsys.lisp.pamphlet b/src/interp/debugsys.lisp.pamphlet
index af5888b..24014d4 100644
--- a/src/interp/debugsys.lisp.pamphlet
+++ b/src/interp/debugsys.lisp.pamphlet
@@ -93,7 +93,7 @@ loaded by hand we need to establish a value.
       (thesymb (concatenate 'string "/obj/" *sys* "/interp/cfuns.o"))
       (thesymb "/int/interp/clam.lisp")
       (thesymb "/int/interp/clammed.lisp")
-      (thesymb "/int/interp/compat.clisp")
+      (thesymb "/int/interp/compat.lisp")
       (thesymb "/int/interp/compress.clisp")
       (thesymb "/int/interp/cparse.clisp")
       (thesymb "/int/interp/cstream.clisp")
