diff --git a/src/interp/Makefile.pamphlet b/src/interp/Makefile.pamphlet index a85ec24..8c26eb1 100644 --- a/src/interp/Makefile.pamphlet +++ b/src/interp/Makefile.pamphlet @@ -4696,44 +4696,26 @@ ${MID}/ptrees.lisp: ${IN}/ptrees.lisp.pamphlet @ -\subsection{ptrop.boot} +\subsection{ptrop.lisp} <>= -${OUT}/ptrop.${O}: ${MID}/ptrop.clisp - @ echo 522 making ${OUT}/ptrop.${O} from ${MID}/ptrop.clisp - @ if [ -z "${NOISE}" ] ; then \ - echo '(progn (compile-file "${MID}/ptrop.clisp"' \ +${OUT}/ptrop.${O}: ${MID}/ptrop.lisp + @ echo 136 making ${OUT}/ptrop.${O} from ${MID}/ptrop.lisp + @ ( cd ${MID} ; \ + if [ -z "${NOISE}" ] ; then \ + echo '(progn (compile-file "${MID}/ptrop.lisp"' \ ':output-file "${OUT}/ptrop.${O}") (${BYE}))' | ${DEPSYS} ; \ else \ - echo '(progn (compile-file "${MID}/ptrop.clisp"' \ + echo '(progn (compile-file "${MID}/ptrop.lisp"' \ ':output-file "${OUT}/ptrop.${O}") (${BYE}))' | ${DEPSYS} \ >${TMP}/trace ; \ - fi + fi ) @ -<>= -${MID}/ptrop.clisp: ${IN}/ptrop.boot.pamphlet - @ echo 523 making ${MID}/ptrop.clisp from ${IN}/ptrop.boot.pamphlet +<>= +${MID}/ptrop.lisp: ${IN}/ptrop.lisp.pamphlet + @ echo 137 making ${MID}/ptrop.lisp from ${IN}/ptrop.lisp.pamphlet @ (cd ${MID} ; \ - ${TANGLE} ${IN}/ptrop.boot.pamphlet >ptrop.boot ; \ - if [ -z "${NOISE}" ] ; then \ - echo '(progn (boottran::boottocl "${MID}/ptrop.boot") (${BYE}))' \ - | ${BOOTSYS} ; \ - else \ - echo '(progn (boottran::boottocl "${MID}/ptrop.boot") (${BYE}))' \ - | ${BOOTSYS} >${TMP}/trace ; \ - fi ; \ - rm ptrop.boot ) - -@ -<>= -${DOC}/ptrop.boot.dvi: ${IN}/ptrop.boot.pamphlet - @echo 524 making ${DOC}/ptrop.boot.dvi from ${IN}/ptrop.boot.pamphlet - @(cd ${DOC} ; \ - cp ${IN}/ptrop.boot.pamphlet ${DOC} ; \ - ${DOCUMENT} ${NOISE} ptrop.boot ; \ - rm -f ${DOC}/ptrop.boot.pamphlet ; \ - rm -f ${DOC}/ptrop.boot.tex ; \ - rm -f ${DOC}/ptrop.boot ) + ${TANGLE} ${IN}/ptrop.lisp.pamphlet >ptrop.lisp ) @ @@ -6160,8 +6142,7 @@ clean: <> <> -<> -<> +<> <> <> diff --git a/src/interp/nruntime.boot.pamphlet b/src/interp/nruntime.boot.pamphlet deleted file mode 100644 index c2d809d..0000000 --- a/src/interp/nruntime.boot.pamphlet +++ /dev/null @@ -1,80 +0,0 @@ -\documentclass{article} -\usepackage{axiom} -\begin{document} -\title{\$SPAD/src/interp nruntime.boot} -\author{The Axiom Team} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject -\section{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. - -@ -<<*>>= -<> - -unloadOneConstructor(cnam,fn) == - REMPROP(cnam,'LOADED) - SETF(SYMBOL_-FUNCTION cnam,mkAutoLoad(fn, cnam)) - -devaluateDeeply x == - VECP x => devaluate x - atom x => x - [devaluateDeeply y for y in x] - -lookupDisplay(op,sig,vectorOrForm,suffix) == - null $NRTmonitorIfTrue => nil - prefix := (suffix = '"" => ">"; "<") - sayBrightly - concat(prefix,formatOpSignature(op,sig), - '" from ", prefix2String devaluateDeeply vectorOrForm,suffix) - -isInstantiated [op,:argl] == - u:= lassocShiftWithFunction(argl,HGET($ConstructorCache,op),'domainEqualList) - => CDRwithIncrement u - nil - -isCategoryPackageName nam == - p := PNAME opOf nam - p.(MAXINDEX p) = char '_& - - -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/interp/nruntime.lisp.pamphlet b/src/interp/nruntime.lisp.pamphlet new file mode 100644 index 0000000..8b37b20 --- /dev/null +++ b/src/interp/nruntime.lisp.pamphlet @@ -0,0 +1,105 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/interp nruntime.lisp} +\author{The Axiom Team} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject +<<*>>= +(IN-PACKAGE "BOOT" ) + +;unloadOneConstructor(cnam,fn) == +; REMPROP(cnam,'LOADED) +; SETF(SYMBOL_-FUNCTION cnam,mkAutoLoad(fn, cnam)) + +(DEFUN |unloadOneConstructor| (|cnam| |fn|) + (PROGN + (REMPROP |cnam| 'LOADED) + (SETF (SYMBOL-FUNCTION |cnam|) (|mkAutoLoad| |fn| |cnam|)))) + +;devaluateDeeply x == +; VECP x => devaluate x +; atom x => x +; [devaluateDeeply y for y in x] + +(DEFUN |devaluateDeeply| (|x|) + (PROG () + (RETURN + (SEQ (COND + ((VECP |x|) (|devaluate| |x|)) + ((ATOM |x|) |x|) + ('T + (PROG (G166066) + (SPADLET G166066 NIL) + (RETURN + (DO ((G166071 |x| (CDR G166071)) (|y| NIL)) + ((OR (ATOM G166071) + (PROGN (SETQ |y| (CAR G166071)) NIL)) + (NREVERSE0 G166066)) + (SEQ (EXIT (SETQ G166066 + (CONS (|devaluateDeeply| |y|) + G166066))))))))))))) + +;lookupDisplay(op,sig,vectorOrForm,suffix) == +; null $NRTmonitorIfTrue => nil +; prefix := (suffix = '"" => ">"; "<") +; sayBrightly +; concat(prefix,formatOpSignature(op,sig), +; '" from ", prefix2String devaluateDeeply vectorOrForm,suffix) + +(DEFUN |lookupDisplay| (|op| |sig| |vectorOrForm| |suffix|) + (PROG (|prefix|) + (RETURN + (COND + ((NULL |$NRTmonitorIfTrue|) NIL) + ('T + (SPADLET |prefix| + (COND + ((BOOT-EQUAL |suffix| (MAKESTRING "")) '>) + ('T '<))) + (|sayBrightly| + (|concat| |prefix| (|formatOpSignature| |op| |sig|) + (MAKESTRING " from ") + (|prefix2String| (|devaluateDeeply| |vectorOrForm|)) + |suffix|))))))) + +;isInstantiated [op,:argl] == +; u:= lassocShiftWithFunction(argl,HGET($ConstructorCache,op),'domainEqualList) +; => CDRwithIncrement u +; nil + +(DEFUN |isInstantiated| (G166088) + (PROG (|op| |argl| |u|) + (RETURN + (PROGN + (SPADLET |op| (CAR G166088)) + (SPADLET |argl| (CDR G166088)) + (COND + ((SPADLET |u| + (|lassocShiftWithFunction| |argl| + (HGET |$ConstructorCache| |op|) + '|domainEqualList|)) + (|CDRwithIncrement| |u|)) + ('T NIL)))))) + +;isCategoryPackageName nam == +; p := PNAME opOf nam +; p.(MAXINDEX p) = char '_& + +(DEFUN |isCategoryPackageName| (|nam|) + (PROG (|p|) + (RETURN + (PROGN + (SPADLET |p| (PNAME (|opOf| |nam|))) + (BOOT-EQUAL (ELT |p| (MAXINDEX |p|)) (|char| '&)))))) + +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} diff --git a/src/interp/ptrop.boot.pamphlet b/src/interp/ptrop.boot.pamphlet deleted file mode 100644 index 70a6562..0000000 --- a/src/interp/ptrop.boot.pamphlet +++ /dev/null @@ -1,98 +0,0 @@ -\documentclass{article} -\usepackage{axiom} -\begin{document} -\title{\$SPAD/src/interp ptrop.boot} -\author{The Axiom Team} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject -\section{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. - -@ -<<*>>= -<> - -)package "BOOT" - ---% Utility operations on Abstract Syntax Trees - --- An S-expression which people can read. -pfSexpr pform == - strip pform where - strip pform == - pfId? pform => pfIdSymbol pform - pfLiteral? pform => pfLiteralString pform - pfLeaf? pform => tokPart pform - - pfApplication? pform => - args := - a := pfApplicationArg pform - if pfTuple? a then pf0TupleParts a else [a] - [strip p for p in cons(pfApplicationOp pform, args)] - - cons(pfAbSynOp pform, [strip p for p in pfParts pform]) - -pfCopyWithPos( pform , pos ) == - pfLeaf? pform => pfLeaf( pfAbSynOp pform , tokPart pform , pos ) - pfTree( pfAbSynOp pform , [ pfCopyWithPos( p , pos ) for p in pfParts pform ] ) - -pfMapParts(f, pform) == - pfLeaf? pform => pform - parts0 := pfParts pform - parts1 := [FUNCALL(f, p) for p in parts0] - -- Return the original if no changes. - same := true - for p0 in parts0 for p1 in parts1 while same repeat same := EQ(p0,p1) - same => pform - pfTree(pfAbSynOp pform, parts1) - - -pf0ApplicationArgs pform == - arg := pfApplicationArg pform - pf0FlattenSyntacticTuple arg - -pf0FlattenSyntacticTuple pform == - not pfTuple? pform => [pform] - [:pf0FlattenSyntacticTuple p for p in pf0TupleParts pform] - - -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/interp/ptrop.lisp.pamphlet b/src/interp/ptrop.lisp.pamphlet new file mode 100644 index 0000000..0331708 --- /dev/null +++ b/src/interp/ptrop.lisp.pamphlet @@ -0,0 +1,188 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/interp ptrop.lisp} +\author{The Axiom Team} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject +<<*>>= +(IN-PACKAGE "BOOT") + +;--% Utility operations on Abstract Syntax Trees + +;-- An S-expression which people can read. +;pfSexpr pform == +; strip pform where +; strip pform == +; pfId? pform => pfIdSymbol pform +; pfLiteral? pform => pfLiteralString pform +; pfLeaf? pform => tokPart pform +; +; pfApplication? pform => +; args := +; a := pfApplicationArg pform +; if pfTuple? a then pf0TupleParts a else [a] +; [strip p for p in cons(pfApplicationOp pform, args)] +; +; cons(pfAbSynOp pform, [strip p for p in pfParts pform]) + +(DEFUN |pfSexpr| (|pform|) + (PROG () (RETURN (|pfSexpr,strip| |pform|)))) + +(DEFUN |pfSexpr,strip| (|pform|) + (PROG (|args| |a|) + (RETURN + (COND + ((|pfId?| |pform|) (|pfIdSymbol| |pform|)) + ((|pfLiteral?| |pform|) (|pfLiteralString| |pform|)) + ((|pfLeaf?| |pform|) (|tokPart| |pform|)) + ((|pfApplication?| |pform|) + (PROGN + (SETQ |args| + (PROGN + (SETQ |a| (|pfApplicationArg| |pform|)) + (COND + ((|pfTuple?| |a|) (|pf0TupleParts| |a|)) + ('T (LIST |a|))))) + ((LAMBDA (|bfVar#2| |bfVar#1| |p|) + (LOOP + (COND + ((OR (ATOM |bfVar#1|) + (PROGN (SETQ |p| (CAR |bfVar#1|)) NIL)) + (RETURN (NREVERSE |bfVar#2|))) + ('T + (SETQ |bfVar#2| + (CONS (|pfSexpr,strip| |p|) |bfVar#2|)))) + (SETQ |bfVar#1| (CDR |bfVar#1|)))) + NIL (CONS (|pfApplicationOp| |pform|) |args|) NIL))) + ('T + (CONS (|pfAbSynOp| |pform|) + ((LAMBDA (|bfVar#4| |bfVar#3| |p|) + (LOOP + (COND + ((OR (ATOM |bfVar#3|) + (PROGN (SETQ |p| (CAR |bfVar#3|)) NIL)) + (RETURN (NREVERSE |bfVar#4|))) + ('T + (SETQ |bfVar#4| + (CONS (|pfSexpr,strip| |p|) |bfVar#4|)))) + (SETQ |bfVar#3| (CDR |bfVar#3|)))) + NIL (|pfParts| |pform|) NIL))))))) + +;pfCopyWithPos( pform , pos ) == +; pfLeaf? pform => pfLeaf( pfAbSynOp pform , tokPart pform , pos ) +; pfTree( pfAbSynOp pform , [ pfCopyWithPos( p , pos ) for p in pfParts pform ] ) + +(DEFUN |pfCopyWithPos| (|pform| |pos|) + (PROG () + (RETURN + (COND + ((|pfLeaf?| |pform|) + (|pfLeaf| (|pfAbSynOp| |pform|) (|tokPart| |pform|) |pos|)) + ('T + (|pfTree| (|pfAbSynOp| |pform|) + ((LAMBDA (|bfVar#6| |bfVar#5| |p|) + (LOOP + (COND + ((OR (ATOM |bfVar#5|) + (PROGN (SETQ |p| (CAR |bfVar#5|)) NIL)) + (RETURN (NREVERSE |bfVar#6|))) + ('T + (SETQ |bfVar#6| + (CONS (|pfCopyWithPos| |p| |pos|) |bfVar#6|)))) + (SETQ |bfVar#5| (CDR |bfVar#5|)))) + NIL (|pfParts| |pform|) NIL))))))) + +;pfMapParts(f, pform) == +; pfLeaf? pform => pform +; parts0 := pfParts pform +; parts1 := [FUNCALL(f, p) for p in parts0] +; -- Return the original if no changes. +; same := true +; for p0 in parts0 for p1 in parts1 while same repeat same := EQ(p0,p1) +; same => pform +; pfTree(pfAbSynOp pform, parts1) + +(DEFUN |pfMapParts| (|f| |pform|) + (PROG (|same| |parts1| |parts0|) + (RETURN + (COND + ((|pfLeaf?| |pform|) |pform|) + ('T + (PROGN + (SETQ |parts0| (|pfParts| |pform|)) + (SETQ |parts1| + ((LAMBDA (|bfVar#8| |bfVar#7| |p|) + (LOOP + (COND + ((OR (ATOM |bfVar#7|) + (PROGN (SETQ |p| (CAR |bfVar#7|)) NIL)) + (RETURN (NREVERSE |bfVar#8|))) + ('T + (SETQ |bfVar#8| + (CONS (FUNCALL |f| |p|) |bfVar#8|)))) + (SETQ |bfVar#7| (CDR |bfVar#7|)))) + NIL |parts0| NIL)) + (SETQ |same| T) + ((LAMBDA (|bfVar#9| |p0| |bfVar#10| |p1|) + (LOOP + (COND + ((OR (ATOM |bfVar#9|) + (PROGN (SETQ |p0| (CAR |bfVar#9|)) NIL) + (ATOM |bfVar#10|) + (PROGN (SETQ |p1| (CAR |bfVar#10|)) NIL) + (NOT |same|)) + (RETURN NIL)) + ('T (SETQ |same| (EQ |p0| |p1|)))) + (SETQ |bfVar#9| (CDR |bfVar#9|)) + (SETQ |bfVar#10| (CDR |bfVar#10|)))) + |parts0| NIL |parts1| NIL) + (COND + (|same| |pform|) + ('T (|pfTree| (|pfAbSynOp| |pform|) |parts1|))))))))) + +;pf0ApplicationArgs pform == +; arg := pfApplicationArg pform +; pf0FlattenSyntacticTuple arg + +(DEFUN |pf0ApplicationArgs| (|pform|) + (PROG (|arg|) + (RETURN + (PROGN + (SETQ |arg| (|pfApplicationArg| |pform|)) + (|pf0FlattenSyntacticTuple| |arg|))))) + +;pf0FlattenSyntacticTuple pform == +; not pfTuple? pform => [pform] +; [:pf0FlattenSyntacticTuple p for p in pf0TupleParts pform] + +(DEFUN |pf0FlattenSyntacticTuple| (|pform|) + (PROG () + (RETURN + (COND + ((NULL (|pfTuple?| |pform|)) (LIST |pform|)) + ('T + ((LAMBDA (|bfVar#12| |bfVar#11| |p|) + (LOOP + (COND + ((OR (ATOM |bfVar#11|) + (PROGN (SETQ |p| (CAR |bfVar#11|)) NIL)) + (RETURN (NREVERSE |bfVar#12|))) + ('T + (SETQ |bfVar#12| + (APPEND (REVERSE (|pf0FlattenSyntacticTuple| + |p|)) + |bfVar#12|)))) + (SETQ |bfVar#11| (CDR |bfVar#11|)))) + NIL (|pf0TupleParts| |pform|) NIL)))))) + +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document}