diff --git a/books/bookvol5.pamphlet b/books/bookvol5.pamphlet index 0c8aa10..e424246 100644 --- a/books/bookvol5.pamphlet +++ b/books/bookvol5.pamphlet @@ -12685,6 +12685,23 @@ o )read @ +\defun{editFile}{Implement the )edit command} +\calls{editFile}{memq} +\calls{editFile}{strconc} +\calls{editFile}{namestring} +\calls{editFile}{pathname} +\calls{editFile}{obey} +<>= +(defun |editFile| (file) + (cond + ((memq (intern "WIN32" (find-package 'keyword)) *features*) + (obey (strconc "notepad " (|namestring| (|pathname| file))))) + (t + (obey + (strconc "$AXIOM/lib/SPADEDIT " (|namestring| (|pathname| file))))))) + +@ + \defun{updateSourceFiles}{updateSourceFiles} \calls{updateSourceFiles}{pathname} \calls{updateSourceFiles}{pathnameName} @@ -14955,6 +14972,18 @@ These functions transform an object to a writable form and back. item)))) @ + +\defun{rwrite}{Random write to a stream} +\calls{rwrite}{rwrite} +\calls{rwrite}{pname} +\calls{rwrite}{identp} +<>= +(defun |rwrite| (key val stream) + (when (identp key) (setq key (pname key))) + (rwrite key val stream))) + +@ + \defun{spadrwrite}{spadrwrite} \calls{spadrwrite}{spadrwrite0} \calls{spadrwrite}{throwKeyedMsg} @@ -14975,6 +15004,19 @@ These functions transform an object to a writable form and back. (|dewritify| (|rread| vec stream nil))) @ + +\defun{rread}{Random read a key from a stream} +RREAD takes erroval to return if key is missing +\calls{rread}{rread} +\calls{rwrite}{identp} +\calls{rwrite}{pname} +<>= +(defun |rread| (key rstream errorval) + (when (identp key) (setq key (pname key))) + (rread key rstream errorval)) + +@ + \defun{unwritable?}{unwritable?} \calls{unwritable?}{pairp} \calls{unwritable?}{vecp} @@ -25500,6 +25542,39 @@ This reports the traced functions |val|)))) @ +\defun{isSharpVarWithNum}{Identifier beginning with \verb|#number|?} +This tests if x is an identifier beginning with \verb|#| followed by a number. +\calls{isSharpVarWithNum}{isSharpVar} +\calls{isSharpVarWithNum}{pname} +\calls{isSharpVarWithNum}{qcsize} +\calls{isSharpVarWithNum}{digitp} +\calls{isSharpVarWithNum}{dig2fix} +<>= +(defun |isSharpVarWithNum| (x) + (let (p n d ok c) + (cond + ((null (|isSharpVar| x)) nil) + ((> 2 (setq n (qcsize (setq p (pname x))))) nil) + (t + (setq ok t) + (setq c 0) + (do ((t1 (1- n)) (i 1 (1+ i))) + ((or (> i t1) (null ok)) nil) + (setq d (elt p i)) + (when (setq ok (digitp d)) + (setq c (+ (* 10 c) (dig2fix d))))) + (when ok c))))) + +@ + +\defun{isSharpVar}{Identifier beginning with \verb|#|?} +This tests if x is an identifier beginning with \verb|#| +\calls{isSharpVar}{identp} +<>= +(defun |isSharpVar| (|x|) + (and (identp |x|) (char= (schar (symbol-name |x|) 0) #\#))) + +@ \defun{isgenvar}{isgenvar} \calls{isgenvar}{size} @@ -31621,6 +31696,7 @@ See Steele Common Lisp 1990 pp305-307 <> <> +<> <> <> <> @@ -31820,6 +31896,8 @@ See Steele Common Lisp 1990 pp305-307 <> <> <> +<> +<> <> <> <> @@ -32076,7 +32154,9 @@ See Steele Common Lisp 1990 pp305-307 <> <> <> +<> <> +<> <> <> diff --git a/changelog b/changelog index 6ab28c6..288617e 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,8 @@ +20100127 tpd src/axiom-website/patches.html 20100127.01.tpd.patch +20100127 tpd src/interp/htcheck.lisp add READLINE from compat.lisp +20100127 tpd src/interp/compat.lisp removed +20100127 tpd src/interp/Makefile remove compat.lisp +20100127 tpd books/bookvol5 merge and remove compat.lisp 20100126 tpd src/axiom-website/patches.html 20100126.01.tpd.patch 20100126 tpd books/bookvol8 redefine R1 in view3D for ARM processor 20100125 tpd src/axiom-website/patches.html 20100125.04.tpd.patch diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 5c50664..73b4213 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -2433,5 +2433,7 @@ src/axiom-website/download.html post vector binary
src/axiom-website/download.html post fedora6 binary
20100126.01.tpd.patch books/bookvol8 redefine R1 in view3D for ARM processor
+20100127.01.tpd.patch +books/bookvol5 merge and remove compat.lisp
diff --git a/src/interp/Makefile.pamphlet b/src/interp/Makefile.pamphlet index 3b7e753..f322274 100644 --- a/src/interp/Makefile.pamphlet +++ b/src/interp/Makefile.pamphlet @@ -144,7 +144,7 @@ OBJS= ${OUT}/vmlisp.${O} \ ${OUT}/cattable.${O} \ ${OUT}/cfuns.${O} \ ${OUT}/clam.${O} ${OUT}/clammed.${O} \ - ${OUT}/compat.${O} ${OUT}/compress.${O} \ + ${OUT}/compress.${O} \ ${OUT}/cparse.${O} \ ${OUT}/database.${O} \ ${OUT}/format.${O} \ @@ -1768,29 +1768,6 @@ ${MID}/clammed.lisp: ${IN}/clammed.lisp.pamphlet @ -\subsection{compat.lisp} -<>= -${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.lisp"' \ - ':output-file "${OUT}/compat.${O}") (${BYE}))' | ${DEPSYS} ; \ - else \ - echo '(progn (compile-file "${MID}/compat.lisp"' \ - ':output-file "${OUT}/compat.${O}") (${BYE}))' | ${DEPSYS} \ - >${TMP}/trace ; \ - fi ) - -@ -<>= -${MID}/compat.lisp: ${IN}/compat.lisp.pamphlet - @ echo 137 making ${MID}/compat.lisp from ${IN}/compat.lisp.pamphlet - @ (cd ${MID} ; \ - ${TANGLE} ${IN}/compat.lisp.pamphlet >compat.lisp ) - -@ - \subsection{compiler.lisp} <>= ${OUT}/compiler.${O}: ${MID}/compiler.lisp @@ -3757,9 +3734,6 @@ clean: <> <> -<> -<> - <> <> diff --git a/src/interp/compat.lisp.pamphlet b/src/interp/compat.lisp.pamphlet deleted file mode 100644 index dea9247..0000000 --- a/src/interp/compat.lisp.pamphlet +++ /dev/null @@ -1,134 +0,0 @@ -\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/htcheck.lisp.pamphlet b/src/interp/htcheck.lisp.pamphlet index 35941de..f3f2231 100644 --- a/src/interp/htcheck.lisp.pamphlet +++ b/src/interp/htcheck.lisp.pamphlet @@ -137,6 +137,16 @@ (MAKESTRING "Warning: macro table not found")))) |$htMacroTable|))))) +;READLINE(:s) == +; s => read_-line(first s) +; read_-line(_*STANDARD_-INPUT_*) + +(DEFUN READLINE (&REST t1 &AUX |s|) + (DSETQ |s| t1) + (COND + (|s| (|read-line| (CAR |s|))) + ((QUOTE T) (|read-line| *STANDARD-INPUT*)))) + ;getHtMacroItem line == ; null stringPrefix?('"\newcommand{",line) => nil ; k := charPosition(char '_},line,11)