diff --git a/books/bookvol9.pamphlet b/books/bookvol9.pamphlet index 257677b..25b1a11 100644 --- a/books/bookvol9.pamphlet +++ b/books/bookvol9.pamphlet @@ -1616,8 +1616,10 @@ Symbolics read-line returns embedded newlines in a c-m-Y.") @ \defun{aplTran}{aplTran} -\calls{aplTran}{} -\usesdollar{aplTran}{} +\calls{aplTran}{aplTran1} +\calls{aplTran}{containsBang} +\usesdollar{aplTran}{genno} +\usesdollar{aplTran}{boot} <>= (defun |aplTran| (x) (let ($genno u) @@ -1704,6 +1706,56 @@ Symbolics read-line returns embedded newlines in a c-m-Y.") @ +\defun{aplTranList}{aplTranList} +\calls{aplTranList}{aplTran1} +\calls{aplTranList}{aplTranList} +<>= +(defun |aplTranList| (x) + (if (atom x) + x + (cons (|aplTran1| (car x)) (|aplTranList| (cdr x))))) + +@ + +\defun{hasAplExtension}{hasAplExtension} +\calls{hasAplExtension}{nreverse0} +\calls{hasAplExtension}{deepestExpression} +\calls{hasAplExtension}{genvar} +\calls{hasAplExtension}{aplTran1} +\calls{hasAplExtension}{msubst} +<>= +(defun |hasAplExtension| (argl) + (let (tmp2 tmp3 y z g arglAssoc u) + (when + (dolist (x argl tmp2) + (setq tmp2 (or tmp2 (and (pairp x) (eq (qcar x) '!))))) + (setq u + (dolist (x argl (nreverse0 tmp3)) + (push + (if (and (pairp x) (eq (qcar x) '!) + (pairp (qcdr x)) (eq (qcdr (qcdr x)) nil)) + (progn + (setq y (qcar (qcdr x))) + (setq z (|deepestExpression| y)) + (setq arglAssoc + (cons (cons (setq g (genvar)) (|aplTran1| z)) arglAssoc)) + (msubst g z y)) + x) + tmp3))) + (cons arglAssoc u)))) + +@ + +\defun{deepestExpression}{deepestExpression} +\calls{deepestExpression}{deepestExpression} +<>= +(defun |deepestExpression| (x) + (if (and (pairp x) (eq (qcar x) '!) + (pairp (qcdr x)) (eq (qcdr (qcdr x)) nil)) + (|deepestExpression| (qcar (qcdr x))) + x)) + +@ \chapter{The Compiler} @@ -4767,6 +4819,7 @@ if \verb|$InteractiveMode| then use a null outputstream <> <> +<> <> <> @@ -4809,12 +4862,15 @@ if \verb|$InteractiveMode| then use a null outputstream <> <> +<> + <> <> <> +<> <> <> diff --git a/changelog b/changelog index 2446fef..bae4356 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +20101006 tpd src/axiom-website/patches.html 20101006.02.tpd.patch +20101006 tpd src/interp/parsing.lisp treeshake compiler +20101006 tpd books/bookvol9 treeshake compiler 20101006 tpd src/axiom-website/patches.html 20101006.01.tpd.patch 20101006 tpd src/interp/parsing.lisp treeshake compiler 20101006 tpd books/bookvol9 treeshake compiler diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index be8a276..3103f5e 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -3194,5 +3194,7 @@ books/bookvol9 treeshake compiler
books/bookvol6 add a research ideas section
20101006.01.tpd.patch books/bookvol9 treeshake compiler
+20101006.02.tpd.patch +books/bookvol9 treeshake compiler
diff --git a/src/interp/parsing.lisp.pamphlet b/src/interp/parsing.lisp.pamphlet index 10f04ae..7f6f438 100644 --- a/src/interp/parsing.lisp.pamphlet +++ b/src/interp/parsing.lisp.pamphlet @@ -4591,34 +4591,6 @@ parse ;;; *** |containsBang| REDEFINED (DEFUN |containsBang| (|u|) (PROG (|ISTMP#1|) (RETURN (SEQ (COND ((ATOM |u|) (EQ |u| (QUOTE !))) ((AND (PAIRP |u|) (EQUAL (QCAR |u|) (QUOTE QUOTE)) (PROGN (SPADLET |ISTMP#1| (QCDR |u|)) (AND (PAIRP |ISTMP#1|) (EQ (QCDR |ISTMP#1|) NIL)))) NIL) ((QUOTE T) (PROG (#0=#:G167897) (SPADLET #0# NIL) (RETURN (DO ((#1=#:G167903 NIL #0#) (#2=#:G167904 |u| (CDR #2#)) (|x| NIL)) ((OR #1# (ATOM #2#) (PROGN (SETQ |x| (CAR #2#)) NIL)) #0#) (SEQ (EXIT (SETQ #0# (OR #0# (|containsBang| |x|)))))))))))))) -;aplTranList x == -; atom x => x -; [aplTran1 first x,:aplTranList rest x] - -;;; *** |aplTranList| REDEFINED - -(DEFUN |aplTranList| (|x|) (COND ((ATOM |x|) |x|) ((QUOTE T) (CONS (|aplTran1| (CAR |x|)) (|aplTranList| (CDR |x|)))))) -;hasAplExtension argl == -; or/[x is ["_!",:.] for x in argl] => -; u:= [futureArg for x in argl] where futureArg == -; x is ["_!",y] => -; z:= deepestExpression y -; arglAssoc := [[g := GENVAR(),:aplTran1 z],:arglAssoc] -; substitute(g,z,y) -; x -; [arglAssoc,:u] -; nil - -;;; *** |hasAplExtension| REDEFINED - -(DEFUN |hasAplExtension| (|argl|) (PROG (|ISTMP#1| |y| |z| |g| |arglAssoc| |u|) (RETURN (SEQ (COND ((PROG (#0=#:G167999) (SPADLET #0# NIL) (RETURN (DO ((#1=#:G168005 NIL #0#) (#2=#:G168006 |argl| (CDR #2#)) (|x| NIL)) ((OR #1# (ATOM #2#) (PROGN (SETQ |x| (CAR #2#)) NIL)) #0#) (SEQ (EXIT (SETQ #0# (OR #0# (AND (PAIRP |x|) (EQ (QCAR |x|) (QUOTE !)))))))))) (SPADLET |u| (PROG (#3=#:G168021) (SPADLET #3# NIL) (RETURN (DO ((#4=#:G168030 |argl| (CDR #4#)) (|x| NIL)) ((OR (ATOM #4#) (PROGN (SETQ |x| (CAR #4#)) NIL)) (NREVERSE0 #3#)) (SEQ (EXIT (SETQ #3# (CONS (COND ((AND (PAIRP |x|) (EQ (QCAR |x|) (QUOTE !)) (PROGN (SPADLET |ISTMP#1| (QCDR |x|)) (AND (PAIRP |ISTMP#1|) (EQ (QCDR |ISTMP#1|) NIL) (PROGN (SPADLET |y| (QCAR |ISTMP#1|)) (QUOTE T))))) (SPADLET |z| (|deepestExpression| |y|)) (SPADLET |arglAssoc| (CONS (CONS (SPADLET |g| (GENVAR)) (|aplTran1| |z|)) |arglAssoc|)) (MSUBST |g| |z| |y|)) ((QUOTE T) |x|)) #3#)))))))) (CONS |arglAssoc| |u|)) ((QUOTE T) NIL)))))) -;deepestExpression x == -; x is ["_!",y] => deepestExpression y -; x - -;;; *** |deepestExpression| REDEFINED - -(DEFUN |deepestExpression| (|x|) (PROG (|ISTMP#1| |y|) (RETURN (COND ((AND (PAIRP |x|) (EQ (QCAR |x|) (QUOTE !)) (PROGN (SPADLET |ISTMP#1| (QCDR |x|)) (AND (PAIRP |ISTMP#1|) (EQ (QCDR |ISTMP#1|) NIL) (PROGN (SPADLET |y| (QCAR |ISTMP#1|)) (QUOTE T))))) (|deepestExpression| |y|)) ((QUOTE T) |x|))))) @ \eject \begin{thebibliography}{99}