diff --git a/books/bookvol5.pamphlet b/books/bookvol5.pamphlet index b226c88..7cb92f3 100644 --- a/books/bookvol5.pamphlet +++ b/books/bookvol5.pamphlet @@ -1,4 +1,4 @@ -\documentclass[dvipdfm]{book} +x\documentclass[dvipdfm]{book} \usepackage{hyperref} \usepackage{axiom} \usepackage{makeidx} @@ -6041,8 +6041,6 @@ and the current token (\$ttok) (t (|npMissing| '|then|)))) (t nil))) - - @ \defun{npElse}{npElse} @@ -6164,6 +6162,46 @@ and the current token (\$ttok) @ +\defun{npFromdom}{npFromdom} +\calls{npFromdom}{npEqKey} +\calls{npFromdom}{npApplication} +\calls{npFromdom}{npTrap} +\calls{npFromdom}{npFromdom1} +\calls{npFromdom}{npPop1} +\calls{npFromdom}{npPush} +\calls{npFromdom}{pfFromDom} +<>= +(defun |npFromdom| () + (or + (and + (|npEqKey| '$) + (or (|npApplication|) (|npTrap|)) + (|npFromdom1| (|npPop1|)) + (|npPush| (|pfFromDom| (|npPop1|) (|npPop1|)))) + t)) + +@ + +\defun{npFromdom1}{npFromdom1} +\calls{npFromdom1}{npEqKey} +\calls{npFromdom1}{npApplication} +\calls{npFromdom1}{npTrap} +\calls{npFromdom1}{npFromdom1} +\calls{npFromdom1}{npPop1} +\calls{npFromdom1}{npPush} +\calls{npFromdom1}{pfFromDom} +<>= +(defun |npFromdom1| (c) + (or + (and + (|npEqKey| '$) + (or (|npApplication|) (|npTrap|)) + (|npFromdom1| (|npPop1|)) + (|npPush| (|pfFromDom| (|npPop1|) c))) + (|npPush| c))))) + +@ + \defun{npAmpersand}{npAmpersand} \calls{npAmpersand}{npEqKey} \calls{npAmpersand}{npName} @@ -6176,6 +6214,60 @@ and the current token (\$ttok) @ +\defun{npName}{npName} +\calls{npName}{npId} +\calls{npName}{npSymbolVariable} +<>= +(defun |npName| () + (or (|npId|) (|npSymbolVariable|))) + +@ + +\defun{npId}{npId} +\calls{npId}{npPush} +\calls{npId}{npNext} +\calls{npId}{memq} +\calls{npId}{tokConstruct} +\calls{npId}{tokPosn} +\usesdollar{npId}{npTokToNames} +\usesdollar{npId}{ttok} +\usesdollar{npId}{stok} +<>= +(defun |npId| () + (declare (special |$npTokToNames| |$ttok| |$stok|)) + (cond + ((eq (caar |$stok|) '|id|) + (|npPush| |$stok|) + (|npNext|)) + ((and (eq (caar |$stok|) '|key|) (memq |$ttok| |$npTokToNames|)) + (|npPush| (|tokConstruct| '|id| |$ttok| (|tokPosn| |$stok|))) + (|npNext|)) + (t nil))) + +@ + +\defun{npSymbolVariable}{npSymbolVariable} +\calls{npSymbolVariable}{npState} +\calls{npSymbolVariable}{npEqKey} +\calls{npSymbolVariable}{npId} +\calls{npSymbolVariable}{npPop1} +\calls{npSymbolVariable}{npPush} +\calls{npSymbolVariable}{tokConstruct} +\calls{npSymbolVariable}{tokPart} +\calls{npSymbolVariable}{tokPosn} +\calls{npSymbolVariable}{npRestore} +<>= +(defun |npSymbolVariable| () + (let (a) + (setq a (|npState|)) + (cond + ((and (|npEqKey| 'backquote) (|npId|)) + (setq a (|npPop1|)) + (|npPush| (|tokConstruct| '|idsy| (|tokPart| a) (|tokPosn| a)))) + (t (|npRestore| a) nil)))) + +@ + \defun{npRightAssoc}{npRightAssoc} \calls{npRightAssoc}{npState} \calls{npRightAssoc}{npInfGeneric} @@ -6411,6 +6503,26 @@ This was rewritten by NAG to remove flet. @ +\defun{npTrapForm}{npTrapForm} +\throws{npTrapForm}{trappoint} +\calls{npTrapForm}{pfSourceStok} +\calls{npTrapForm}{syGeneralErrorHere} +\calls{npTrapForm}{ncSoftError} +\calls{npTrapForm}{tokPosn} +<>= +(defun |npTrapForm| (x) + (let (a) + (setq a (|pfSourceStok| x)) + (cond + ((eq a '|NoToken|) + (|syGeneralErrorHere|) + (throw 'trappoint 'trapped)) + (t + (|ncSoftError| (|tokPosn| a) 'S2CY0002 nil) + (throw 'trappoint 'trapped))))) + +@ + \defun{npVariable}{npVariable} \calls{npVariable}{npParenthesized} \calls{npVariable}{npVariablelist} @@ -6426,6 +6538,48 @@ This was rewritten by NAG to remove flet. @ +\defun{npParenthesized}{npParenthesized} +\calls{npParenthesized}{npParenthesize} +<>= +(defun |npParenthesized| (f) + (or (|npParenthesize| '|(| '|)| f) (|npParenthesize| '|(\|| '|\|)| f))) + +@ + +\defun{npParenthesize}{npParenthesize} +\calls{npParenthesize}{npEqKey} +\calls{npParenthesize}{npMissingMate} +\calls{npParenthesize}{npPush} +\usesdollar{npParenthesize}{stok} +<>= +(defun |npParenthesize| (open close f) + (let (a) + (declare (special |$stok|)) + (setq a |$stok|) + (cond + ((|npEqKey| open) + (cond + ((and (apply f nil) + (or (|npEqKey| close) + (|npMissingMate| close a))) + t) + ((|npEqKey| close) (|npPush| nil)) + (t (|npMissingMate| close a)))) + (t nil)))) + +@ + +\defun{npMissingMate}{npMissingMate} +\calls{npMissingMate}{ncSoftError} +\calls{npMissingMate}{tokPosn} +\calls{npMissingMate}{npMissing} +<>= +(defun |npMissingMate| (close open) + (|ncSoftError| (|tokPosn| open) 'S2CY0008 nil) + (|npMissing| close)) + +@ + \defun{npExit}{npExit} \calls{npExit}{npBackTrack} \calls{npExit}{npAssign} @@ -6637,6 +6791,20 @@ of the form ('expression expr position) @ +\defun{pfSourceStok}{pfSourceStok} +\calls{pfSourceStok}{pfLeaf?} +\calls{pfSourceStok}{pfParts} +\calls{pfSourceStok}{pfSourceStok} +\calls{pfSourceStok}{pfFirst} +<>= +(defun |pfSourceStok| (x) + (cond + ((|pfLeaf?| x) x) + ((null (|pfParts| x)) '|NoToken|) + (t (|pfSourceStok| (|pfFirst| x))))) + +@ + \defun{pfTransformArg}{pfTransformArg} \calls{pfTransformArg}{pfTuple?} \calls{pfTransformArg}{pf0TupleParts} @@ -7222,6 +7390,23 @@ of the form ('expression expr position) @ +\defun{pfFromDom}{pfFromDom} +\calls{pfFromDom}{pfApplication?} +\calls{pfFromDom}{pfApplication} +\calls{pfFromDom}{pfApplicationOp} +\calls{pfFromDom}{pfApplicationArg} +\calls{pfFromDom}{pfFromDom} +<>= +(defun |pfFromDom| (dom expr) + (cond + ((|pfApplication?| expr) + (|pfApplication| + (|pfFromdom| (|pfApplicationOp| expr) dom) + (|pfApplicationArg| expr))) + (t (|pfFromdom| expr dom)))) + +@ + \defun{pfFromdom?}{Is this a Fromdom mode?} \calls{pfFromdom?}{pfAbSynOp?} <>= @@ -36602,7 +36787,10 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> +<> <> +<> <> <> <> @@ -36614,9 +36802,13 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> +<> <> <> +<> +<> <> <> <> @@ -36644,10 +36836,12 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> <> +<> <> <> <> @@ -36720,6 +36914,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> @@ -36799,6 +36994,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> diff --git a/changelog b/changelog index bcafd11..b3bd0d7 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,9 @@ +20100218 tpd src/axiom-website/patches.html 20100218.02.tpd.patch +20100218 tpd src/interp/serror.lisp merge with bookvol5, removed. +20100218 tpd src/interp/ptrees.lisp treeshake +20100218 tpd src/interp/cparse.lisp treeshake +20100218 tpd src/interp/Makefile remove serror +20100218 tpd books/bookvol5 treeshake cparse, ptrees, remove serror 20100218 tpd src/axiom-website/patches.html 20100218.01.tpd.patch 20100218 tpd src/input/pmint.input update pmint with code 20100217 tpd src/axiom-website/patches.html 20100217.01.tpd.patch diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index e3ede79..ed37f8d 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -2469,5 +2469,7 @@ books/bookvol5 treeshake cparse posit serror
books/bookvol5 treeshake cparse, ptrees
20100218.01.tpd.patch src/input/pmint.input update pmint with code
+20100218.02.tpd.patch +books/bookvol5 treeshake cparse, ptrees, remove serror
diff --git a/src/interp/Makefile.pamphlet b/src/interp/Makefile.pamphlet index 2a815a2..0ec52fa 100644 --- a/src/interp/Makefile.pamphlet +++ b/src/interp/Makefile.pamphlet @@ -173,7 +173,6 @@ OBJS= ${OUT}/vmlisp.${O} \ ${OUT}/ptrees.${O} ${OUT}/ptrop.${O} \ ${OUT}/record.${O} ${OUT}/regress.${O} \ ${OUT}/rulesets.${O} \ - ${OUT}/serror.${O} \ ${OUT}/server.${O} \ ${OUT}/sfsfun-l.${O} ${OUT}/sfsfun.${O} \ ${OUT}/simpbool.${O} ${OUT}/slam.${O} \ @@ -3228,29 +3227,6 @@ ${MID}/ptrop.lisp: ${IN}/ptrop.lisp.pamphlet @ -\subsection{serror.lisp} -<>= -${OUT}/serror.${O}: ${MID}/serror.lisp - @ echo 136 making ${OUT}/serror.${O} from ${MID}/serror.lisp - @ ( cd ${MID} ; \ - if [ -z "${NOISE}" ] ; then \ - echo '(progn (compile-file "${MID}/serror.lisp"' \ - ':output-file "${OUT}/serror.${O}") (${BYE}))' | ${DEPSYS} ; \ - else \ - echo '(progn (compile-file "${MID}/serror.lisp"' \ - ':output-file "${OUT}/serror.${O}") (${BYE}))' | ${DEPSYS} \ - >${TMP}/trace ; \ - fi ) - -@ -<>= -${MID}/serror.lisp: ${IN}/serror.lisp.pamphlet - @ echo 137 making ${MID}/serror.lisp from ${IN}/serror.lisp.pamphlet - @ (cd ${MID} ; \ - ${TANGLE} ${IN}/serror.lisp.pamphlet >serror.lisp ) - -@ - \subsection{posit.lisp} <>= ${OUT}/posit.${O}: ${MID}/posit.lisp @@ -3943,9 +3919,6 @@ clean: <> <> -<> -<> - <> <> diff --git a/src/interp/cparse.lisp.pamphlet b/src/interp/cparse.lisp.pamphlet index 9f2207e..d6ba479 100644 --- a/src/interp/cparse.lisp.pamphlet +++ b/src/interp/cparse.lisp.pamphlet @@ -12,50 +12,6 @@ <<*>>= (IN-PACKAGE "BOOT") -; -;-- npTerm introduced between npRemainder and npSum -;-- rhs of assignment changed from npStatement to npGives -; - -;npPushId()== -; a:=GET($ttok,'INFGENERIC) -; $ttok:= if a then a else $ttok -; $stack:=CONS(tokConstruct("id",$ttok,tokPosn $stok),$stack) -; npNext() - -;npParenthesized f== -; npParenthesize("(",")",f) or -; npParenthesize("(|","|)",f) -(DEFUN |npParenthesized| (|f|) - (PROG NIL - (RETURN - (OR - (|npParenthesize| (QUOTE |(|) (QUOTE |)|) |f|) - (|npParenthesize| (QUOTE |(\||) (QUOTE |\|)|) |f|))))) - -;npParenthesize (open,close,f)== -; a:=$stok -; npEqKey open => -; APPLY(f,nil) and (npEqKey close or npMissingMate(close,a))=> true -; npEqKey close => npPush [] -; npMissingMate(close,a) -; false -(DEFUN |npParenthesize| (|open| |close| |f|) - (PROG (|a|) - (DECLARE (SPECIAL |$stok|)) - (RETURN - (PROGN - (SETQ |a| |$stok|) - (COND - ((|npEqKey| |open|) - (COND - ((AND - (APPLY |f| NIL) - (OR (|npEqKey| |close|) (|npMissingMate| |close| |a|))) - T) - ((|npEqKey| |close|) (|npPush| NIL)) - (#0=(QUOTE T) (|npMissingMate| |close| |a|)))) - (#0# NIL)))))) ;npEnclosed(open,close,fn,f)== ; a:=$stok @@ -279,53 +235,6 @@ (QUOTE |[\|\|]|) (QUOTE |{\|\|}|)))) -;npId() == -; EQ(CAAR $stok,"id") => -; npPush $stok -; npNext() -; EQ(CAAR $stok,"key") and MEMQ($ttok,$npTokToNames)=> -; npPush tokConstruct("id",$ttok,tokPosn $stok) -; npNext() -; false -(DEFUN |npId| () - (PROG NIL - (DECLARE (SPECIAL |$npTokToNames| |$ttok| |$stok|)) - (RETURN - (COND - ((EQ (CAAR |$stok|) (QUOTE |id|)) - (PROGN (|npPush| |$stok|) (|npNext|))) - ((AND (EQ (CAAR |$stok|) (QUOTE |key|)) (MEMQ |$ttok| |$npTokToNames|)) - (PROGN - (|npPush| (|tokConstruct| (QUOTE |id|) |$ttok| (|tokPosn| |$stok|))) - (|npNext|))) - ((QUOTE T) NIL))))) - -;npSymbolVariable()== -; a:=npState() -; npEqKey "BACKQUOTE" and npId() => -; a:=npPop1() -; npPush tokConstruct("idsy",tokPart a,tokPosn a) -; npRestore a -; false -(DEFUN |npSymbolVariable| () - (PROG (|a|) - (RETURN - (PROGN - (SETQ |a| (|npState|)) - (COND - ((AND (|npEqKey| (QUOTE BACKQUOTE)) (|npId|)) - (PROGN - (SETQ |a| (|npPop1|)) - (|npPush| - (|tokConstruct| (QUOTE |idsy|) (|tokPart| |a|) (|tokPosn| |a|))))) - ((QUOTE T) (PROGN (|npRestore| |a|) NIL))))))) - -;npName()==npId() or npSymbolVariable() -(DEFUN |npName| () - (PROG NIL - (RETURN - (OR (|npId|) (|npSymbolVariable|))))) - ;npConstTok() == ; MEMQ(tokType $stok, '(integer string char float command)) => ; npPush $stok @@ -438,37 +347,6 @@ (|npBDefinition|) (|npPush| (|pfApplication| (|npPop2|) (|npPop1|))))))) -;npFromdom()== -; npEqKey "$" and (npApplication() or npTrap()) -; and npFromdom1 npPop1() and npPush pfFromDom(npPop1(),npPop1()) -; or true -(DEFUN |npFromdom| () - (PROG NIL - (RETURN - (OR - (AND - (|npEqKey| (QUOTE $)) - (OR (|npApplication|) (|npTrap|)) - (|npFromdom1| (|npPop1|)) - (|npPush| (|pfFromDom| (|npPop1|) (|npPop1|)))) - T)))) - -;npFromdom1 c== -; npEqKey "$" and (npApplication() or npTrap()) -; and npFromdom1 npPop1() and npPush pfFromDom(npPop1(),c) -; or npPush c -(DEFUN |npFromdom1| (|c|) - (PROG NIL - (RETURN - (OR - (AND - (|npEqKey| (QUOTE $)) - (OR (|npApplication|) (|npTrap|)) - (|npFromdom1| (|npPop1|)) - (|npPush| (|pfFromDom| (|npPop1|) |c|))) - (|npPush| |c|))))) - -; ;npPrimary()== npPrimary1() or npPrimary2() (DEFUN |npPrimary| () (PROG NIL diff --git a/src/interp/ptrees.lisp.pamphlet b/src/interp/ptrees.lisp.pamphlet index e5ec6ff..e9f5692 100644 --- a/src/interp/ptrees.lisp.pamphlet +++ b/src/interp/ptrees.lisp.pamphlet @@ -58,23 +58,6 @@ (SETQ |bfVar#1| (CDR |bfVar#1|)))) NIL (|pfParts| |name|) NIL)))) -;pfFromDom(dom,expr)== -; if pfApplication? expr -; then pfApplication(pfFromdom(pfApplicationOp expr,dom), -; pfApplicationArg expr) -; else pfFromdom(expr,dom) -; - -(DEFUN |pfFromDom| (|dom| |expr|) - (PROG () - (RETURN - (COND - ((|pfApplication?| |expr|) - (|pfApplication| - (|pfFromdom| (|pfApplicationOp| |expr|) |dom|) - (|pfApplicationArg| |expr|))) - ('T (|pfFromdom| |expr| |dom|)))))) - ;pfLp(iterators,body)== ; pfLoop pfListOf [:iterators,pfDo body] diff --git a/src/interp/serror.lisp.pamphlet b/src/interp/serror.lisp.pamphlet deleted file mode 100644 index 9caf734..0000000 --- a/src/interp/serror.lisp.pamphlet +++ /dev/null @@ -1,75 +0,0 @@ -\documentclass{article} -\usepackage{axiom} -\begin{document} -\title{\$SPAD/src/interp serror.lisp} -\author{The Axiom Team} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject -<<*>>= - -(IN-PACKAGE "BOOT") - -;--% Functions to handle specific errors (mostly syntax) - -;npMissingMate(close,open)== -; ncSoftError(tokPosn open, 'S2CY0008, []) -; npMissing close - -(DEFUN |npMissingMate| (|close| |open|) - (PROG () - (RETURN - (PROGN - (|ncSoftError| (|tokPosn| |open|) 'S2CY0008 NIL) - (|npMissing| |close|))))) - -;npMissing s== -; ncSoftError(tokPosn $stok,'S2CY0007, [PNAME s]) -; THROW("TRAPPOINT","TRAPPED") - - -;pfSourceStok x== -; if pfLeaf? x -; then x -; else if null pfParts x -; then 'NoToken -; else pfSourceStok pfFirst x - -(DEFUN |pfSourceStok| (|x|) - (PROG () - (RETURN - (COND - ((|pfLeaf?| |x|) |x|) - ((NULL (|pfParts| |x|)) '|NoToken|) - ('T (|pfSourceStok| (|pfFirst| |x|))))))) - -;npTrapForm(x)== -; a:=pfSourceStok x -; EQ(a,'NoToken)=> -; syGeneralErrorHere() -; THROW("TRAPPOINT","TRAPPED") -; ncSoftError(tokPosn a, 'S2CY0002, []) -; THROW("TRAPPOINT","TRAPPED") - -(DEFUN |npTrapForm| (|x|) - (PROG (|a|) - (RETURN - (PROGN - (SETQ |a| (|pfSourceStok| |x|)) - (COND - ((EQ |a| '|NoToken|) - (PROGN (|syGeneralErrorHere|) (THROW 'TRAPPOINT 'TRAPPED))) - ('T - (PROGN - (|ncSoftError| (|tokPosn| |a|) 'S2CY0002 NIL) - (THROW 'TRAPPOINT 'TRAPPED)))))))) - -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document}