diff --git a/books/bookvol9.pamphlet b/books/bookvol9.pamphlet index 70f91a9..1acbdf6 100644 --- a/books/bookvol9.pamphlet +++ b/books/bookvol9.pamphlet @@ -286,24 +286,23 @@ The first thing {\tt )compile} does is look for a source code filename among its arguments. Thus \begin{verbatim} -)compile mycode.as -)compile /u/jones/as/mycode.as )compile mycode +)co mycode +)co mycode.spad \end{verbatim} all invoke {\tt )compiler} on the file {\tt -/u/jones/as/mycode.as} if the current Axiom working -directory is {\tt /u/jones/as.} (Recall that you can set the +/u/jones/mycode.spad} if the current Axiom working +directory is {\tt /u/jones.} Recall that you can set the working directory via the {\tt )cd} command. If you don't set it explicitly, it is the directory from which you started -Axiom.) +Axiom. This is frequently all you need to compile your file. This simple command: \begin{enumerate} -\item Invokes the chosen compiler and produces Lisp output. -\item Calls the Lisp compiler if the compilation was -successful. +\item Invokes the Spad compiler and produces Lisp output. +\item Calls the Lisp compiler if the compilation was successful. \item Uses the {\tt )library} command to tell Axiom about the contents of your compiled file and arrange to have those contents loaded on demand. @@ -318,9 +317,8 @@ For example, By default, the {\tt )library} system command {\it exposes} all domains and categories it processes. -This means that the Axiom intepreter will consider those -domains and categories when it is trying to resolve a reference -to a function. +This means that the Axiom intepreter will consider those domains and +categories when it is trying to resolve a reference to a function. Sometimes domains and categories should not be exposed. For example, a domain may just be used privately by another domain and may not be meant for top-level use. @@ -351,7 +349,7 @@ processed, e.g. \subsection{Spad compiler} This command compiles files with file extension {\tt .spad} -with the old Axiom system compiler. +with the Spad system compiler. The {\tt )translate} option is used to invoke a special version of the old system compiler that will translate a {\it .spad} file to a {\it @@ -2150,6 +2148,52 @@ preferred to the underlying representation -- RDJ 9/12/83 @ +\defun{compLambda}{compLambda} +\calls{compLambda}{qcar} +\calls{compLambda}{qcdr} +\calls{compLambda}{argsToSig} +\calls{compLambda}{compAtSign} +\calls{compLambda}{stackAndThrow} +<>= +(defun |compLambda| (x m e) + (let (vl body tmp1 tmp2 tmp3 target a1 args arg1 sig1 ress) + (setq vl (cadr x)) + (setq body (caddr x)) + (cond + ((and (pairp vl) (eq (qcar vl) '|:|) + (progn + (setq tmp1 (qcdr vl)) + (and (pairp tmp1) + (progn + (setq args (qcar tmp1)) + (setq tmp2 (qcdr tmp1)) + (and (pairp tmp2) + (eq (qcdr tmp2) nil) + (progn + (setq target (qcar tmp2)) + t)))))) + (when (and (pairp args) (eq (qcar args) '|@Tuple|)) + (setq args (qcdr args))) + (cond + ((listp args) + (setq tmp3 (|argsToSig| args)) + (setq arg1 (CAR tmp3)) + (setq sig1 (CADR tmp3)) + (cond + (sig1 + (setq ress + (|compAtSign| + (list '@ + (list '+-> arg1 body) + (cons '|Mapping| (cons target sig1))) m e)) + (format t "TPDHERE4~%") + ress) + (t (format t "TPDHERE1~%") (|stackAndThrow| (list '|compLambda| x ))))) + (t (format t "TPDHERE2~%") (|stackAndThrow| (list '|compLambda| x ))))) + (t (format t "TPDHERE3~%") (|stackAndThrow| (list '|compLambda| x )))))) + +@ + \defun{compMakeDeclaration}{compMakeDeclaration} \calls{compMakeDeclaration}{compColon} \usesdollar{compMakeDeclaration}{insideExpressionIfTrue} @@ -2426,6 +2470,7 @@ if \verb|$InteractiveMode| then use a null outputstream <> <> <> +<> <> <> <> diff --git a/changelog b/changelog index f9c1e54..c224663 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +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 20100910 tpd src/axiom-website/patches.html 20100910.02.tpd.patch 20100910 tpd src/interp/compiler.lisp treeshake compiler 20100910 tpd books/bookvol9 treeshake compiler diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 2a466c5..f8a4546 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -3115,5 +3115,7 @@ books/bookvol9 treeshake compiler
books/bookvol9 treeshake compiler
20100910.02.tpd.patch books/bookvol9 treeshake compiler
+20100911.01.tpd.patch +books/bookvol9 treeshake compiler
diff --git a/src/interp/compiler.lisp.pamphlet b/src/interp/compiler.lisp.pamphlet index 9d13682..57fa8cc 100644 --- a/src/interp/compiler.lisp.pamphlet +++ b/src/interp/compiler.lisp.pamphlet @@ -153,73 +153,6 @@ (CONS (REVERSE |arg1|) (CONS (REVERSE |sig1|) NIL)))))))))) @ -\subsection{compLambda} -<<*>>= -;compLambda(x is ["+->",vl,body],m,e) == -; vl is [":",args,target] => -; args:= -; args is ["Tuple",:a1] => a1 -; args -; LISTP(args) => -; [arg1,sig1]:=argsToSig(args) -; sig1 => -; ress:=compAtSign(["@",["+->",arg1,body],["Mapping",target,:sig1]],m,e) -; ress -; stackAndThrow ["compLambda",x] -; stackAndThrow ["compLambda",x] -; stackAndThrow ["compLambda",x] - -(DEFUN |compLambda| (|x| |m| |e|) - (PROG (|vl| |body| |ISTMP#1| |ISTMP#2| |target| |a1| |args| - |LETTMP#1| |arg1| |sig1| |ress|) - (RETURN - (PROGN - (COND ((EQ (CAR |x|) '+->) (CAR |x|))) - (SPADLET |vl| (CADR |x|)) - (SPADLET |body| (CADDR |x|)) - (COND - ((AND (PAIRP |vl|) (EQ (QCAR |vl|) '|:|) - (PROGN - (SPADLET |ISTMP#1| (QCDR |vl|)) - (AND (PAIRP |ISTMP#1|) - (PROGN - (SPADLET |args| (QCAR |ISTMP#1|)) - (SPADLET |ISTMP#2| (QCDR |ISTMP#1|)) - (AND (PAIRP |ISTMP#2|) - (EQ (QCDR |ISTMP#2|) NIL) - (PROGN - (SPADLET |target| (QCAR |ISTMP#2|)) - 'T)))))) - (SPADLET |args| - (COND - ((AND (PAIRP |args|) (EQ (QCAR |args|) '|@Tuple|) - (PROGN (SPADLET |a1| (QCDR |args|)) 'T)) - |a1|) - ('T |args|))) - (COND - ((LISTP |args|) (SPADLET |LETTMP#1| (|argsToSig| |args|)) - (SPADLET |arg1| (CAR |LETTMP#1|)) - (SPADLET |sig1| (CADR |LETTMP#1|)) - (COND - (|sig1| (SPADLET |ress| - (|compAtSign| - (CONS '@ - (CONS - (CONS '+-> - (CONS |arg1| (CONS |body| NIL))) - (CONS - (CONS '|Mapping| - (CONS |target| |sig1|)) - NIL))) - |m| |e|)) - |ress|) - ('T - (|stackAndThrow| (CONS '|compLambda| (CONS |x| NIL)))))) - ('T (|stackAndThrow| (CONS '|compLambda| (CONS |x| NIL)))))) - ('T (|stackAndThrow| (CONS '|compLambda| (CONS |x| NIL))))))))) - -@ - \subsection{extractCodeAndConstructTriple} <<*>>= ;extractCodeAndConstructTriple(u, m, oldE) ==