diff --git a/books/bookvol9.pamphlet b/books/bookvol9.pamphlet index 1acbdf6..fa3d377 100644 --- a/books/bookvol9.pamphlet +++ b/books/bookvol9.pamphlet @@ -2194,6 +2194,50 @@ preferred to the underlying representation -- RDJ 9/12/83 @ +\defun{argsToSig}{argsToSig} +<>= +(defun |argsToSig| (args) + (let (tmp1 v tmp2 tt sig1 arg1 bad) + (cond + ((and (pairp args) (eq (qcar args) '|:|) + (progn + (setq tmp1 (qcdr args)) + (and (pairp tmp1) + (progn + (setq v (qcar tmp1)) + (setq tmp2 (qcdr tmp1)) + (and (pairp tmp2) + (eq (qcdr tmp2) nil) + (progn + (setq tt (qcar tmp2)) + t)))))) + (list (list v) (list tt))) + (t + (setq sig1 nil) + (setq arg1 nil) + (setq bad nil) + (dolist (arg args) + (cond + ((and (pairp arg) (eq (qcar arg) '|:|) + (progn + (setq tmp1 (qcdr arg)) + (and (pairp tmp1) + (progn + (setq v (qcar tmp1)) + (setq tmp2 (qcdr tmp1)) + (and (pairp tmp2) (eq (qcdr tmp2) nil) + (progn + (setq tt (qcar tmp2)) + t)))))) + (setq sig1 (cons tt sig1)) + (setq arg1 (cons v arg1))) + (t (setq bad t)))) + (cond + (bad (list nil nil )) + (t (list (reverse arg1) (reverse sig1)))))))) + +@ + \defun{compMakeDeclaration}{compMakeDeclaration} \calls{compMakeDeclaration}{compColon} \usesdollar{compMakeDeclaration}{insideExpressionIfTrue} @@ -2462,6 +2506,7 @@ if \verb|$InteractiveMode| then use a null outputstream <> +<> <> <> <> diff --git a/changelog b/changelog index c224663..40004d2 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +20100912 tpd src/axiom-website/patches.html 20100912.01.tpd.patch +20100912 tpd src/interp/compiler.lisp treeshake compiler +20100912 tpd books/bookvol9 treeshake compiler 20100911 tpd src/axiom-website/patches.html 20100911.01.tpd.patch 20100911 tpd src/interp/compiler.lisp treeshake compiler 20100911 tpd books/bookvol9 treeshake compiler diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index f8a4546..c1de09b 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -3117,5 +3117,7 @@ books/bookvol9 treeshake compiler
books/bookvol9 treeshake compiler
20100911.01.tpd.patch books/bookvol9 treeshake compiler
+20100912.01.tpd.patch +books/bookvol9 treeshake compiler
diff --git a/src/interp/compiler.lisp.pamphlet b/src/interp/compiler.lisp.pamphlet index 57fa8cc..2ac10ab 100644 --- a/src/interp/compiler.lisp.pamphlet +++ b/src/interp/compiler.lisp.pamphlet @@ -91,68 +91,6 @@ ('T (|ScanOrPairVec| '|hasFormalMapVariable,hasone?| |x|))))))) @ -\subsection{argsToSig} -<<*>>= -;argsToSig(args) == -; args is [":",v,t] => [[v],[t]] -; sig1:=[] -; arg1:=[] -; bad:=false -; for arg in args repeat -; arg is [":",v,t] => -; sig1:=[t,:sig1] -; arg1:=[v,:arg1] -; bad:=true -; bad=>[nil,nil] -; [REVERSE(arg1),REVERSE(sig1)] - -(DEFUN |argsToSig| (|args|) - (PROG (|ISTMP#1| |v| |ISTMP#2| |t| |sig1| |arg1| |bad|) - (RETURN - (SEQ (COND - ((AND (PAIRP |args|) (EQ (QCAR |args|) '|:|) - (PROGN - (SPADLET |ISTMP#1| (QCDR |args|)) - (AND (PAIRP |ISTMP#1|) - (PROGN - (SPADLET |v| (QCAR |ISTMP#1|)) - (SPADLET |ISTMP#2| (QCDR |ISTMP#1|)) - (AND (PAIRP |ISTMP#2|) - (EQ (QCDR |ISTMP#2|) NIL) - (PROGN - (SPADLET |t| (QCAR |ISTMP#2|)) - 'T)))))) - (CONS (CONS |v| NIL) (CONS (CONS |t| NIL) NIL))) - ('T (SPADLET |sig1| NIL) (SPADLET |arg1| NIL) - (SPADLET |bad| NIL) - (DO ((G166364 |args| (CDR G166364)) (|arg| NIL)) - ((OR (ATOM G166364) - (PROGN (SETQ |arg| (CAR G166364)) NIL)) - NIL) - (SEQ (EXIT (COND - ((AND (PAIRP |arg|) (EQ (QCAR |arg|) '|:|) - (PROGN - (SPADLET |ISTMP#1| (QCDR |arg|)) - (AND (PAIRP |ISTMP#1|) - (PROGN - (SPADLET |v| (QCAR |ISTMP#1|)) - (SPADLET |ISTMP#2| - (QCDR |ISTMP#1|)) - (AND (PAIRP |ISTMP#2|) - (EQ (QCDR |ISTMP#2|) NIL) - (PROGN - (SPADLET |t| - (QCAR |ISTMP#2|)) - 'T)))))) - (SPADLET |sig1| (CONS |t| |sig1|)) - (SPADLET |arg1| (CONS |v| |arg1|))) - ('T (SPADLET |bad| 'T)))))) - (COND - (|bad| (CONS NIL (CONS NIL NIL))) - ('T - (CONS (REVERSE |arg1|) (CONS (REVERSE |sig1|) NIL)))))))))) - -@ \subsection{extractCodeAndConstructTriple} <<*>>= ;extractCodeAndConstructTriple(u, m, oldE) ==