diff --git a/books/bookvol9.pamphlet b/books/bookvol9.pamphlet index d668ba8..cfd7560 100644 --- a/books/bookvol9.pamphlet +++ b/books/bookvol9.pamphlet @@ -1702,7 +1702,7 @@ always positioned ON the first character. \usesdollar{aplTran1}{boot} <>= (defun |aplTran1| (x) - (let (op argl1 argl f y opprime yprime tmp1 arglAssoc futureArgl g a tmp2) + (let (op argl1 argl f y opprime yprime tmp1 arglAssoc futureArgl g) (declare (special $boot)) (if (atom x) x @@ -2122,7 +2122,7 @@ nothing (see boot2Lisp) yet still allow function call (lisp2BootAndComp). \usesdollar{defLET2}{letGenVarCounter} <>= (defun |defLET2| (lhs rhs) - (let (id a b l1 var2 patrev rev g l2 tmp2 tmp3 val1 tmp1 var1 isPred) + (let (a b l1 var2 patrev rev g l2 val1 var1 isPred) (declare (special |$inDefIS| $let |$letGenVarCounter|)) (cond ((identp lhs) (|defLetForm| lhs rhs)) @@ -2211,6 +2211,11 @@ nothing (see boot2Lisp) yet still allow function call (lisp2BootAndComp). @ +\defdollar{defstack} +<>= +(defparameter $defstack nil) + +@ \defun{def-where}{def-where} \calls{def-where}{def-whereclauselist} \calls{def-where}{def-inner} @@ -2289,6 +2294,16 @@ nothing (see boot2Lisp) yet still allow function call (lisp2BootAndComp). @ +<>= +(defparameter $IS-GENSYMLIST nil) + +@ + +<>= +(defparameter Initial-Gensym (list (gensym))) + +@ + \subsection{IS} \defun{def-is}{def-is} \calls{def-is}{def-is2} @@ -2302,6 +2317,18 @@ nothing (see boot2Lisp) yet still allow function call (lisp2BootAndComp). @ +\defdollar{is-eqlist} +<>= +(defparameter $is-eqlist nil) + +@ + +\defdollar{is-spill-list} +<>= +(defparameter $is-spill-list nil) + +@ + \defun{def-is2}{def-is2} \calls{def-is2}{eqcar} \calls{def-is2}{moan} @@ -2451,6 +2478,22 @@ nothing (see boot2Lisp) yet still allow function call (lisp2BootAndComp). @ +\defun{def-is-rev}{def-is-rev} +\calls{def-is-rev}{def-is-rev} +\calls{def-is-rev}{errhuh} +<>= +(defun def-is-rev (x a) + (let (y) + (if (eq (first x) 'cons) + (cond + ((not (third x)) (list 'cons (second x) a)) + ((setq y (def-is-rev (third x) nil)) + (setf (third y) (list 'cons (second x) a)) + y)) + (errhuh)))) + +@ + \defun{defISReverse}{defISReverse} This reverses forms coming from APPENDs in patterns. It is pretty much just a translation of DEF-IS-REV @@ -2480,6 +2523,38 @@ It is pretty much just a translation of DEF-IS-REV @ +\defun{def-it}{def-it} +\calls{def-it}{def-in2on} +\calls{def-it}{deftran} +\calls{def-it}{reset} +\calls{def-it}{def-let} +\calls{def-it}{errhuh} +<>= +(defun def-it (fn l) + (setq l (reverse l)) + (let ((b (first l))) + (let ((it (def-in2on (nreverse (rest l))))) + (let ((itp + (apply #'append + (mapcar + #'(lambda (x &aux op y g) + (if (and (member (setq op (first x)) '(in on)) + (not (atom (second x)))) + (if (eqcar (setq y (second x)) 'spadlet) + (if (atom (setq g (second y))) + (list + `(,op ,g ,(deftran (third x))) + `(reset ,(def-let (deftran (third y)) g))) + (errhuh)) + (list + `(,op ,(setq g (gensym)) ,(deftran (third x))) + `(reset ,(def-let (deftran (second x)) g)))) + `(,x))) + it)))) + (cons fn (nconc itp (list b))))))) + +@ + \defun{def-repeat}{def-repeat} \calls{def-repeat}{def-it} \calls{def-repeat}{deftran} @@ -2490,6 +2565,30 @@ It is pretty much just a translation of DEF-IS-REV @ +\defun{def-string}{def-string} +\calls{def-string}{deftran} +\uses{def-string}{*package*} +<>= +(defun def-string (x) + ;; following patches needed to fix reader bug in Lucid Common Lisp + (if (and (> (size x) 0) (or (char= (elt x 0) #\.) (char= (elt x 0) #\Page))) + `(intern ,X ,(package-name *package*)) + `(quote ,(deftran (intern x))))) + +@ + +\defun{def-stringtoquote}{def-stringtoquote} +\calls{def-stringtoquote}{def-addlet} +\calls{def-stringtoquote}{def-stringtoquote} +<>= +(defun def-stringtoquote (x) + (cond + ((stringp x) (list 'quote (intern x))) + ((atom x) x) + ((cons (def-addlet (first x)) (def-stringtoquote (cdr x)))))) + +@ + \defun{hackforis}{hackforis} \calls{hackforis}{hackforis1} <>= @@ -5641,6 +5740,8 @@ if \verb|$InteractiveMode| then use a null outputstream <> <> <> +<> +<> <> <> <> @@ -5650,6 +5751,8 @@ if \verb|$InteractiveMode| then use a null outputstream <> <> <> +<> +<> <> <> <> diff --git a/changelog b/changelog index 41ddebe..3c41619 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +20101015 tpd src/axiom-website/patches.html 20101015.02.tpd.patch +20101015 tpd src/interp/parsing.lisp treeshake compiler +20101014 tpd books/bookvol9 treeshake compiler 20101015 tpd src/axiom-website/patches.html 20101015.01.tpd.patch 20101015 tpd books/bookvol5 latex cleanup 20101014 tpd src/axiom-website/patches.html 20101014.01.tpd.patch diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 8969ca1..4f61283 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -3214,5 +3214,7 @@ books/bookvol9 treeshake compiler
books/bookvol9 treeshake compiler
20101015.01.tpd.patch books/bookvol5 latex cleanup
+20101015.02.tpd.patch +books/bookvol9 treeshake compiler
diff --git a/src/interp/parsing.lisp.pamphlet b/src/interp/parsing.lisp.pamphlet index a212816..50ad7d5 100644 --- a/src/interp/parsing.lisp.pamphlet +++ b/src/interp/parsing.lisp.pamphlet @@ -1335,11 +1335,6 @@ foo defined inside of fum gets renamed as fum,foo.") (defun MKPROGN (L) (MKPF L 'PROGN)) -(defun DEF-STRINGTOQUOTE (X) - (COND ((STRINGP X) (LIST 'QUOTE (INTERN X))) - ((ATOM X) X) - ((CONS (DEF-ADDLET (FIRST X)) (DEF-STRINGTOQUOTE (CDR X)))))) - (defun DEF-ADDLET (X) (if (ATOM X) (if (STRINGP X) `(QUOTE ,(intern x)) X) @@ -1416,35 +1411,6 @@ foo defined inside of fum gets renamed as fum,foo.") (DEF-select2 X (CDR Y)))) ((MOAN (format nil "Unexpected CASE clause: ~S" (FIRST Y))))))) -(defun DEF-IT (FN L) - (setq L (reverse L)) - (let ((B (first L))) - (let ((it (DEF-IN2ON (NREVERSE (rest L))))) - (let ((itp - (apply #'APPEND - (mapcar - #'(lambda (x &aux OP Y G) - (if (AND (MEMBER (setq OP (FIRST X)) '(IN ON)) - (NOT (ATOM (SECOND X)))) - (if (EQCAR (setq Y (SECOND X)) 'SPADLET) - (if (ATOM (setq G (SECOND Y))) - (LIST `(,OP ,G - ,(DEFTRAN (THIRD X))) - `(RESET - ,(DEF-LET - (DEFTRAN - (THIRD Y)) G))) - (ERRHUH)) - (LIST - `(,OP ,(setq G (GENSYM)) - ,(DEFTRAN (THIRD X))) - `(RESET - ,(DEF-LET (DEFTRAN (SECOND X)) - G)))) - `(,X))) - IT)))) - (CONS FN (NCONC ITP (LIST B))))))) - (defun DEF-IN2ON (IT) (mapcar #'(lambda (x) (let (u) (COND @@ -1490,23 +1456,10 @@ foo defined inside of fum gets renamed as fum,foo.") (defun DEF-ISNT (X) (DEFTRAN (LIST 'NULL (CONS 'IS X)))) -(defparameter $IS-GENSYMLIST nil) - -(defparameter Initial-Gensym (list (gensym))) - (defun IS-GENSYM () (if (NOT (CDR $IS-GENSYMLIST)) (RPLACD $IS-GENSYMLIST (LIST (GENSYM)))) (pop $IS-GENSYMLIST)) -(defparameter $IS-EQLIST nil) -(defparameter $IS-SPILL_LIST nil) - -(defun DEF-STRING (X) - ;; following patches needed to fix reader bug in Lucid Common Lisp - (if (and (> (size x) 0) (or (char= (elt x 0) #\.) (char= (elt x 0) #\Page))) - `(INTERN ,X ,(package-name *PACKAGE*)) - `(QUOTE ,(DEFTRAN (INTERN X))))) - (defun DEF-IS-EQLIST (STR) (let (g e) (COND ((NOT STR) (PUSH `(EQ ,(setq G (IS-GENSYM)) NIL) $IS-EQLIST) G) @@ -1585,17 +1538,6 @@ foo defined inside of fum gets renamed as fum,foo.") (defun LIST2CONS-1 (X) (if (NOT X) NIL (LIST 'CONS (FIRST X) (LIST2CONS-1 (CDR X))))) -(defun DEF-IS-REV (X A) - (let (y) - (if (EQ (FIRST X) 'CONS) - (COND ((NOT (THIRD X)) (LIST 'CONS (SECOND X) A)) - ((setq Y (DEF-IS-REV (THIRD X) NIL)) - (setf (THIRD Y) (LIST 'CONS (SECOND X) A)) - Y)) - (ERRHUH)))) - -(defparameter $DEFSTACK nil) - (defun WHDEF (X Y) "Returns no value -- side effect is to do a compilation or modify a global." (prog ((XP (if (ATOM X) (LIST X) X)) Op)