diff --git a/books/bookvol5.pamphlet b/books/bookvol5.pamphlet index 09fb04a..50d2111 100644 --- a/books/bookvol5.pamphlet +++ b/books/bookvol5.pamphlet @@ -5668,6 +5668,62 @@ and the current token (\$ttok) @ +\defun{npSignature}{npSignature} +\calls{npSignature}{npSigItemlist} +\calls{npSignature}{npPush} +\calls{npSignature}{pfWDec} +\calls{npSignature}{pfNothing} +\calls{npSignature}{npPop1} +<>= +(defun |npSignature| () + (and (|npSigItemlist|) (|npPush| (|pfWDec| (|pfNothing|) (|npPop1|))))) + +@ + +\defun{npSigItemlist}{npSigItemlist} +\calls{npSigItemlist}{npListing} +\calls{npSigItemlist}{npSigItem} +\calls{npSigItemlist}{npPush} +\calls{npSigItemlist}{pfListOf} +\calls{npSigItemlist}{pfAppend} +\calls{npSigItemlist}{pfParts} +\calls{npSigItemlist}{npPop1} +<>= +(defun |npSigItemlist| () + (and + (|npListing| #'|npSigItem|) + (|npPush| (|pfListOf| (|pfAppend| (|pfParts| (|npPop1|))))))) + +@ + +\defun{npSigItem}{npSigItem} +\calls{npSigItem}{npTypeVariable} +\calls{npSigItem}{npSigDecl} +\calls{npSigItem}{npTrap} +<>= +(defun |npSigItem| () + (and (|npTypeVariable|) (or (|npSigDecl|) (|npTrap|)))) + +@ + +\defun{npSigDecl}{npSigDecl} +\calls{npSigDecl}{npEqKey} +\calls{npSigDecl}{npType} +\calls{npSigDecl}{npTrap} +\calls{npSigDecl}{npPush} +\calls{npSigDecl}{pfSpread} +\calls{npSigDecl}{pfParts} +\calls{npSigDecl}{npPop2} +\calls{npSigDecl}{npPop1} +<>= +(defun |npSigDecl| () + (and + (|npEqKey| 'colon) + (or (|npType|) (|npTrap|)) + (|npPush| (|pfSpread| (|pfParts| (|npPop2|)) (|npPop1|))))) + +@ + \defun{npPrimary}{npPrimary} \calls{npPrimary}{npPrimary1} \calls{npPrimary}{npPrimary2} @@ -5693,6 +5749,7 @@ and the current token (\$ttok) @ \defun{npADD}{npADD} +\tpdhere{Note that there is also an npAdd function} \calls{npADD}{npType} \calls{npADD}{npPop1} \calls{npADD}{npAdd} @@ -5710,6 +5767,44 @@ and the current token (\$ttok) @ +\defun{npAdd}{npAdd} +\tpdhere{Note that there is also an npADD function} +\calls{npAdd}{npEqKey} +\calls{npAdd}{npState} +\calls{npAdd}{npDefinitionOrStatement} +\calls{npAdd}{npTrap} +\calls{npAdd}{npEqPeek} +\calls{npAdd}{npRestore} +\calls{npAdd}{npVariable} +\calls{npAdd}{npCompMissing} +\calls{npAdd}{npDefinitionOrStatement} +\calls{npAdd}{npPush} +\calls{npAdd}{pfAdd} +\calls{npAdd}{npPop2} +\calls{npAdd}{npPop1} +\calls{npAdd}{pfNothing} +<>= +(defun |npAdd| (extra) + (let (a) + (and + (|npEqKey| 'add) + (progn + (setq a (|npState|)) + (or (|npDefinitionOrStatement|) (|npTrap|)) + (cond + ((|npEqPeek| 'in) + (progn + (|npRestore| a) + (and + (or (|npVariable|) (|npTrap|)) + (|npCompMissing| 'in) + (or (|npDefinitionOrStatement|) (|npTrap|)) + (|npPush| (|pfAdd| (|npPop2|) (|npPop1|) extra))))) + (t + (|npPush| (|pfAdd| (|pfNothing|) (|npPop1|) extra)))))))) + +@ + \defun{npAtom2}{npAtom2} \calls{npAtom2}{npInfixOperator} \calls{npAtom2}{npAmpersand} @@ -5828,6 +5923,32 @@ and the current token (\$ttok) @ +\defun{npMacro}{npMacro} +\calls{npMacro}{npPP} +\calls{npMacro}{npMdef} +<>= +(defun |npMacro| () + (and + (|npEqKey| 'macro) + (|npPP| #'|npMdef|))) + +@ + +\defun{npFix}{npFix} +\calls{npFix}{npEqKey} +\calls{npFix}{npDef} +\calls{npFix}{npPush} +\calls{npFix}{pfFix} +\calls{npFix}{npPop1} +<>= +(defun |npFix| () + (and + (|npEqKey| 'fix) + (|npPP| #'|npDef|) + (|npPush| (|pfFix| (|npPop1|))))) + +@ + \defun{npLet}{npLet} \calls{npLet}{npLetQualified} \calls{npLet}{npDefinitionOrStatement} @@ -7229,6 +7350,14 @@ of the form ('expression expr position) @ +\defun{pfSpread}{pfSpread} +\calls{pfSpread}{pfTyped} +<>= +(defun |pfSpread| (arg1 arg2) + (mapcar #'(lambda (i) (|pfTyped| i arg2)) arg1)) + +@ + \defun{pfCheckItOut}{Deconstruct nodes to lists} \calls{pfCheckItOut}{pfTagged?} \calls{pfCheckItOut}{pfTaggedExpr} @@ -7964,6 +8093,15 @@ of the form ('expression expr position) @ +\defun{pfFix}{Create an Application Fix node} +\calls{pfFix}{pfApplication} +\calls{pfFix}{pfId} +<>= +(defun |pfFix| (pf) + (|pfApplication| (|pfId| 'Y) pf)) + +@ + \defun{pfFree?}{Is this a Free node?} \calls{pfFree?}{pfAbSynOp?} <>= @@ -37437,6 +37575,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> @@ -37485,6 +37624,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> @@ -37502,6 +37642,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> @@ -37539,10 +37680,14 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> +<> +<> <> <> <> <> +<> <> <> <> @@ -37627,6 +37772,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> @@ -37719,6 +37865,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> diff --git a/changelog b/changelog index 7c87f4e..fe7590c 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,7 @@ +20100220 tpd src/axiom-website/patches.html 20100220.02.tpd.patch +20100220 tpd src/interp/ptrees.lisp treeshake +20100220 tpd src/interp/cparse.lisp treeshake +20100220 tpd books/bookvol5 treeshake cparse, ptrees 20100220 tpd src/axiom-website/patches.html 20100220.01.tpd.patch 20100220 tpd src/interp/ptrees.lisp treeshake 20100220 tpd src/interp/cparse.lisp treeshake diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 12798b5..daffe75 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -2479,5 +2479,7 @@ books/bookvol5 treeshake ptrees
books/bookvol10.4, unittest2.input fix broken credit test
20100220.01.tpd.patch books/bookvol5 treeshake cparse, ptrees
+20100220.02.tpd.patch +books/bookvol5 treeshake cparse, ptrees
diff --git a/src/interp/cparse.lisp.pamphlet b/src/interp/cparse.lisp.pamphlet index db6830f..7d52f2e 100644 --- a/src/interp/cparse.lisp.pamphlet +++ b/src/interp/cparse.lisp.pamphlet @@ -631,55 +631,6 @@ (OR (|npLocalItemlist|) (|npTrap|)) (|npPush| (|pfExport| (|npPop1|))))))) -;npFix()== npEqKey "FIX" and npPP function npDef -; and npPush pfFix npPop1 () -(DEFUN |npFix| () - (PROG NIL - (RETURN - (AND - (|npEqKey| (QUOTE FIX)) - (|npPP| (FUNCTION |npDef|)) - (|npPush| (|pfFix| (|npPop1|))))))) - -;npMacro()== npEqKey "MACRO" and npPP function npMdef -(DEFUN |npMacro| () - (PROG NIL - (RETURN - (AND - (|npEqKey| (QUOTE MACRO)) - (|npPP| (FUNCTION |npMdef|)))))) - -;npAdd(extra)== -; npEqKey "ADD" and -; a:=npState() -; npDefinitionOrStatement() or npTrap() -; npEqPeek "IN" => -; npRestore a -; (npVariable() or npTrap()) and -; npCompMissing "IN" and -; (npDefinitionOrStatement() or npTrap()) and -; npPush pfAdd(npPop2(),npPop1(),extra) -; npPush pfAdd(pfNothing(),npPop1(),extra) -(DEFUN |npAdd| (|extra|) - (PROG (|a|) - (RETURN - (AND - (|npEqKey| (QUOTE ADD)) - (PROGN - (SETQ |a| (|npState|)) - (OR (|npDefinitionOrStatement|) (|npTrap|)) - (COND - ((|npEqPeek| (QUOTE IN)) - (PROGN - (|npRestore| |a|) - (AND - (OR (|npVariable|) (|npTrap|)) - (|npCompMissing| (QUOTE IN)) - (OR (|npDefinitionOrStatement|) (|npTrap|)) - (|npPush| (|pfAdd| (|npPop2|) (|npPop1|) |extra|))))) - ((QUOTE T) - (|npPush| (|pfAdd| (|pfNothing|) (|npPop1|) |extra|))))))))) - ;npSignatureDefinee()== ; npName() or npInfixOperator() or npPrefixColon() (DEFUN |npSignatureDefinee| () @@ -687,40 +638,6 @@ (RETURN (OR (|npName|) (|npInfixOperator|) (|npPrefixColon|))))) -; -;npSigDecl()== npEqKey "COLON" and (npType() or npTrap()) and -; npPush pfSpread (pfParts npPop2(),npPop1()) -(DEFUN |npSigDecl| () - (PROG NIL - (RETURN - (AND - (|npEqKey| (QUOTE COLON)) - (OR (|npType|) (|npTrap|)) - (|npPush| (|pfSpread| (|pfParts| (|npPop2|)) (|npPop1|))))))) - -;npSigItem()==npTypeVariable() and (npSigDecl() or npTrap()) -(DEFUN |npSigItem| () - (PROG NIL - (RETURN - (AND (|npTypeVariable|) (OR (|npSigDecl|) (|npTrap|)))))) - -;npSigItemlist()== npListing function npSigItem -; and npPush pfListOf pfAppend pfParts npPop1() -(DEFUN |npSigItemlist| () - (PROG NIL - (RETURN - (AND - (|npListing| (FUNCTION |npSigItem|)) - (|npPush| (|pfListOf| (|pfAppend| (|pfParts| (|npPop1|))))))))) - -;npSignature()== -; npSigItemlist() and -; npPush pfWDec(pfNothing(),npPop1()) -(DEFUN |npSignature| () - (PROG NIL - (RETURN - (AND (|npSigItemlist|) (|npPush| (|pfWDec| (|pfNothing|) (|npPop1|))))))) - ;npDecl()== npEqKey "COLON" and (npType() or npTrap()) and ; npPush pfTyped (npPop2(),npPop1()) (DEFUN |npDecl| () diff --git a/src/interp/ptrees.lisp.pamphlet b/src/interp/ptrees.lisp.pamphlet index 14e6a7a..f79918c 100644 --- a/src/interp/ptrees.lisp.pamphlet +++ b/src/interp/ptrees.lisp.pamphlet @@ -60,21 +60,6 @@ (DEFUN |pfReturnNoName| (|value|) (PROG () (RETURN (|pfReturn| |value| (|pfNothing|))))) -;pfSpread(l,t)== [pfTyped(i,t) for i in l] - -(DEFUN |pfSpread| (|l| |t|) - (PROG () - (RETURN - ((LAMBDA (|bfVar#4| |bfVar#3| |i|) - (LOOP - (COND - ((OR (ATOM |bfVar#3|) - (PROGN (SETQ |i| (CAR |bfVar#3|)) NIL)) - (RETURN (NREVERSE |bfVar#4|))) - ('T (SETQ |bfVar#4| (CONS (|pfTyped| |i| |t|) |bfVar#4|)))) - (SETQ |bfVar#3| (CDR |bfVar#3|)))) - NIL |l| NIL)))) - ;--The rest have been generated from ABCUT INPUT ;-- 1/31/89 ; @@ -163,11 +148,6 @@ (DEFUN |pfCoerceto| (|pfexpr| |pftype|) (PROG () (RETURN (|pfTree| '|Coerceto| (LIST |pfexpr| |pftype|))))) -;pfFix pf== pfApplication(pfId "Y",pf) - -(DEFUN |pfFix| (|pf|) - (PROG () (RETURN (|pfApplication| (|pfId| 'Y) |pf|)))) - ;-- MLambda := (Args: [Id], Body: Expr) ;pfMLambda(pfargs, pfbody) == pfTree('MLambda, [pfargs, pfbody])