diff --git a/books/bookvol9.pamphlet b/books/bookvol9.pamphlet index 794814c..f86c81e 100644 --- a/books/bookvol9.pamphlet +++ b/books/bookvol9.pamphlet @@ -8238,6 +8238,11 @@ of the symbol being parsed. The original list read: \end{chunk} \defun{postCollect,finish}{postCollect,finish} +\calls{postCollect,finish}{qcar} +\calls{postCollect,finish}{qcdr} +\calls{postCollect,finish}{postMakeCons} +\calls{postCollect,finish}{tuple2List} +\calls{postCollect,finish}{postTranList} \begin{chunk}{defun postCollect,finish} (defun |postCollect,finish| (op itl y) (let (tmp2 tmp5 newBody) @@ -11375,6 +11380,40 @@ Stack of results of reduced productions. \chapter{Utility Functions} +\defun{tuple2List}{tuple2List} +\calls{tuple2List}{tuple2List} +\calls{tuple2List}{postTranSegment} +\calls{tuple2List}{postTran} +\usesdollar{tuple2List}{boot} +\usesdollar{tuple2List}{InteractiveMode} +\begin{chunk}{defun tuple2List} +(defun |tuple2List| (arg) + (let (u p tmp2 q) + (declare (special |$InteractiveMode| $boot)) + (when (pairp arg) + (setq u (|tuple2List| (qcdr arg))) + (cond + ((and (pairp (qcar arg)) (eq (qcar (qcar arg)) 'segment) + (pairp (qcdr (qcar arg))) + (pairp (qcdr (qcdr (qcar arg)))) + (eq (qcdr (qcdr (qcdr (qcar arg)))) nil)) + (setq p (qcar (qcdr (qcar arg)))) + (setq q (qcar (qcdr (qcdr (qcar arg))))) + (cond + ((null u) (list '|construct| (|postTranSegment| p q))) + ((and |$InteractiveMode| (null $boot)) + (cons '|append| + (cons (list '|construct| (|postTranSegment| p q)) + (list (|tuple2List| (qcdr arg)))))) + (t + (cons '|nconc| + (cons (list '|construct| (|postTranSegment| p q)) + (list (|tuple2List| (qcdr arg)))))))) + ((null u) (list '|construct| (|postTran| (qcar arg)))) + (t (list '|cons| (|postTran| (qcar arg)) (|tuple2List| (qcdr arg)))))))) + +\end{chunk} + \defmacro{pop-stack-1} \calls{pop-stack-1}{reduction-value} \calls{pop-stack-1}{Pop-Reduction} @@ -14683,6 +14722,7 @@ if \verb|$InteractiveMode| then use a null outputstream \getchunk{defun token-install} \getchunk{defun token-print} \getchunk{defun try-get-token} +\getchunk{defun tuple2List} \getchunk{defun underscore} \getchunk{defun unget-tokens} diff --git a/changelog b/changelog index 7f5539d..7441ffe 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +20110228 tpd src/axiom-website/patches.html 20110228.05.tpd.patch +20110228 tpd src/interp/parsing.lisp treeshake compiler +20110228 tpd books/bookvol9 treeshake compiler 20110228 tpd src/axiom-website/patches.html 20110228.04.tpd.patch 20110228 tpd books/bookvol5 add trapNumericErrors 20110228 tpd src/axiom-website/patches.html 20110228.03.tpd.patch diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index a022519..dad82c0 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -3413,5 +3413,7 @@ books/tangle.lisp fix help file extraction
books/bookvol9 fix special declaration for lines in preparse1
20110228.04.tpd.patch books/bookvol5 add trapNumericErrors
+20110228.05.tpd.patch +books/bookvol9 treeshake compiler
diff --git a/src/interp/parsing.lisp.pamphlet b/src/interp/parsing.lisp.pamphlet index d2c254f..f7c4421 100644 --- a/src/interp/parsing.lisp.pamphlet +++ b/src/interp/parsing.lisp.pamphlet @@ -1758,21 +1758,7 @@ parse ;;; *** |postTranSegment| REDEFINED (DEFUN |postTranSegment| (|p| |q|) (CONS (QUOTE SEGMENT) (CONS (|postTran| |p|) (CONS (COND (|q| (|postTran| |q|)) ((QUOTE T) NIL)) NIL)))) -;tuple2List l == -; l is [a,:l'] => -; u:= tuple2List l' -; a is ['SEGMENT,p,q] => -; null u => ['construct,postTranSegment(p,q)] -; $InteractiveMode and null $BOOT => -; ['append,['construct,postTranSegment(p,q)],tuple2List l'] -; ["nconc",['construct,postTranSegment(p,q)],tuple2List l'] -; null u => ['construct,postTran a] -; ["cons",postTran a,tuple2List l'] -; nil - -;;; *** |tuple2List| REDEFINED - -(DEFUN |tuple2List| (|l|) (PROG (|a| |l'| |u| |ISTMP#1| |p| |ISTMP#2| |q|) (RETURN (COND ((AND (PAIRP |l|) (PROGN (SPADLET |a| (QCAR |l|)) (SPADLET |l'| (QCDR |l|)) (QUOTE T))) (SPADLET |u| (|tuple2List| |l'|)) (COND ((AND (PAIRP |a|) (EQ (QCAR |a|) (QUOTE SEGMENT)) (PROGN (SPADLET |ISTMP#1| (QCDR |a|)) (AND (PAIRP |ISTMP#1|) (PROGN (SPADLET |p| (QCAR |ISTMP#1|)) (SPADLET |ISTMP#2| (QCDR |ISTMP#1|)) (AND (PAIRP |ISTMP#2|) (EQ (QCDR |ISTMP#2|) NIL) (PROGN (SPADLET |q| (QCAR |ISTMP#2|)) (QUOTE T))))))) (COND ((NULL |u|) (CONS (QUOTE |construct|) (CONS (|postTranSegment| |p| |q|) NIL))) ((AND |$InteractiveMode| (NULL $BOOT)) (CONS (QUOTE |append|) (CONS (CONS (QUOTE |construct|) (CONS (|postTranSegment| |p| |q|) NIL)) (CONS (|tuple2List| |l'|) NIL)))) ((QUOTE T) (CONS (QUOTE |nconc|) (CONS (CONS (QUOTE |construct|) (CONS (|postTranSegment| |p| |q|) NIL)) (CONS (|tuple2List| |l'|) NIL)))))) ((NULL |u|) (CONS (QUOTE |construct|) (CONS (|postTran| |a|) NIL))) ((QUOTE T) (CONS (QUOTE |cons|) (CONS (|postTran| |a|) (CONS (|tuple2List| |l'|) NIL)))))) ((QUOTE T) NIL))))) + ;SEGMENT(a,b) == [i for i in a..b] ;;; *** SEGMENT REDEFINED