Google
 

Trailing-Edge - PDP-10 Archives - -
There are no other files named in the archive.
(FILECREATED "25-MAY-81 22:51:02" <LISPUSERS>PRINTL.;20 4848   

     changes to:  PRINTL

     previous date: "30-MAY-79 00:25:56" <LISPUSERS>PRINTL.;19)


(PRETTYCOMPRINT PRINTLCOMS)

(RPAQQ PRINTLCOMS [(FNS GETPLVALUE CLOSELINE PRINTL PRINTL1 PRINTLATOM PRINTLATOMLIST)
		   (BLOCKS (PRINTL PRINTL CLOSELINE PRINTL1 PRINTLATOM PRINTLATOMLIST
				   (GLOBALVARS PRINTLLIMIT))
			   (NIL GETPLVALUE (GLOBALVARS LISPXHISTORY)))
		   (VARS PRINTLLIMIT)
		   (LISPXMACROS PRNTL)
		   (DECLARE: DONTCOPY EVAL@COMPILE (P (RESETSAVE DWIMIFYCOMPFLG T])
(DEFINEQ

(GETPLVALUE
  (LAMBDA NIL                         (* mk: "30-NOV-77 14:56")
    (for X in LISPXHISTORY:1 do (OR X_X:3=NIL
				    X='%
				    (RETFROM 'GETPLVALUE X)))))

(CLOSELINE
  [LAMBDA NIL                                          (* rmk: "25-JAN-79 18:32")
    (DECLARE (USEDFREE CLOSELEVEL RM FILE))
    (if CLOSELEVEL
	then (printout FILE .TAB RM ":" CLOSELEVEL)
	     (CLOSELEVEL_NIL])

(PRINTL
  [LAMBDA (ITEM LIMIT LMARG RMARG FILE)
    (DECLARE (SPECVARS LIMIT LMARG RMARG FILE))        (* rmk: "25-MAY-81 22:50")
    (if ~(NUMBERP LMARG)
	then LMARG_(POSITION FILE))
    (if ~(NUMBERP LIMIT)
	then LIMIT_PRINTLLIMIT)
    (if ~(NUMBERP RMARG)
	then RMARG_(LINELENGTH NIL FILE) - 5)
    FILE_(OR ~FILE (OPENP FILE)
	     (OPENFILE FILE 'OUTPUT 'NEW))
    (PROG ((CLOSELEVEL 1)
	   (INDENT (LMARG+3))
	   (N 0)
	   (RM RMARG))
          (DECLARE (SPECVARS INDENT RM CLOSELEVEL N))
          (RMARG_RMARG-2)
          (CLRHASH)
          (if (LISTP ITEM)
	      then (printout FILE .TAB0 LMARG .I3 (N+1)
			     ":")
		   (PRINTL1 ITEM INDENT+3 2 FILE)
		   (CLOSELINE)
	    else (printout FILE .TAB0 INDENT ITEM))
          (TERPRI FILE])

(PRINTL1
  [LAMBDA (ITEM INDENT LEVEL)                          (* rmk: "25-JAN-79 18:31")
    (DECLARE (SPECVARS INDENT)
	     (USEDFREE RMARG LMARG LIMIT N FILE))
    (PROG (C CLOSELEVEL SPACE)
          (DECLARE (SPECVARS CLOSELEVEL SPACE))
          (printout FILE .TAB0 INDENT "(")
          [for I on ITEM do (N_N+1)
			    (PUTHASH I N)
			    (if (LISTP I:1)
				then (if C_(GETHASH I:1)
					 then (PRINTLATOMLIST <'{ C '} >)
				       elseif LEVEL gt LIMIT
					 then (PRINTLATOM '{--})
				       else (if I~=ITEM
						then (CLOSELINE)
						     (printout FILE .TAB0 LMARG .I3 N ":"))
					    (if I=ITEM
						then CLOSELEVEL_N+1
					      else N_(CLOSELEVEL_N)+ -1)
					    (PRINTL1 I:1 (if (POSITION FILE) lt RMARG
							     then INDENT+1
							   else LMARG+6)
						     LEVEL+1)
					    (SPACE_T))
			      else (PRINTLATOM I:1))
			    (AND I::1 (if (ATOM I::1)
					  then (printout FILE " . " I::1)
					elseif C_(GETHASH I::1)
					  then (printout FILE " . {" C "}")
					       (RETURN]
          (if (POSITION FILE)+ 1 lt RMARG
	      then (PRIN1 ")" FILE)
	    else (CLOSELINE)
		 (printout FILE .TAB0 INDENT ")"])

(PRINTLATOM
  [LAMBDA (ATOM)                                       (* rmk: "25-JAN-79 18:15")
    (DECLARE (USEDFREE INDENT SPACE FILE RMARG))
    (if (POSITION FILE)+(NCHARS ATOM)+(if SPACE
					  then 1
					else 0)
	LT RMARG
      else (CLOSELINE)
	   (printout FILE .TAB0 (INDENT+1))
	   (SPACE_NIL))
    (if SPACE
	then (PRIN1 " " FILE))
    (PRIN1 ATOM)
    SPACE_T])

(PRINTLATOMLIST
  [LAMBDA (ATOMS)                                      (* rmk: "25-JAN-79 18:16")
    (DECLARE (USEDFREE SPACE FILE RMARG INDENT))
    (PROG [(L (for I in ATOMS sum (NCHARS I]
          (if (POSITION FILE)+(if SPACE
				  then L+1
				else L)
	      LT RMARG
	      then (AND SPACE (PRIN1 " " FILE))
	    else (CLOSELINE)
		 (printout FILE .TAB0 (INDENT+1)))
          (for I on ATOMS do (PRIN1 I:1 FILE))
          (SPACE_T])
)
[DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY
(BLOCK: PRINTL PRINTL CLOSELINE PRINTL1 PRINTLATOM PRINTLATOMLIST (GLOBALVARS PRINTLLIMIT))
(BLOCK: NIL GETPLVALUE (GLOBALVARS LISPXHISTORY))
]

(RPAQQ PRINTLLIMIT 4)

(ADDTOVAR LISPXMACROS [PRNTL (COND [(LISTP LISPXLINE)
				    (COND ((NUMBERP (CAR LISPXLINE))
					   (APPLY (FUNCTION PRINTL)
						  (CONS (GETPLVALUE)
							LISPXLINE)))
					  (T (EVAL (CONS (FUNCTION PRINTL)
							 LISPXLINE]
				   (T (APPLY* (FUNCTION PRINTL)
					      (GETPLVALUE])
(DECLARE: DONTCOPY EVAL@COMPILE 
(RESETSAVE DWIMIFYCOMPFLG T)
)
(DECLARE: DONTCOPY
  (FILEMAP (NIL (573 4222 (GETPLVALUE 585 . 780) (CLOSELINE 784 . 1037) (PRINTL 1041 . 1885) (PRINTL1 
1889 . 3247) (PRINTLATOM 3251 . 3689) (PRINTLATOMLIST 3693 . 4219)))))
STOP