diff --git a/books/bookvol9.pamphlet b/books/bookvol9.pamphlet index f75a35e..5670690 100644 --- a/books/bookvol9.pamphlet +++ b/books/bookvol9.pamphlet @@ -1457,6 +1457,7 @@ always positioned ON the first character. @ \chapter{Parse Transformers} +\section{Direct called parse routines} \defun{parseTransform}{parseTransform} \calls{parseTransform}{msubst} \calls{parseTransform}{parseTran} @@ -1554,25 +1555,34 @@ always positioned ON the first character. @ +\section{Indirect called parse routines} + +\defplist{parseTran}{parseLeave} +<>= +(eval-when (eval load) + (setf (get '|leave| '|parseTran|) '|parseLeave|)) + +@ \defun{parseLeave}{parseLeave} \calls{parseLeave}{parseTran} <>= (defun |parseLeave| (arg) (let (a b) - (setq a (|parseTran| (car arg))) - (setq b (|parseTran| (cdr arg))) - (cond - (b + (setq a (|parseTran| (car arg))) + (setq b (|parseTran| (cdr arg))) (cond - ((null (integerp a)) - (moan "first arg " a " for 'leave' must be integer") - (list '|leave| 1 a)) - (t (list '|leave| (cons a b))))) - (t (list '|leave| 1 a))))) + (b + (cond + ((null (integerp a)) + (moan "first arg " a " for 'leave' must be integer") + (list '|leave| 1 a)) + (t (cons '|leave| (cons a b))))) + (t (list '|leave| 1 a))))) @ \chapter{Post Transformers} +\section{Direct called postparse routines} \defun{postTransform}{postTransform} \calls{postTransform}{postTran} \calls{postTransform}{identp} @@ -1780,8 +1790,6 @@ always positioned ON the first character. \calls{postForm}{bright} \usesdollar{postForm}{boot} <>= -;(DEFUN |postForm| (|u|) (PROG (|op| |argl| |argl'| |l| |numOfArgs| |op'| |x| |ISTMP#1| |ISTMP#2| |y|) (RETURN (SEQ (PROGN (SPADLET |op| (CAR |u|)) (SPADLET |argl| (CDR |u|)) (SPADLET |x| (COND ((ATOM |op|) (SPADLET |argl'| (|postTranList| |argl|)) (SPADLET |op'| (SEQ (EXIT |op|) (COND ($BOOT (EXIT |op|))) (COND ((OR (GETL |op| (QUOTE |Led|)) (GETL |op| (QUOTE |Nud|)) (BOOT-EQUAL |op| (QUOTE IN))) (EXIT |op|))) (SPADLET |numOfArgs| (COND ((AND (PAIRP |argl'|) (EQ (QCDR |argl'|) NIL) (PROGN (SPADLET |ISTMP#1| (QCAR |argl'|)) (AND (PAIRP |ISTMP#1|) (EQ (QCAR |ISTMP#1|) (QUOTE |@Tuple|)) (PROGN (SPADLET |l| (QCDR |ISTMP#1|)) (QUOTE T))))) (|#| |l|)) ((QUOTE T) 1))) (INTERNL (QUOTE *) (STRINGIMAGE |numOfArgs|) (PNAME |op|)))) (CONS |op'| |argl'|)) ((AND (PAIRP |op|) (EQ (QCAR |op|) (QUOTE |Scripts|))) (APPEND (|postTran| |op|) (|postTranList| |argl|))) ((QUOTE T) (SPADLET |u| (|postTranList| |u|)) (COND ((AND (PAIRP |u|) (PROGN (SPADLET |ISTMP#1| (QCAR |u|)) (AND (PAIRP |ISTMP#1|) (EQ (QCAR |ISTMP#1|) (QUOTE |@Tuple|))))) (|postError| (CONS " " (APPEND (|bright| |u|) (CONS "is illegal because tuples cannot be applied!" (CONS (QUOTE |%l|) (CONS " Did you misuse infix dot?" NIL)))))))) |u|))) (COND ((AND (PAIRP |x|) (PROGN (SPADLET |ISTMP#1| (QCDR |x|)) (AND (PAIRP |ISTMP#1|) (EQ (QCDR |ISTMP#1|) NIL) (PROGN (SPADLET |ISTMP#2| (QCAR |ISTMP#1|)) (AND (PAIRP |ISTMP#2|) (EQ (QCAR |ISTMP#2|) (QUOTE |@Tuple|)) (PROGN (SPADLET |y| (QCDR |ISTMP#2|)) (QUOTE T))))))) (CONS (CAR |x|) |y|)) ((QUOTE T) |x|))))))) - (defun |postForm| (u) (let (op argl arglp z numOfArgs opp x) (declare (special $boot)) @@ -1825,6 +1833,94 @@ always positioned ON the first character. @ +\section{Indirect called postparse routines} +In the {\bf postTran} function there is the code: +\begin{verbatim} + ((and (atom op) (setq f (getl op '|postTran|))) + (funcall f x)) +\end{verbatim} + +The functions in this section are called through the symbol-plist +of the symbol being parsed. The original list read: + +\begin{verbatim} + |add| |postAdd| + @ |postAtSign| + |:BF:| |postBigFloat| + |Block| |postBlock| + CATEGORY |postCategory| + COLLECT |postCollect| + \: |postColon| + |::| |postColonColon| + \, |postComma| + |construct| |postConstruct| + == |postDef| + |=>| |postExit| + |if| |postIf| + |in| |postin| ;" the infix operator version of in" + IN |postIn| ;" the iterator form of in" + |Join| |postJoin| + |->| |postMapping| + |==>| |postMDef| + |pretend| |postPretend| + QUOTE |postQUOTE| + |Reduce| |postReduce| + REPEAT |postRepeat| + |Scripts| |postScripts| + \; |postSemiColon| + |Signature| |postSignature| + / |postSlash| + |@Tuple| |postTuple| + |TupleCollect| |postTupleCollect| + |where| |postWhere| + |with| |postWith| +\end{verbatim} + +@ + +\defplist{with}{postWith} +<>= +;(eval-when (eval load) +; (setf (get '|with| '|postTran|) |postWith|)) + +@ + +\defun{postWith}{postWith} +\calls{postWith}{postTran} +\usesdollar{postWith}{insidePostCategoryIfTrue} +<>= +(DEFUN |postWith| (#:G167795) + (PROG (|$insidePostCategoryIfTrue| |a| |op| |b|) + (DECLARE (SPECIAL |$insidePostCategoryIfTrue|)) + (RETURN + (PROGN + (SPADLET |a| (CADR #:G167795)) + (SPADLET |$insidePostCategoryIfTrue| 'T) + (SPADLET |a| (|postTran| |a|)) + (COND + ((AND (PAIRP |a|) (PROGN (SPADLET |op| (QCAR |a|)) 'T) + (MEMBER |op| '(SIGNATURE ATTRIBUTE IF))) + (CONS 'CATEGORY (CONS |a| NIL))) + ((AND (PAIRP |a|) (EQ (QCAR |a|) 'PROGN) + (PROGN (SPADLET |b| (QCDR |a|)) 'T)) + (CONS 'CATEGORY |b|)) + ('T |a|)))))) +;(defun |postWith| (arg) +; (let (|$insidePostCategoryIfTrue| a) +; (declare (special |$insidePostCategoryIfTrue|)) +; (setq |$insidePostCategoryIfTrue| t) +; (setq a (|postTran| (second arg))) +; (cond +; ((and (pairp a) (member (qcar a) '(signature attribute if))) +; (list 'category a)) +; ((and (pairp a) (eq (qcar a) 'progn)) +; (cons 'category (qcdr a))) +; (t a)))) + +@ + + +\section{Support routines} \defun{setDefOp}{setDefOp} \usesdollar{setDefOp}{defOp} \usesdollar{setDefOp}{topOp} @@ -8448,6 +8544,7 @@ if \verb|$InteractiveMode| then use a null outputstream <> <> <> +<> <> <> <> @@ -8475,6 +8572,8 @@ if \verb|$InteractiveMode| then use a null outputstream <> <> +<> + @ \eject \begin{thebibliography}{99} diff --git a/changelog b/changelog index 2533f9a..c25af89 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,7 @@ +20101023 tpd src/axiom-website/patches.html 20101023.01.tpd.patch +20101023 tpd src/interp/vmlisp.lisp comment out plist assignments +20101023 tpd src/interp/parsing.lisp treeshake compiler +20101023 tpd books/bookvol9 treeshake compiler 20101019 tpd src/axiom-website/patches.html 20101019.01.tpd.patch 20101019 tpd src/interp/parsing.lisp treeshake compiler 20101019 tpd books/bookvol9 treeshake compiler diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 73b9cd2..ffd5206 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -3236,5 +3236,7 @@ books/bookvol9 treeshake compiler
books/bookvol9 treeshake compiler
20101019.01.tpd.patch books/bookvol9 treeshake compiler
+20101023.01.tpd.patch +books/bookvol9 treeshake compiler
diff --git a/src/interp/parsing.lisp.pamphlet b/src/interp/parsing.lisp.pamphlet index eede122..5f4d0f1 100644 --- a/src/interp/parsing.lisp.pamphlet +++ b/src/interp/parsing.lisp.pamphlet @@ -2806,16 +2806,6 @@ parse ;;; *** |postWhere| REDEFINED (DEFUN |postWhere| (#0=#:G167776) (PROG (|a| |b| |c| |x|) (RETURN (PROGN (SPADLET |a| (CADR #0#)) (SPADLET |b| (CADDR #0#)) (SPADLET |x| (COND ((AND (PAIRP |b|) (EQ (QCAR |b|) (QUOTE |Block|)) (PROGN (SPADLET |c| (QCDR |b|)) (QUOTE T))) |c|) ((QUOTE T) (LIST |b|)))) (CONS (QUOTE |where|) (CONS (|postTran| |a|) (|postTranList| |x|))))))) -;postWith ['with,a] == -; $insidePostCategoryIfTrue: local := true -; a:= postTran a -; a is [op,:.] and MEMQ(op,'(SIGNATURE ATTRIBUTE IF)) => ['CATEGORY,a] -; a is ['PROGN,:b] => ['CATEGORY,:b] -; a - -;;; *** |postWith| REDEFINED - -(DEFUN |postWith| (#0=#:G167795) (PROG (|$insidePostCategoryIfTrue| |a| |op| |b|) (DECLARE (SPECIAL |$insidePostCategoryIfTrue|)) (RETURN (PROGN (SPADLET |a| (CADR #0#)) (SPADLET |$insidePostCategoryIfTrue| (QUOTE T)) (SPADLET |a| (|postTran| |a|)) (COND ((AND (PAIRP |a|) (PROGN (SPADLET |op| (QCAR |a|)) (QUOTE T)) (member |op| (QUOTE (SIGNATURE ATTRIBUTE IF)))) (CONS (QUOTE CATEGORY) (CONS |a| NIL))) ((AND (PAIRP |a|) (EQ (QCAR |a|) (QUOTE PROGN)) (PROGN (SPADLET |b| (QCDR |a|)) (QUOTE T))) (CONS (QUOTE CATEGORY) |b|)) ((QUOTE T) |a|)))))) ;isPackageType x == not CONTAINED("$",x) ;;; *** |isPackageType| REDEFINED diff --git a/src/interp/vmlisp.lisp.pamphlet b/src/interp/vmlisp.lisp.pamphlet index b26c25e..42c520b 100644 --- a/src/interp/vmlisp.lisp.pamphlet +++ b/src/interp/vmlisp.lisp.pamphlet @@ -6819,7 +6819,7 @@ o there is some code at the end of SPECEVAL BOOT that puts "up" (|is| |parseIs|) (|isnt| |parseIsnt|) (|Join| |parseJoin|) - (|leave| |parseLeave|) +; (|leave| |parseLeave|) (LET |parseLET|) (LETD |parseLETD|) (MDEF |parseMDEF|)