diff --git a/books/bookvol5.pamphlet b/books/bookvol5.pamphlet index 60b91af..7ce3824 100644 --- a/books/bookvol5.pamphlet +++ b/books/bookvol5.pamphlet @@ -5491,6 +5491,16 @@ and the current token (\$ttok) @ +\defun{pfLeaf}{Construct a Leaf node} +\calls{pfLeaf}{tokConstruct} +\calls{pfLeaf}{ifcar} +\calls{pfLeaf}{pfNoPosition} +<>= +(defun |pfLeaf| (x y &rest z) + (|tokConstruct| x y (or (ifcar z) (|pfNoPosition|)))) + +@ + \defun{pfLeafToken}{Return the Leaf Token} \calls{pfLeafToken}{tokPart} <>= @@ -5556,6 +5566,20 @@ and the current token (\$ttok) @ +\defun{pfApplicationArg}{Return the Arg part of an Application node} +<>= +(defun |pfApplicationArg| (pf) + (caddr pf)) + +@ + +\defun{pfApplicationOp}{Return the Op part of an Application node} +<>= +(defun |pfApplicationOp| (pf) + (cadr pf)) + +@ + \defun{pfAnd?}{Is this an And node?} \calls{pfAnd?}{pfAbSynOp?} <>= @@ -5654,6 +5678,20 @@ and the current token (\$ttok) @ +\defun{pfCollectBody}{Return the Body of a Collect node} +<>= +(defun |pfCollectBody| (pf) + (cadr pf)) + +@ + +\defun{pfCollectIterators}{Return the Iterators of a Collect node} +<>= +(defun |pfCollectIterators| (pf) + (caddr pf)) + +@ + \defun{pfCollect?}{Is this a Collect node?} \calls{pfCollect?}{pfAbSynOp?} <>= @@ -5662,6 +5700,20 @@ and the current token (\$ttok) @ +\defun{pfDefinitionLhsItems}{Return the Lhs of a Definition node} +<>= +(defun |pfDefinitionLhsItems| (pf) + (cadr pf)) + +@ + +\defun{pfDefinitionRhs}{Return the Rhs of a Definition node} +<>= +(defun |pfDefinitionRhs| (pf) + (caddr pf)) + +@ + \defun{pfDefinition?}{Is this a Definition node?} \calls{pfDefinition?}{pfAbSynOp?} <>= @@ -5670,6 +5722,15 @@ and the current token (\$ttok) @ +\defun{pf0DefinitionLhsItems}{Return the parts of a Definition node} +\calls{pf0DefinitionLhsItems}{pfParts} +\calls{pf0DefinitionLhsItems}{pfDefinitionLhsItems} +<>= +(defun |pf0DefinitionLhsItems| (pf) + (|pfParts| (|pfDefinitionLhsItems| pf))) + +@ + \defun{pfDo?}{Is this a Do node?} \calls{pfDo?}{pfAbSynOp?} <>= @@ -5685,6 +5746,19 @@ and the current token (\$ttok) @ +\defun{pfEnSequence}{Construct a Sequence node} +\calls{pfEnSequence}{pfTuple} +\calls{pfEnSequence}{pfListOf} +\calls{pfEnSequence}{pfSequence} +<>= +(defun |pfEnSequence| (a) + (cond + ((null a) (|pfTuple| (|pfListOf| a))) + ((null (cdr a)) (car a)) + (t (|pfSequence| (|pfListOf| a))))) + +@ + \defun{pfExit?}{Is this an Exit node?} \calls{pfExit?}{pfAbSynOp?} <>= @@ -5821,6 +5895,20 @@ and the current token (\$ttok) @ +\defun{pfLambdaBody}{Return the Body part of a Lambda node} +<>= +(defun |pfLambdaBody| (pf) + (cadddr pf)) + +@ + +\defun{pfLambdaRets}{Return the Rets part of a Lambda node} +<>= +(defun |pfLambdaRets| (pf) + (caddr pf)) + +@ + \defun{pfLambda?}{Is this a Lambda node?} \calls{pfLambda?}{pfAbSynOp?} <>= @@ -5829,6 +5917,15 @@ and the current token (\$ttok) @ +\defun{pf0LambdaArgs}{Return the Args of a Lambda Node} +\calls{pf0LambdaArgs}{pfParts} +\calls{pf0LambdaArgs}{pfLambdaArgs} +<>= +(defun |pf0LambdaArgs| (pf) + (|pfParts| (|pfLambdaArgs| pf))) + +@ + \defun{pfLocal?}{Is this a Local node?} \calls{pfLocal?}{pfAbSynOp?} <>= @@ -5861,6 +5958,13 @@ and the current token (\$ttok) @ +\defun{pfLoopIterators}{Return the Iterators of a Loop node} +<>= +(defun |pfLoopIterators| (pf) + (cadr pf)) + +@ + \defun{pf0LoopIterators}{pf0LoopIterators} \calls{pf0LoopIterators}{pfParts} \calls{pf0LoopIterators}{pf0LoopIterators} @@ -5901,6 +6005,14 @@ and the current token (\$ttok) @ +\defun{pfNovalue}{Construct a NoValue node} +\calls{pfNovalue}{} +<>= +(defun |pfNovalue| (pfexpr) + (|pfTree| '|Novalue| (list pfexpr))) + +@ + \defun{pfNovalue?}{Is this a Novalue node?} \calls{pfNovalue?}{pfAbSynOp?} <>= @@ -5997,6 +6109,28 @@ and the current token (\$ttok) @ +\defun{pfRule}{Construct a Rule node} +\calls{pfRule}{pfTree} +<>= +(defun |pfRule| (pflhsitems pfrhs) + (|pfTree| '|Rule| (list pflhsitems pfrhs))) + +@ + +\defun{pfRuleLhsItems}{Return the Lhs of a Rule node} +<>= +(defun |pfRuleLhsItems| (pf) + (cadr pf)) + +@ + +\defun{pfRuleRhs}{Return the Rhs of a Rule node} +<>= +(defun |pfRuleRhs| (pf) + (caddr pf)) + +@ + \defun{pfRule?}{Is this a Rule node?} \calls{pfRule?}{pfAbSynOp?} <>= @@ -6005,6 +6139,14 @@ and the current token (\$ttok) @ +\defun{pfSequence}{Construct a Sequence node} +\calls{pfSequence}{pfTree} +<>= +(defun |pfSequence| (pfargs) + (|pfTree| '|Sequence| (list pfargs))) + +@ + \defun{pfSequence?}{ Is this a Sequence node?} \calls{pfSequence?}{pfAbSynOp?} <>= @@ -6072,6 +6214,23 @@ and the current token (\$ttok) @ +\defun{pfTuple}{Return a Tuple node} +\calls{pfTuple}{pfTree} +<>= +(defun |pfTuple| (pfparts) + (|pfTree| '|Tuple| (list pfparts))) + +@ + +\defun{pfTupleListOf}{Return a Tuple from a List} +\calls{pfTupleListOf}{pfTuple} +\calls{pfTupleListOf}{pfListOf} +<>= +(defun |pfTupleListOf| (pfparts) + (|pfTuple| (|pfListOf| pfparts))) + +@ + \defun{pfTuple?}{Is this a Tuple node?} \calls{pfTuple?}{pfAbSynOp?} <>= @@ -6080,6 +6239,13 @@ and the current token (\$ttok) @ +\defun{pfTupleParts}{Return the Parts of a Tuple node} +<>= +(defun |pfTupleParts| (pf) + (cadr pf)) + +@ + \defun{pf0TupleParts}{Return the parts of a Tuple} \calls{pf0TupleParts}{pfParts} \calls{pf0TupleParts}{pfTupleParts} @@ -6135,6 +6301,14 @@ and the current token (\$ttok) @ +\defun{pfWrong}{Create a Wrong node} +\calls{pfWrong}{pfTree} +<>= +(defun |pfWrong| (pfwhy pfrubble) + (|pfTree| '|Wrong| (list pfwhy pfrubble))) + +@ + \defun{pfWrong?}{Is this a Wrong node?} \calls{pfWrong?}{pfAbSynOp?} <>= @@ -10498,14 +10672,16 @@ where head is either an id or (id . alist) \defun{pfNoPosition?}{pfNoPosition?} \calls{pfNoPosition?}{poNoPosition?} <>= -(defun |pfNoPosition?| (pos) (|poNoPosition?| pos)) +(defun |pfNoPosition?| (pos) + (|poNoPosition?| pos)) @ \defun{poNoPosition?}{poNoPosition?} \calls{poNoPosition?}{eqcar} <>= -(defun |poNoPosition?| (pos) (eqcar pos '|noposition|)) +(defun |poNoPosition?| (pos) + (eqcar pos '|noposition|)) @ @@ -34892,6 +35068,8 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> +<> <> <> <> @@ -34904,7 +35082,11 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> +<> <> +<> +<> <> <> <> @@ -34913,6 +35095,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> @@ -34928,9 +35111,12 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> +<> +<> <> <> -<> +<> <> <> <> @@ -34938,7 +35124,9 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> +<> <> <> <> @@ -34948,6 +35136,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> @@ -34964,8 +35153,12 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> +<> +<> <> <> +<> <> <> <> @@ -34978,18 +35171,24 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> +<> <> <> <> +<> <> <> <> <> <> <> +<> <> <> +<> <> +<> <> <> <> diff --git a/changelog b/changelog index e6dd95f..85bb211 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +20100213 tpd src/axiom-website/patches.html 20100213.01.tpd.patch +20100213 tpd src/interp/ptrees.lisp treeshake +20100213 tpd books/bookvol5 treeshake ptrees.lisp 20100212 tpd src/axiom-website/patches.html 20100212.02.tpd.patch 20100212 tpd books/bookvol10.1 add quaternion quote from Altmann 20100212 tpd src/axiom-website/patches.html 20100212.01.tpd.patch diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index a5ad61d..4620107 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -2451,5 +2451,7 @@ books/bookvol5 treeshake ptrees, pf2sex
books/bookvol5 merge and remove pf2sex
20100212.02.tpd.patch books/bookvol10.1 add quaternion quote from Altmann
+20100213.01.tpd.patch +books/bookvol5 treeshake ptrees.lisp
diff --git a/src/interp/ptrees.lisp.pamphlet b/src/interp/ptrees.lisp.pamphlet index e6ead92..26a87bf 100644 --- a/src/interp/ptrees.lisp.pamphlet +++ b/src/interp/ptrees.lisp.pamphlet @@ -24,13 +24,6 @@ '(|id| |idsy| |symbol| |string| |char| |float| |expression| |integer| |Document| |error|))))) -;pfLeaf(x,y,:z) == tokConstruct(x,y, IFCAR z or pfNoPosition()) - -(DEFUN |pfLeaf| (|x| |y| &REST |z|) - (PROG () - (RETURN - (|tokConstruct| |x| |y| (OR (IFCAR |z|) (|pfNoPosition|)))))) - ;pfLeafPosition form == tokPosn form (DEFUN |pfLeafPosition| (|form|) @@ -218,21 +211,6 @@ (DEFUN |pfNot| (|arg|) (PROG () (RETURN (|pfTree| '|Not| (LIST |arg|))))) -;pfEnSequence a== -; if null a -; then pfTuple pfListOf a -; else if null cdr a -; then car a -; else pfSequence pfListOf a - -(DEFUN |pfEnSequence| (|a|) - (PROG () - (RETURN - (COND - ((NULL |a|) (|pfTuple| (|pfListOf| |a|))) - ((NULL (CDR |a|)) (CAR |a|)) - ('T (|pfSequence| (|pfListOf| |a|))))))) - ;pfFromDom(dom,expr)== ; if pfApplication? expr ; then pfApplication(pfFromdom(pfApplicationOp expr,dom), @@ -475,11 +453,6 @@ ;-- Wrong := (Why: Document, Rubble: [Expr]) -;pfWrong(pfwhy, pfrubble) == pfTree('Wrong, [pfwhy, pfrubble]) - -(DEFUN |pfWrong| (|pfwhy| |pfrubble|) - (PROG () (RETURN (|pfTree| '|Wrong| (LIST |pfwhy| |pfrubble|))))) - ;pfWrongWhy pf == CADR pf -- was ==> (DEFUN |pfWrongWhy| (|pf|) (PROG () (RETURN (CADR |pf|)))) @@ -662,29 +635,8 @@ (DEFUN |pfApplication| (|pfop| |pfarg|) (PROG () (RETURN (|pfTree| '|Application| (LIST |pfop| |pfarg|))))) -;pfApplicationOp pf == CADR pf -- was ==> - -(DEFUN |pfApplicationOp| (|pf|) (PROG () (RETURN (CADR |pf|)))) - -;pfApplicationArg pf == CADDR pf -- was ==> - -(DEFUN |pfApplicationArg| (|pf|) (PROG () (RETURN (CADDR |pf|)))) - ;-- Tuple := (Parts: [Expr]) ; -;pfTupleListOf(pfparts) == pfTuple pfListOf pfparts - -(DEFUN |pfTupleListOf| (|pfparts|) - (PROG () (RETURN (|pfTuple| (|pfListOf| |pfparts|))))) - -;pfTuple(pfparts) == pfTree('Tuple, [pfparts]) - -(DEFUN |pfTuple| (|pfparts|) - (PROG () (RETURN (|pfTree| '|Tuple| (LIST |pfparts|))))) - -;pfTupleParts pf == CADR pf -- was ==> - -(DEFUN |pfTupleParts| (|pf|) (PROG () (RETURN (CADR |pf|)))) ;-- Tagged := (Tag: Expr, Expr: Expr) @@ -752,19 +704,6 @@ (DEFUN |pfLambdaArgs| (|pf|) (PROG () (RETURN (CADR |pf|)))) -;pfLambdaRets pf == CADDR pf -- was ==> - -(DEFUN |pfLambdaRets| (|pf|) (PROG () (RETURN (CADDR |pf|)))) - -;pfLambdaBody pf == CADDDR pf -- was ==> - -(DEFUN |pfLambdaBody| (|pf|) (PROG () (RETURN (CADDDR |pf|)))) - -;pf0LambdaArgs pf == pfParts pfLambdaArgs pf - -(DEFUN |pf0LambdaArgs| (|pf|) - (PROG () (RETURN (|pfParts| (|pfLambdaArgs| |pf|))))) - ;pfFix pf== pfApplication(pfId "Y",pf) (DEFUN |pfFix| (|pf|) @@ -837,11 +776,6 @@ ;-- Sequence := (Args: [Expr]) -;pfSequence(pfargs) == pfTree('Sequence, [pfargs]) - -(DEFUN |pfSequence| (|pfargs|) - (PROG () (RETURN (|pfTree| '|Sequence| (LIST |pfargs|))))) - ;pfSequenceArgs pf == CADR pf -- was ==> (DEFUN |pfSequenceArgs| (|pf|) (PROG () (RETURN (CADR |pf|)))) @@ -853,11 +787,6 @@ ;-- Novalue := (Expr: Expr) -;pfNovalue(pfexpr) == pfTree('Novalue, [pfexpr]) - -(DEFUN |pfNovalue| (|pfexpr|) - (PROG () (RETURN (|pfTree| '|Novalue| (LIST |pfexpr|))))) - ;-- Loop := (Iterators: [Iterator]) ;pfLoop(pfiterators) == pfTree('Loop, [pfiterators]) @@ -865,10 +794,6 @@ (DEFUN |pfLoop| (|pfiterators|) (PROG () (RETURN (|pfTree| '|Loop| (LIST |pfiterators|))))) -;pfLoopIterators pf == CADR pf -- was ==> - -(DEFUN |pfLoopIterators| (|pf|) (PROG () (RETURN (CADR |pf|)))) - ;-- Collect := (Body: Expr, Iterators: [Iterator]) ;pfCollect(pfbody, pfiterators) == pfTree('Collect, [pfbody, pfiterators]) @@ -877,14 +802,6 @@ (PROG () (RETURN (|pfTree| '|Collect| (LIST |pfbody| |pfiterators|))))) -;pfCollectBody pf == CADR pf -- was ==> - -(DEFUN |pfCollectBody| (|pf|) (PROG () (RETURN (CADR |pf|)))) - -;pfCollectIterators pf == CADDR pf -- was ==> - -(DEFUN |pfCollectIterators| (|pf|) (PROG () (RETURN (CADDR |pf|)))) - ;pf0CollectIterators pf == pfParts pfCollectIterators pf (DEFUN |pf0CollectIterators| (|pf|) @@ -984,32 +901,6 @@ (PROG () (RETURN (|pfTree| '|Definition| (LIST |pflhsitems| |pfrhs|))))) -;pfDefinitionLhsItems pf == CADR pf -- was ==> - -(DEFUN |pfDefinitionLhsItems| (|pf|) (PROG () (RETURN (CADR |pf|)))) - -;pfDefinitionRhs pf == CADDR pf -- was ==> - -(DEFUN |pfDefinitionRhs| (|pf|) (PROG () (RETURN (CADDR |pf|)))) - -;pf0DefinitionLhsItems pf == pfParts pfDefinitionLhsItems pf - -(DEFUN |pf0DefinitionLhsItems| (|pf|) - (PROG () (RETURN (|pfParts| (|pfDefinitionLhsItems| |pf|))))) - -;pfRule(pflhsitems, pfrhs) == pfTree('Rule, [pflhsitems, pfrhs]) - -(DEFUN |pfRule| (|pflhsitems| |pfrhs|) - (PROG () (RETURN (|pfTree| '|Rule| (LIST |pflhsitems| |pfrhs|))))) - -;pfRuleLhsItems pf == CADR pf -- was ==> - -(DEFUN |pfRuleLhsItems| (|pf|) (PROG () (RETURN (CADR |pf|)))) - -;pfRuleRhs pf == CADDR pf -- was ==> - -(DEFUN |pfRuleRhs| (|pf|) (PROG () (RETURN (CADDR |pf|)))) - ;-- ComDefinition := (Doc:Document,Def:Definition) ;pfComDefinition(pfdoc, pfdef) == pfTree('ComDefinition, [pfdoc, pfdef] )