diff --git a/books/bookvol9.pamphlet b/books/bookvol9.pamphlet index 7c772fe..c79a851 100644 --- a/books/bookvol9.pamphlet +++ b/books/bookvol9.pamphlet @@ -1988,9 +1988,7 @@ of the symbol being parsed. The original list read: u (progn (setq op (if |$insidePostCategoryIfTrue| 'progn 'category)) - (cons op - (dolist (x z (nreverse0 tmp1)) - (push (fn |x|) tmp1)))))))) + (cons op (dolist (x z (nreverse0 tmp1)) (push (fn x) tmp1)))))))) @ @@ -2169,6 +2167,81 @@ of the symbol being parsed. The original list read: @ +\defplist{==}{postDef} +<>= +(eval-when (eval load) + (setf (get '|==| '|postTran|) '|postDef|)) + +@ + +\defun{postDef}{postDef} +\calls{postDef}{postMDef} +\calls{postDef}{recordHeaderDocumentation} +\calls{postDef}{nequal} +\calls{postDef}{postTran} +\calls{postDef}{postDefArgs} +\calls{postDef}{nreverse0} +\usesdollar{postDef}{boot} +\usesdollar{postDef}{maxSignatureLineNumber} +\usesdollar{postDef}{headerDocumentation} +\usesdollar{postDef}{docList} +\usesdollar{postDef}{InteractiveMode} +<>= +(defun |postDef| (arg) + (let (defOp rhs name lhs targetType a tmp1 op argl newLhs + argTypeList typeList form specialCaseForm tmp4 tmp6 tmp8) + (declare (special $boot |$maxSignatureLineNumber| |$headerDocumentation| + |$docList| |$InteractiveMode|)) + (setq defOp (car arg)) + (setq lhs (second arg)) + (setq rhs (third arg)) + (if (and (pairp lhs) (eq (qcar lhs) '|macro|) + (pairp (qcdr lhs)) (eq (qcdr (qcdr lhs)) nil)) + (|postMDef| (list '==> (second lhs) rhs)) + (progn + (unless $boot (|recordHeaderDocumentation| nil)) + (when (nequal |$maxSignatureLineNumber| 0) + (setq |$docList| + (cons (cons '|constructor| |$headerDocumentation|) |$docList|)) + (setq |$maxSignatureLineNumber| 0)) + (setq lhs (|postTran| lhs)) + (setq tmp1 + (if (and (pairp lhs) (eq (qcar lhs) '|:|)) (cdr lhs) (list lhs nil))) + (setq form (car tmp1)) + (setq targetType (second tmp1)) + (when (and (null |$InteractiveMode|) (atom form)) (setq form (list form))) + (setq newLhs + (if (atom form) + form + (progn + (setq tmp1 + (dolist (x form (nreverse0 tmp4)) + (push + (if (and (pairp x) (eq (qcar x) '|:|) (pairp (qcdr x)) + (pairp (qcdr (qcdr x))) (eq (qcdr (qcdr (qcdr x))) nil)) + (qcar (qcdr x)) + x) + tmp4))) + (setq op (car tmp1)) + (setq argl (cdr tmp1)) + (cons op (|postDefArgs| argl))))) + (setq argTypeList + (unless (atom form) + (dolist (x (cdr form) (nreverse0 tmp6)) + (push + (when (and (pairp x) (eq (qcar x) '|:|) (pairp (qcdr x)) + (pairp (qcdr (qcdr x))) (eq (qcdr (qcdr (qcdr x))) nil)) + (third x)) + tmp6)))) + (setq typeList (cons targetType argTypeList)) + (when (atom form) (setq form (list form))) + (setq specialCaseForm + (dolist (x form (nreverse tmp8)) + (setq tmp8 (cons nil tmp8)))) + (list 'def newLhs typeList specialCaseForm (|postTran| rhs)))))) + +@ + \defplist{with}{postWith} <>= (eval-when (eval load) @@ -8824,6 +8897,7 @@ if \verb|$InteractiveMode| then use a null outputstream <> <> <> +<> <> <> <> diff --git a/changelog b/changelog index 71e17f0..30016de 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,7 @@ +20101026 tpd src/axiom-website/patches.html 20101026.01.tpd.patch +20101026 tpd src/interp/vmlisp.lisp.pamphlet +20101026 tpd src/interp/parsing.lisp treeshake compiler +20101026 tpd books/bookvol9 treeshake compiler 20101025 tpd src/axiom-website/patches.html 20101025.01.tpd.patch 20101025 tpd src/interp/vmlisp.lisp treeshake compiler 20101025 tpd src/interp/parsing.lisp treeshake compiler diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index b7d7cc3..541adff 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -3252,5 +3252,7 @@ books/tangle.lisp automate making help files
books/tangle.lisp automate making input files
20101025.01.tpd.patch books/bookvol9 treeshake compiler
+20101026.01.tpd.patch +books/bookvol9 treeshake compiler
diff --git a/src/interp/parsing.lisp.pamphlet b/src/interp/parsing.lisp.pamphlet index b023645..109e046 100644 --- a/src/interp/parsing.lisp.pamphlet +++ b/src/interp/parsing.lisp.pamphlet @@ -2394,51 +2394,6 @@ parse ;;; *** |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|))))))) -;postCategory (u is ['CATEGORY,:l]) == -; --RDJ: ugh_ please -- someone take away need for PROGN as soon as possible -; null l => u -; op := -; $insidePostCategoryIfTrue = true => 'PROGN -; 'CATEGORY -; [op,:[fn x for x in l]] where fn x == -; $insidePostCategoryIfTrue: local := true -; postTran x - -;;; *** |postCategory,fn| REDEFINED - -(DEFUN |postCategory,fn| (|x|) (PROG (|$insidePostCategoryIfTrue|) (DECLARE (SPECIAL |$insidePostCategoryIfTrue|)) (RETURN (SEQ (SPADLET |$insidePostCategoryIfTrue| (QUOTE T)) (EXIT (|postTran| |x|)))))) - -;;; *** |postCategory| REDEFINED - -(DEFUN |postCategory| (|u|) (PROG (|l| |op|) (RETURN (SEQ (PROGN (SPADLET |l| (CDR |u|)) (COND ((NULL |l|) |u|) ((QUOTE T) (SPADLET |op| (COND ((BOOT-EQUAL |$insidePostCategoryIfTrue| (QUOTE T)) (QUOTE PROGN)) ((QUOTE T) (QUOTE CATEGORY)))) (CONS |op| (PROG (#0=#:G166582) (SPADLET #0# NIL) (RETURN (DO ((#1=#:G166587 |l| (CDR #1#)) (|x| NIL)) ((OR (ATOM #1#) (PROGN (SETQ |x| (CAR #1#)) NIL)) (NREVERSE0 #0#)) (SEQ (EXIT (SETQ #0# (CONS (|postCategory,fn| |x|) #0#))))))))))))))) -;postDef [defOp,lhs,rhs] == -;--+ -; lhs is ["macro",name] => postMDef ["==>",name,rhs] -; if not($BOOT) then recordHeaderDocumentation nil -; if $maxSignatureLineNumber ^= 0 then -; $docList := [['constructor,:$headerDocumentation],:$docList] -; $maxSignatureLineNumber := 0 -; --reset this for next constructor; see recordDocumentation -; lhs:= postTran lhs -; [form,targetType]:= -; lhs is [":",:.] => rest lhs -; [lhs,nil] -; if null $InteractiveMode and atom form then form := LIST form -; newLhs:= -; atom form => form -; [op,:argl]:= [(x is [":",a,.] => a; x) for x in form] -; [op,:postDefArgs argl] -; argTypeList:= -; atom form => nil -; [(x is [":",.,t] => t; nil) for x in rest form] -; typeList:= [targetType,:argTypeList] -; if atom form then form := [form] -; specialCaseForm := [nil for x in form] -; ['DEF,newLhs,typeList,specialCaseForm,postTran rhs] - -;;; *** |postDef| REDEFINED - -(DEFUN |postDef| (#0=#:G166655) (PROG (|defOp| |rhs| |name| |lhs| |targetType| |a| |LETTMP#1| |op| |argl| |newLhs| |ISTMP#1| |ISTMP#2| |t| |argTypeList| |typeList| |form| |specialCaseForm|) (RETURN (SEQ (PROGN (SPADLET |defOp| (CAR #0#)) (SPADLET |lhs| (CADR #0#)) (SPADLET |rhs| (CADDR #0#)) (COND ((AND (PAIRP |lhs|) (EQ (QCAR |lhs|) (QUOTE |macro|)) (PROGN (SPADLET |ISTMP#1| (QCDR |lhs|)) (AND (PAIRP |ISTMP#1|) (EQ (QCDR |ISTMP#1|) NIL) (PROGN (SPADLET |name| (QCAR |ISTMP#1|)) (QUOTE T))))) (|postMDef| (CONS (QUOTE ==>) (CONS |name| (CONS |rhs| NIL))))) ((QUOTE T) (COND ((NULL $BOOT) (|recordHeaderDocumentation| NIL))) (COND ((NEQUAL |$maxSignatureLineNumber| 0) (SPADLET |$docList| (CONS (CONS (QUOTE |constructor|) |$headerDocumentation|) |$docList|)) (SPADLET |$maxSignatureLineNumber| 0))) (SPADLET |lhs| (|postTran| |lhs|)) (SPADLET |LETTMP#1| (COND ((AND (PAIRP |lhs|) (EQ (QCAR |lhs|) (QUOTE |:|))) (CDR |lhs|)) ((QUOTE T) (CONS |lhs| (CONS NIL NIL))))) (SPADLET |form| (CAR |LETTMP#1|)) (SPADLET |targetType| (CADR |LETTMP#1|)) (COND ((AND (NULL |$InteractiveMode|) (ATOM |form|)) (SPADLET |form| (LIST |form|)))) (SPADLET |newLhs| (COND ((ATOM |form|) |form|) ((QUOTE T) (SPADLET |LETTMP#1| (PROG (#1=#:G166698) (SPADLET #1# NIL) (RETURN (DO ((#2=#:G166708 |form| (CDR #2#)) (|x| NIL)) ((OR (ATOM #2#) (PROGN (SETQ |x| (CAR #2#)) NIL)) (NREVERSE0 #1#)) (SEQ (EXIT (SETQ #1# (CONS (COND ((AND (PAIRP |x|) (EQ (QCAR |x|) (QUOTE |:|)) (PROGN (SPADLET |ISTMP#1| (QCDR |x|)) (AND (PAIRP |ISTMP#1|) (PROGN (SPADLET |a| (QCAR |ISTMP#1|)) (SPADLET |ISTMP#2| (QCDR |ISTMP#1|)) (AND (PAIRP |ISTMP#2|) (EQ (QCDR |ISTMP#2|) NIL)))))) |a|) ((QUOTE T) |x|)) #1#)))))))) (SPADLET |op| (CAR |LETTMP#1|)) (SPADLET |argl| (CDR |LETTMP#1|)) (CONS |op| (|postDefArgs| |argl|))))) (SPADLET |argTypeList| (COND ((ATOM |form|) NIL) ((QUOTE T) (PROG (#3=#:G166724) (SPADLET #3# NIL) (RETURN (DO ((#4=#:G166735 (CDR |form|) (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|) (PROGN (SPADLET |ISTMP#2| (QCDR |ISTMP#1|)) (AND (PAIRP |ISTMP#2|) (EQ (QCDR |ISTMP#2|) NIL) (PROGN (SPADLET |t| (QCAR |ISTMP#2|)) (QUOTE T))))))) |t|) ((QUOTE T) NIL)) #3#)))))))))) (SPADLET |typeList| (CONS |targetType| |argTypeList|)) (COND ((ATOM |form|) (SPADLET |form| (CONS |form| NIL)))) (SPADLET |specialCaseForm| (PROG (#5=#:G166745) (SPADLET #5# NIL) (RETURN (DO ((#6=#:G166750 |form| (CDR #6#)) (|x| NIL)) ((OR (ATOM #6#) (PROGN (SETQ |x| (CAR #6#)) NIL)) (NREVERSE0 #5#)) (SEQ (EXIT (SETQ #5# (CONS NIL #5#)))))))) (CONS (QUOTE DEF) (CONS |newLhs| (CONS |typeList| (CONS |specialCaseForm| (CONS (|postTran| |rhs|) NIL)))))))))))) ;postDefArgs argl == ; null argl => argl ; argl is [[":",a],:b] => diff --git a/src/interp/vmlisp.lisp.pamphlet b/src/interp/vmlisp.lisp.pamphlet index 4a29fdf..4b81502 100644 --- a/src/interp/vmlisp.lisp.pamphlet +++ b/src/interp/vmlisp.lisp.pamphlet @@ -6861,7 +6861,7 @@ o there is some code at the end of SPECEVAL BOOT that puts "up" (|Signature| |postSignature|) ; (CATEGORY |postCategory|) ;;( |postDef|) - (== |postDef|) +; (== |postDef|) (|==>| |postMDef|) (|->| |postMapping|) (|=>| |postExit|)