diff --git a/books/bookvol9.pamphlet b/books/bookvol9.pamphlet index 9663d36..efb4172 100644 --- a/books/bookvol9.pamphlet +++ b/books/bookvol9.pamphlet @@ -8375,6 +8375,38 @@ of the symbol being parsed. The original list read: \end{chunk} +\defun{postBlockItem}{postBlockItem} +\calls{postBlockItem}{postTran} +\begin{chunk}{defun postBlockItem} +(defun |postBlockItem| (x) + (let ((tmp1 t) tmp2 y tt z) + (setq x (|postTran| x)) + (if + (and (pairp x) (eq (qcar x) '|@Tuple|) + (progn + (and (pairp (qcdr x)) + (progn (setq tmp2 (reverse (qcdr x))) t) + (pairp tmp2) + (progn + (and (pairp (qcar tmp2)) (eq (qcar (qcar tmp2)) '|:|) + (progn + (and (pairp (qcdr (qcar tmp2))) + (progn + (setq y (qcar (qcdr (qcar tmp2)))) + (and (pairp (qcdr (qcdr (qcar tmp2)))) + (eq (qcdr (qcdr (qcdr (qcar tmp2)))) nil) + (progn (setq tt (qcar (qcdr (qcdr (qcar tmp2))))) t))))))) + (progn (setq z (qcdr tmp2)) t) + (progn (setq z (nreverse z)) T))) + (do ((tmp6 nil (null tmp1)) (tmp7 z (cdr tmp7)) (x nil)) + ((or tmp6 (atom tmp7)) tmp1) + (setq x (car tmp7)) + (setq tmp1 (and tmp1 (identp x))))) + (cons '|:| (cons (cons 'listof (append z (list y))) (list tt))) + x))) + +\end{chunk} + \defplist{@}{postAtSign} \begin{chunk}{postvars} (eval-when (eval load) @@ -9182,6 +9214,15 @@ of the symbol being parsed. The original list read: \end{chunk} +\defun{removeSuperfluousMapping}{removeSuperfluousMapping} +\begin{chunk}{defun removeSuperfluousMapping} +(defun |removeSuperfluousMapping| (sig1) + (if (and (pairp sig1) (pairp (qcar sig1)) (eq (qcar (qcar sig1)) '|Mapping|)) + (cons (cdr (qcar sig1)) (qcdr sig1)) + sig1)) + +\end{chunk} + \defun{killColons}{killColons} \calls{killColons}{killColons} \begin{chunk}{defun killColons} @@ -15362,6 +15403,7 @@ if \verb|$InteractiveMode| then use a null outputstream \getchunk{defun postAtSign} \getchunk{defun postBigFloat} \getchunk{defun postBlock} +\getchunk{defun postBlockItem} \getchunk{defun postBlockItemList} \getchunk{defun postCapsule} \getchunk{defun postCategory} @@ -15420,6 +15462,7 @@ if \verb|$InteractiveMode| then use a null outputstream \getchunk{defun read-a-line} \getchunk{defun recompile-lib-file-if-necessary} \getchunk{defun /rf-1} +\getchunk{defun removeSuperfluousMapping} \getchunk{defun /RQ,LIB} \getchunk{defun setDefOp} diff --git a/changelog b/changelog index 06a1e8e..b9159ff 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +20110513 tpd src/axiom-website/patches.html 20110513.01.tpd.patch +20110513 tpd src/interp/parsing.lisp treeshake compiler +20110513 tpd books/bookvol9 treeshake compiler 20110511 tpd src/axiom-website/patches.html 20110511.01.tpd.patch 20110511 tpd src/interp/parsing.lisp treeshake interpreter 20110511 tpd books/bookvol5 treeshake interpreter diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 49e68de..241a224 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -3468,5 +3468,7 @@ books/bookvol5 treeshake interpreter
books/bookvol5 treeshake interpreter
20110511.01.tpd.patch books/bookvol5 treeshake interpreter
+20110513.01.tpd.patch +books/bookvol9 treeshake compiler
diff --git a/src/interp/parsing.lisp.pamphlet b/src/interp/parsing.lisp.pamphlet index db4c9bc..04a9cd6 100644 --- a/src/interp/parsing.lisp.pamphlet +++ b/src/interp/parsing.lisp.pamphlet @@ -1246,97 +1246,6 @@ parse ; ;;;Boot translation finished for parse.boot -;postBlockItem x == -; x:= postTran x -; x is ['Tuple,:l,[":",y,t]] and (and/[IDENTP x for x in l]) => -; [":",['LISTOF,:l,y],t] -; x - -;;; *** |postBlockItem| REDEFINED - -(DEFUN |postBlockItem| (|x|) (PROG (|ISTMP#1| |ISTMP#2| |ISTMP#3| |ISTMP#4| |y| |ISTMP#5| |t| |l|) (RETURN (SEQ (PROGN (SPADLET |x| (|postTran| |x|)) (COND ((AND (PAIRP |x|) (EQ (QCAR |x|) (QUOTE |@Tuple|)) (PROGN (SPADLET |ISTMP#1| (QCDR |x|)) (AND (PAIRP |ISTMP#1|) (PROGN (SPADLET |ISTMP#2| (REVERSE |ISTMP#1|)) (QUOTE T)) (PAIRP |ISTMP#2|) (PROGN (SPADLET |ISTMP#3| (QCAR |ISTMP#2|)) (AND (PAIRP |ISTMP#3|) (EQ (QCAR |ISTMP#3|) (QUOTE |:|)) (PROGN (SPADLET |ISTMP#4| (QCDR |ISTMP#3|)) (AND (PAIRP |ISTMP#4|) (PROGN (SPADLET |y| (QCAR |ISTMP#4|)) (SPADLET |ISTMP#5| (QCDR |ISTMP#4|)) (AND (PAIRP |ISTMP#5|) (EQ (QCDR |ISTMP#5|) NIL) (PROGN (SPADLET |t| (QCAR |ISTMP#5|)) (QUOTE T)))))))) (PROGN (SPADLET |l| (QCDR |ISTMP#2|)) (QUOTE T)) (PROGN (SPADLET |l| (NREVERSE |l|)) (QUOTE T)))) (PROG (#0=#:G166534) (SPADLET #0# (QUOTE T)) (RETURN (DO ((#1=#:G166540 NIL (NULL #0#)) (#2=#:G166541 |l| (CDR #2#)) (|x| NIL)) ((OR #1# (ATOM #2#) (PROGN (SETQ |x| (CAR #2#)) NIL)) #0#) (SEQ (EXIT (SETQ #0# (AND #0# (IDENTP |x|))))))))) (CONS (QUOTE |:|) (CONS (CONS (QUOTE LISTOF) (APPEND |l| (CONS |y| NIL))) (CONS |t| NIL)))) ((QUOTE T) |x|))))))) -;postElt (u is [.,a,b]) == -; a:= postTran a -; b is ['Sequence,:.] => [['elt,a,'makeRecord],:postTranList rest b] -; ['elt,a,postTran b] - -;;; *** |postElt| REDEFINED - -(DEFUN |postElt| (|u|) (PROG (|b| |a|) (RETURN (PROGN (SPADLET |a| (CADR |u|)) (SPADLET |b| (CADDR |u|)) (SPADLET |a| (|postTran| |a|)) (COND ((AND (PAIRP |b|) (EQ (QCAR |b|) (QUOTE |Sequence|))) (CONS (CONS (QUOTE |elt|) (CONS |a| (CONS (QUOTE |makeRecord|) NIL))) (|postTranList| (CDR |b|)))) ((QUOTE T) (CONS (QUOTE |elt|) (CONS |a| (CONS (|postTran| |b|) NIL))))))))) -;postForm (u is [op,:argl]) == -; x:= -; atom op => -; argl':= postTranList argl -; op':= -; true=> op -; $BOOT => op -; GET(op,'Led) or GET(op,'Nud) or op = 'IN => op -; numOfArgs:= (argl' is [['Tuple,:l]] => #l; 1) -; INTERNL("*",STRINGIMAGE numOfArgs,PNAME op) -; [op',:argl'] -; op is ['Scripts,:.] => [:postTran op,:postTranList argl] -; u:= postTranList u -; if u is [['Tuple,:.],:.] then -; postError ['" ",:bright u, -; '"is illegal because tuples cannot be applied!",'%l, -; '" Did you misuse infix dot?"] -; u -; x is [.,['Tuple,:y]] => [first x,:y] -; x - -;;; *** |postForm| REDEFINED - -;postSEGMENT ['SEGMENT,a,b] == -; key:= [a,'"..",:(b => [b]; nil)] -; postError ['" Improper placement of segment",:bright key] - -;;; *** |postSEGMENT| REDEFINED - -(DEFUN |postSEGMENT| (#0=#:G167266) (PROG (|a| |b| |key|) (RETURN (PROGN (SPADLET |a| (CADR #0#)) (SPADLET |b| (CADDR #0#)) (SPADLET |key| (CONS |a| (CONS ".." (COND (|b| (CONS |b| NIL)) ((QUOTE T) NIL))))) (|postError| (CONS " Improper placement of segment" (|bright| |key|))))))) -;postCollect [constructOp,:m,x] == -; x is [['elt,D,'construct],:y] => -; postCollect [['elt,D,'COLLECT],:m,['construct,:y]] -; itl:= postIteratorList m -; x:= (x is ['construct,r] => r; x) --added 84/8/31 -; y:= postTran x -; finish(constructOp,itl,y) where -; finish(op,itl,y) == -; y is [":",a] => ['REDUCE,'append,0,[op,:itl,a]] -; y is ['Tuple,:l] => -; newBody:= -; or/[x is [":",y] for x in l] => postMakeCons l -; or/[x is ['SEGMENT,:.] for x in l] => tuple2List l -; ['construct,:postTranList l] -; ['REDUCE,'append,0,[op,:itl,newBody]] -; [op,:itl,y] - -;SEGMENT(a,b) == [i for i in a..b] - -;;; *** SEGMENT REDEFINED - -(DEFUN SEGMENT (|a| |b|) (PROG NIL (RETURN (SEQ (PROG (#0=#:G167597) (SPADLET #0# NIL) (RETURN (DO ((|i| |a| (+ |i| 1))) ((> |i| |b|) (NREVERSE0 #0#)) (SEQ (EXIT (SETQ #0# (CONS |i| #0#))))))))))) -;postSequence ['Sequence,:l] == ['(elt $ makeRecord),:postTranList l] - -;;; *** |postSequence| REDEFINED - -(DEFUN |postSequence| (#0=#:G167652) (PROG (|l|) (RETURN (PROGN (SPADLET |l| (CDR #0#)) (CONS (QUOTE (|elt| $ |makeRecord|)) (|postTranList| |l|)))))) -;--------------------> NEW DEFINITION (see br-saturn.boot.pamphlet) -;removeSuperfluousMapping sig1 == -; --get rid of this asap -; sig1 is [x,:y] and x is ['Mapping,:.] => [rest x,:y] -; sig1 - -;;; *** |removeSuperfluousMapping| REDEFINED - -(DEFUN |removeSuperfluousMapping| (|sig1|) (PROG (|x| |y|) (RETURN (COND ((AND (PAIRP |sig1|) (PROGN (SPADLET |x| (QCAR |sig1|)) (SPADLET |y| (QCDR |sig1|)) (QUOTE T)) (PAIRP |x|) (EQ (QCAR |x|) (QUOTE |Mapping|))) (CONS (CDR |x|) |y|)) ((QUOTE T) |sig1|))))) -;--u is ['Tuple,:l,a] => (--a:= postTran a; ['Tuple,:postTranList rest u]) -; --RDJ: don't understand need for above statement that is commented out -;isPackageType x == not CONTAINED("$",x) - -;;; *** |isPackageType| REDEFINED - -(DEFUN |isPackageType| (|x|) (NULL (CONTAINED (QUOTE $) |x|))) -;--% APL TRANSFORMATION OF INPUT \end{chunk} \eject \begin{thebibliography}{99}