(FILECREATED "10-Jul-85 13:04:47" {ERIS}<LISPCORE>SOURCES>BOOTSTRAP.;10 24273  

      changes to:  (FNS MOVD MOVD?)
		   (VARS BOOTSTRAPCOMS)

      previous date: "14-Apr-85 18:33:40" {ERIS}<LISPCORE>SOURCES>BOOTSTRAP.;9)


(* Copyright (c) 1983, 1984, 1985 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT BOOTSTRAPCOMS)

(RPAQQ BOOTSTRAPCOMS [(FNS GETPROP SETATOMVAL RPAQQ RPAQ RPAQ? MOVD MOVD? SELECTQ SELECTQ1 NCONC1 
			   PUTPROP PUTPROPS PROPNAMES ADDPROP REMPROP NAMEFIELD FILECREATED 
			   FILECREATED1 DECLARE: DECLARE:1 LOAD ROOTFILENAME MEMB CLOSEF?)
	[P [MAPC (QUOTE ((PUTD . /PUTD)
			 (PUTPROP . /PUTPROP)
			 (PUTPROP . PUT)
			 (PUT . /PUT)
			 (PRIN1 . LISPXPRIN1)
			 (PRIN2 . LISPXPRIN2)
			 (PRINT . LISPXPRINT)
			 (TERPRI . LISPXTERPRI)
			 (SPACES . LISPXSPACES)
			 (GETPROP . GETP)
			 (SET . SAVESET)
			 (NILL . MISSPELLED?)
			 (SETTOPVAL . /SETTOPVAL)))
		 (FUNCTION (LAMBDA (X)
				   (OR (CCODEP (CDR X))
				       (MOVD (CAR X)
					     (CDR X)
					     NIL T]
	   (MAPC [QUOTE ([STRPOS (LAMBDA (X Y START SKIP ANCHOR TAIL)
					 [COND [(LITATOM X)
						(SETQ X (CDR (VAG (IPLUS (LOC X)
									 2]
					       ((NULL (STRINGP X))
						(SETQ X (MKSTRING X]
					 [COND ((STRINGP Y))
					       [(LITATOM Y)
						(SETQ Y (CDR (VAG (IPLUS (LOC Y)
									 2]
					       (T (SETQ Y (MKSTRING Y]
					 [COND (SKIP (SETQ SKIP (NTHCHAR SKIP 1]
					 (COND [START (COND ((MINUSP START)
							     (SETQ START (IPLUS START (NCHARS Y)
										1]
					       (T (SETQ START 1)))
					 (SETQ Y (SUBSTRING Y START))
					 (PROG ((N START)
						W X1 Y1)
					       L2
					       (SETQ X1 (SUBSTRING X 1))
					       (SETQ Y1 (SUBSTRING Y 1))
					       LP
					       (COND [(SETQ W (GNC X1))
						      (COND ((EQ W (GNC Y1))
							     (GO LP))
							    ((EQ W SKIP)
							     (GO LP))
							    (T (GO NX]
						     (TAIL (RETURN (IPLUS (NCHARS X)
									  N)))
						     (T (RETURN N)))
					       NX
					       (COND (ANCHOR (RETURN)))
					       (COND ((GNC Y)
						      (SETQ N (ADD1 N))
						      (GO L2))
						     (T (RETURN]
			 (PACKFILENAME [LAMBDA (X)
					       X])
			 (UNPACKFILENAME [LAMBDA (X)
						 X])
			 (RESETRESTORE (LAMBDA (RESETVARSLST0 RESETSTATE)
					       (PROG (RESETZ)
						     LP
						     (COND ((AND RESETVARSLST (NEQ RESETVARSLST 
										   RESETVARSLST0))
							    (SETQ RESETZ (CAR RESETVARSLST))
							    (SETQ RESETVARSLST (CDR RESETVARSLST))
							    [COND ((LISTP (CAR RESETZ))
								   (APPLY (CAAR RESETZ)
									  (CDR (CAR RESETZ]
							    (GO LP]
		 (FUNCTION (LAMBDA (X)
				   (OR (GETD (CAR X))
				       (PUTD (CAR X)
					     (CADR X]
	[INITVARS (EOLCHARCODE (CHCON1 (QUOTE %
)))
		  (PRETTYHEADER)
		  (DWIMFLG)
		  (UPDATEMAPFLG)
		  (DFNFLG)
		  (ADDSPELLFLG)
		  (BUILDMAPFLG)
		  (FILEPKGFLG)
		  (SYSFILES)
		  (NOTCOMPILEDFILES)
		  (RESETVARSLST)
		  (LOADPARAMETERS (QUOTE ((SEQUENTIAL T]
	(ADDVARS (LOADEDFILELST))
	[VARS [FILERDTBL (OR (READTABLEP (EVALV (QUOTE FILERDTBL)))
			     (COPYREADTABLE (QUOTE ORIG]
	      (LISPXHIST)
	      (LISPXPRINTFLG T)
	      (PRETTYHEADER "FILE CREATED ")
	      (BELLS (QUOTE ""))
	      (LOADOPTIONS (QUOTE (SYSLOAD NIL T PROP ALLPROP]
	(GLOBALVARS FILEPKGFLG PRETTYHEADER DWIMFLG PRETTYHEADER UPDATEMAPFLG LOADOPTIONS 
		    LOADPARAMETERS FILERDTBL DFNFLG ADDSPELLFLG BUILDMAPFLG FILEPKGFLG SYSFILES)
	(DECLARE: DONTEVAL@LOAD DOCOPY (P (PRINTLEVEL 1000)
					  (RADIX 10)
					  (SETSEPR (QUOTE (20 124))
						   1 FILERDTBL)))
	(DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS
		  (ADDVARS (NLAMA DECLARE: FILECREATED PUTPROPS SELECTQ)
			   (NLAML RPAQ? RPAQ RPAQQ)
			   (LAMA])
(DEFINEQ

(GETPROP
  [LAMBDA (ATM PROP)               (* lmm " 5-SEP-83 22:29")
                                   (* Used to be called GETP)
    (AND (LITATOM ATM)
	 (PROG ((PLIST (GETPROPLIST ATM)))
	   LOOP[COND
		 ((OR (NLISTP PLIST)
		      (NLISTP (CDR PLIST)))
		   (RETURN NIL))
		 ((EQ (CAR PLIST)
		      PROP)
		   (RETURN (CADR PLIST]
	       (SETQ PLIST (CDDR PLIST))
	       (GO LOOP])

(SETATOMVAL
  [LAMBDA (X Y)                                 (* wt: 27-JAN-76 23 20)
                                                (* dummy defiition so 
						rpaqq will work.)
    (COND
      ((GETD (QUOTE VCTOAC))
	(SET X Y))
      (T (SETTOPVAL X Y])

(RPAQQ
  [NLAMBDA (X Y)
    (SETATOMVAL X Y])

(RPAQ
  [NLAMBDA (RPAQX RPAQY)           (* lmm "23-JUL-83 16:10")
                                   (* RPAQ and RPAQQ are used by PRETTYDEF to save VARS.)
    (SETTOPVAL RPAQX (EVAL RPAQY])

(RPAQ?
  [NLAMBDA (RPAQX RPAQY)           (* lmm "23-JUL-83 16:12")
                                   (* RPAQ? and RPAQQ are used by PRETTYDEF to save VARS.)
    (OR (NEQ (GETTOPVAL RPAQX)
	     (QUOTE NOBIND))
	(SETTOPVAL RPAQX (EVAL RPAQY])

(MOVD
  [LAMBDA (FROM TO COPYFLG DONTCOPY)                         (* bvm: "10-Jul-85 12:59")
    (PROG [(NEWFLG (NULL (GETD TO]
          (PUTD TO (COND
		  (COPYFLG (COPY (VIRGINFN FROM)))
		  (T (GETD FROM)))
		DONTCOPY)
          (AND FILEPKGFLG (EXPRP TO)
	       (MARKASCHANGED TO (QUOTE FNS)
			      NEWFLG))
          (RETURN TO])

(MOVD?
  [LAMBDA (FROM TO COPYFLG DONTCOPY)                         (* bvm: "10-Jul-85 13:00")
                                                             (* Like MOVD but only does it if TO is not defined.)
    (COND
      ((NULL (GETD TO))
	(PUTD TO (COND
		(COPYFLG (COPY (VIRGINFN FROM)))
		(T (GETD FROM)))
	      DONTCOPY)
	(AND FILEPKGFLG (EXPRP TO)
	     (MARKASCHANGED TO (QUOTE FNS)
			    T))
	TO])

(SELECTQ
  [NLAMBDA SELCQ
    (APPLY (QUOTE PROGN)
	   (SELECTQ1 (EVAL (CAR SELCQ)
			   (QUOTE SELECTQ))
		     (CDR SELCQ))
	   (QUOTE SELECTQ])

(SELECTQ1
  [LAMBDA (M L)
    (PROG (C)
      LP  (SETQ C L)
          [COND
	    ((NULL (SETQ L (CDR L)))
	      (RETURN C))
	    ([OR (EQ (CAR (SETQ C (CAR C)))
		     M)
		 (AND (LISTP (CAR C))
		      (FMEMB M (CAR C]
	      (RETURN (CDR C]
          (GO LP])

(NCONC1
  [LAMBDA (LST X)

          (* included in wtmisc so can make the call to nconc be linked. so that user can then break on nconc.)


    (NCONC LST (FRPLACD (CONS X LST])

(PUTPROP
  [LAMBDA (ATM PROP VAL)

          (* Included because it must be defined before the MOVD's in BOOTSTRAPCOMS that initialize /PUTPROP are executed.)


    [COND
      [(NULL ATM)
	(ERRORX (LIST 7 (LIST ATM PROP]
      ((NOT (LITATOM ATM))
	(ERRORX (LIST 14 ATM]
    (PROG ((X (GETPROPLIST ATM))
	   X0)
      LOOP(COND
	    ((NLISTP X)
	      (COND
		((AND (NULL X)
		      X0)

          (* typical case. property list ran out on an even parity position. e.g. (A B C D))


		  (FRPLACD (CDR X0)
			   (LIST PROP VAL))
		  (RETURN VAL)))

          (* propety list was initially NIL or a non-list, or else it ended in a non-list following an even parity position, 
	  e.g. (A B . C) fall through and add new property at beginning)


	      )
	    ((NLISTP (CDR X))

          (* property list runs out on an odd parity, or ends in an odd list following an odd parity, e.g. 
	  (A B C) or (A B C . D) fall through and add at beginning)


	      )
	    ((EQ (CAR X)
		 PROP)
	      (FRPLACA (CDR X)
		       VAL)
	      (RETURN VAL))
	    (T (SETQ X (CDDR (SETQ X0 X)))
	       (GO LOOP)))
          [SETPROPLIST ATM (CONS PROP (CONS VAL (GETPROPLIST ATM]
          (RETURN VAL])

(PUTPROPS
  [NLAMBDA X                                                 (* lmm "14-Apr-85 16:45")
    (MAP (CDR X)
	 [FUNCTION (LAMBDA (Y)
	     (PUTPROP (CAR X)
		      (CAR Y)
		      (CADR Y]
	 (FUNCTION CDDR])

(PROPNAMES
  [LAMBDA (ATM)                    (* wt: " 3-AUG-78 01:23")
    (MAPLIST (GETPROPLIST ATM)
	     (FUNCTION CAR)
	     (FUNCTION CDDR])

(ADDPROP
  [LAMBDA (ATM PROP NEW FLG)

          (* If FLG is T, NEW is consed onto the front, otherwise NCONCED onto the end.)

                                                (* Value is new PROP value.)
    [COND
      [(NULL ATM)
	(ERRORX (LIST 7 (LIST PROP NEW]
      ((NOT (LITATOM ATM))
	(ERRORX (LIST 14 ATM]
    (PROG ((X (GETPROPLIST ATM))
	   X0)
      LOOP(COND
	    ((NLISTP X)
	      (COND
		((AND (NULL X)
		      X0)                       (* typical case. property list ran out on an even parity position.)
		  [FRPLACD (CDR X0)
			   (LIST PROP (SETQ NEW (LIST NEW]
		  (RETURN NEW)))

          (* proprty list was initially NIL or a non-lit, or ele it ended in a non-list following an even parity position, 
	  e.g. (A B . C) fall through and add property at beginning of property list.)


	      )
	    ((NLISTP (CDR X))

          (* property list runs out on an odd parity, or else ends in a non-list following an odd parity, e.g. 
	  (A B C) or (A B C . D) fall through and add at beginning)


	      )
	    ((EQ (CAR X)
		 PROP)                          (* PROP found)
	      [FRPLACA (CDR X)
		       (SETQ NEW (COND
			   (FLG (CONS NEW (CADR X)))
			   (T (NCONC1 (CADR X)
				      NEW]
	      (RETURN NEW))
	    (T (SETQ X (CDDR (SETQ X0 X)))
	       (GO LOOP)))                      (* Add to beginning of property list.)
          [SETPROPLIST ATM (CONS PROP (CONS (SETQ NEW (LIST NEW))
					    (GETPROPLIST ATM]
          (RETURN NEW])

(REMPROP
  [LAMBDA (ATM PROP)
    [COND
      ((NULL (LITATOM ATM))
	(ERRORX (LIST 14 ATM]
    (PROG ((X (GETPROPLIST ATM))
	   X0 VAL)
      LP  [COND
	    ((OR (NLISTP X)
		 (NLISTP (CDR X)))
	      (RETURN VAL))
	    ((EQ (CAR X)
		 PROP)
	      (SETQ VAL PROP)
	      [COND
		(X0 (FRPLACD (CDR X0)
			     (CDDR X)))
		(T (SETPROPLIST ATM (CDDR X]
	      (SETQ X (CDDR X)))
	    (T (SETQ X (CDDR (SETQ X0 X]
          (GO LP])

(NAMEFIELD
  [LAMBDA (FILE SUFFIXFLG)         (* lmm "13-MAR-83 23:57")
                                   (* BOOTSTRAP VERSION)
    (PROG (POS (START 1)
	       END)
          (while (SETQ POS (OR (STRPOS (QUOTE })
				       FILE START)
			       (STRPOS (QUOTE >)
				       FILE START)
			       (STRPOS (QUOTE /)
				       FILE START)))
	     do (SETQ START (ADD1 POS)))
          [COND
	    ((SETQ POS (STRPOS (QUOTE ;)
			       FILE))
	      (SETQ END (SUB1 POS))
	      (COND
		((EQ (NTHCHAR FILE END)
		     (QUOTE %.))   (* eliminates null suffix)
		  (SETQ END (SUB1 END]
          [COND
	    ((SETQ POS (STRPOS (QUOTE %.)
			       FILE START))
	      (COND
		((NULL SUFFIXFLG)
		  (SETQ END (SUB1 POS]
          (RETURN (MKATOM (SUBSTRING FILE START END])

(FILECREATED
  [NLAMBDA X                                                (* lmm "12-AUG-84 15:06")
    (DECLARE (USEDFREE FILECREATEDLST))
    (PROG ((FILEDATE (CAR X))
	   (FILE (CADR X))
	   (MESS (FILECREATED1 X)))
          (SETQ FILECREATEDLST (NCONC1 FILECREATEDLST X))
          (COND
	    (PRETTYHEADER                                   (* Presumably if user sets prettyheader to NIL, he 
							    doesnt want to see any file created messages, even those
							    frm compiled files.)
			  (LISPXPRIN1 MESS T)
			  (LISPXPRIN1 FILEDATE T)
			  (LISPXTERPRI T)))
          (COND
	    ((AND FILE (LITATOM FILE))

          (* This is just temporary, primarily for keeping dates of system files which are loaded with FILEPKGFLG=NIL.
	  The real setting up of file property lists is done when ADDFILE is called.)


	      (/PUT (ROOTFILENAME FILE)
		    (QUOTE FILEDATES)
		    (LIST (CONS FILEDATE FILE])

(FILECREATED1
  [LAMBDA (X)                                   (* rmk: "20-FEB-83 21:50")

          (* performs error checking on filecreated expressions. returns the thing to be printed. used by filecreated, and 
	  loadfns)


    (PROG ((FILE (CADR X)))
          (RETURN (COND
		    ((STRINGP FILE)             (* old way of doing COMPILED ON)
		      FILE)
		    ((LISTP FILE)

          (* New. also used for printing COMPILED ON message. CDR is a list of files that were compiled.)


		      (CAR FILE))
		    (T                          (* FILE is an atom, the name of the file)
		       PRETTYHEADER])

(DECLARE:
  [NLAMBDA X                                    (* wt: "20-OCT-77 13:00")
    (DECLARE:1 X T])

(DECLARE:1
  [LAMBDA (X EVALFLG)                           (* wt: "20-OCT-77 13:09")
    (PROG NIL
      LP  (COND
	    ((NLISTP X)
	      (RETURN))
	    [(LISTP (CAR X))
	      (AND EVALFLG (COND
		     ((EQ (CAAR X)
			  (QUOTE DECLARE:))
		       (DECLARE:1 (CDAR X)
				  T))
		     (T (EVAL (CAR X]
	    (T (SELECTQ (CAR X)
			((EVAL@LOAD DOEVAL@LOAD)
			  (SETQ EVALFLG T))
			(EVAL@LOADWHEN (SETQ EVALFLG
					 (EVAL (CADR X)))
				       (SETQ X (CDR X)))
			(DONTEVAL@LOAD (SETQ EVALFLG NIL))
			NIL)))
          (SETQ X (CDR X))
          (GO LP])

(LOAD
  [LAMBDA (FILE LDFLG PRINTFLG)
    (DECLARE (SPECVARS FILE LDFLG PRINTFLG)
	     (GLOBALVARS PRETTYHEADER))                      (* lmm "29-Mar-85 20:25")
    (RESETVARS ((DFNFLG LDFLG)
		(BUILDMAPFLG BUILDMAPFLG)
		(FILEPKGFLG FILEPKGFLG)
		(ADDSPELLFLG ADDSPELLFLG))
	       (RETURN (RESETLST (PROG ((LISPXHIST LISPXHIST)
					(PRLST (AND FILEPKGFLG (FILEPKGCHANGES)))
					FILEMAP FNADRLST ADR ROOTNAME TEM FILECREATEDLST LOADA STREAM)
				       (DECLARE (SPECVARS FILECREATEDLST))
				   TOP (COND
					 ((FMEMB LDFLG LOADOPTIONS))
					 ((AND DWIMFLG (SETQ TEM (FIXSPELL LDFLG NIL LOADOPTIONS T)))
					   (SETQ LDFLG TEM)
					   (SETQ DFNFLG TEM))
					 (T (SETQ LDFLG (ERROR "unrecognized load option" LDFLG))
					    (GO TOP)))
				       [RESETSAVE NIL (LIST (QUOTE CLOSEF?)
							    (SETQ STREAM (OPENSTREAM FILE
										     (QUOTE INPUT)
										     (QUOTE OLD)
										     NIL 
										   LOADPARAMETERS]
				       (OR (EQ (GETFILEPTR STREAM)
					       0)
					   (SETFILEPTR STREAM 0))
				       (RESETSAVE (INPUT STREAM))
				       (SETQ FILE (INPUT))
				       (COND
					 (PRETTYHEADER (LISPXTERPRI T)
						       (LISPXPRINT FILE T)))
				       (COND
					 ((EQ LDFLG (QUOTE SYSLOAD))
					   (SETQ DFNFLG T)
					   (SETQ ADDSPELLFLG NIL)
					   (SETQ BUILDMAPFLG NIL)
					   (SETQ FILEPKGFLG NIL)
					   (SETQ LISPXHIST NIL)))
				       [AND LISPXHIST (COND
					      ((SETQ LOADA (FMEMB (QUOTE SIDE)
								  LISPXHIST))
						(FRPLACA (CADR LOADA)
							 -1))
					      (T (LISPXPUT (QUOTE SIDE)
							   (LIST -1)
							   NIL LISPXHIST]
                                                             (* So that UNDOSAVE will keep saving regardless of how 
							     many undosaves are involved)
				       [COND
					 ((AND BUILDMAPFLG (RANDACCESSP STREAM)
					       (OR (NLISTP (SETQ TEM (GETFILEMAP FILE)))
						   (CAR TEM)))
                                                             (* no map, or incomplete map on file)
					   (SETQ FILEMAP (TCONC NIL NIL]
				   LP  [COND
					 (FILEMAP (SETQ LOADA (RATOM STREAM FILERDTBL)))
					 (T (SETQ LOADA (READ STREAM FILERDTBL]
				       [SELECTQ LOADA
						((STOP NIL)
						  (COND
						    ((EQ LDFLG (QUOTE SYSLOAD))
						      (AND (NOT (MEMB (SETQ ROOTNAME
									(ROOTFILENAME FILE
										      (CDR 
										   FILECREATEDLST)))
								      SYSFILES))
							   (SETQ SYSFILES (NCONC1 SYSFILES ROOTNAME)))
						      (SMASHFILECOMS ROOTNAME))
						    (FILEPKGFLG (ADDFILE FILE T PRLST FILECREATEDLST)

          (* Do not want any items that are added to FILEPKGCHANGES as a result of being mentioned in this file to remain on 
	  FILEPKGCHANGES. Also, we want items mentioned earlier to be deleted if they are taken care of by this file.
	  The extra argument to ADDFILE allows it to restore FILEPKGCHANGES to the intersection of its current value and its 
	  previous value.)


								))
						  [COND
						    (FILEMAP (PUTFILEMAP FILE (CAR FILEMAP)
									 FILECREATEDLST)
							     (COND
							       (UPDATEMAPFLG (SETFILEPTR STREAM ADR)
                                                             (* address of last expression read.
							     good hint for finding filemap)
									     (UPDATEFILEMAP
									       FILE
									       (CAR FILEMAP]
						  [COND
						    ((NOT (MEMB FILE LOADEDFILELST))
						      (/SETTOPVAL (QUOTE LOADEDFILELST)
								  (CONS FILE LOADEDFILELST]
						  (RETURN FILE))
						(COND
						  ((AND (LITATOM LOADA)
							(EQ (NCHARS LOADA)
							    1)
							(OR (SYNTAXP (CHCON1 LOADA)
								     (QUOTE LEFTPAREN)
								     FILERDTBL)
							    (SYNTAXP (CHCON1 LOADA)
								     (QUOTE LEFTBRACKET)
								     FILERDTBL)))
						    (SETQ ADR (SUB1 (GETFILEPTR STREAM)))
						    (COND
						      ((EQ (RATOM STREAM FILERDTBL)
							   (QUOTE DEFINEQ))
							[COND
							  (FILEMAP (SETQ FNADRLST (TCONC NIL ADR))
								   (TCONC FNADRLST NIL)
								   (TCONC FILEMAP (CAR FNADRLST]
							(GO DEFQLP)))
						    (SETFILEPTR STREAM ADR)
						    (SETQ LOADA (EVAL (READ STREAM FILERDTBL)))
						    (GO LP1))
						  ((LISTP LOADA)
                                                             (* e.g. if filemap is nil, then we wold have just read 
							     the expresson)
						    (SETQ LOADA (EVAL LOADA))
						    (GO LP1]
                                                             (* Atom found. compiled code defintion.)
				       (COND
					 (ADDSPELLFLG (ADDSPELL LOADA)))
				       (AND FILEMAP (SETQ ADR (GETFILEPTR STREAM)))
				       (LAPRD LOADA)

          (* The system readtable is not reset for entire load so that if user does a setbrk or setsepr as result of load, he 
	  wont clobber it. instead we reset the readtable before calling laprd and then restoreit. we are protected against 
	  control-d or eror by resetsave on setreadtable at top of function. thus we dont have to do a resetform each time we 
	  go in and out of laprd.)


				       [AND FILEMAP (TCONC FILEMAP (CONS ADR (CONS (GETFILEPTR STREAM)
										   LOADA]
				   LP1 (COND
					 (PRINTFLG (PRINT LOADA T T)))
				       (GO LP)
				   DEFQLP
				       (SELECTQ (RATOM STREAM FILERDTBL)
						((%) %])     (* Closes DEFINEQ.)
						  (AND FNADRLST (RPLACA (CDAR FNADRLST)
									(GETFILEPTR)))
                                                             (* FNADRLST is a ONC format list, hence want to RPLACA 
							     CDAR, not just CDR.)
						  (SETQ LOADA (DEFINE (DREVERSE LOADA)))
						  (GO LP1))
						((%( %[)     (* function/definition pair)
						  [SETFILEPTR STREAM (SETQ ADR (SUB1 (GETFILEPTR]

          (* BAcks up over %( or %[. Done this way instead of PEEKC because RATOM will also skip over any separators between 
	  last %) and next %(, such as c.r.)


						  (SETQ LOADA (CONS (READ STREAM FILERDTBL)
								    LOADA))
						  [AND FNADRLST (TCONC FNADRLST
								       (CONS (CAAR LOADA)
									     (CONS ADR (GETFILEPTR]
						  (GO DEFQLP))
						NIL)
				       (ERROR "illegal argument in defineq"])

(ROOTFILENAME
  [LAMBDA (NAME COMPFLG)                                     (* rmk: "20-FEB-83 21:35")

          (* Returns the root of the filename NAME, the atom that all file package properties will be associated with.
	  If NAME names a compiled file, then COMPFLG~=NIL and we assume that the extension is COMPILE.EXT, which is to be 
	  stripped off. We thus have something of an anomaly: We can keep track of 2 symbolic files whose names differ only 
	  in extension, but we confuse them when we deal with their compiled versions.)


    (NAMEFIELD NAME (NOT COMPFLG])

(MEMB
  [LAMBDA (X Y)
    (PROG NIL
      LP  (RETURN (COND
		    ((NLISTP Y)
		      NIL)
		    ((EQ X (CAR Y))
		      Y)
		    (T (SETQ Y (CDR Y))
		       (GO LP])

(CLOSEF?
  [LAMBDA (FL)                                               (* wt: 18-MAR-77 12 20)
                                                             (* useful for resetsaves, in case somebody else might 
							     close the file.)
    (AND FL (OPENP FL)
	 (CLOSEF FL])
)
[MAPC (QUOTE ((PUTD . /PUTD)
	      (PUTPROP . /PUTPROP)
	      (PUTPROP . PUT)
	      (PUT . /PUT)
	      (PRIN1 . LISPXPRIN1)
	      (PRIN2 . LISPXPRIN2)
	      (PRINT . LISPXPRINT)
	      (TERPRI . LISPXTERPRI)
	      (SPACES . LISPXSPACES)
	      (GETPROP . GETP)
	      (SET . SAVESET)
	      (NILL . MISSPELLED?)
	      (SETTOPVAL . /SETTOPVAL)))
      (FUNCTION (LAMBDA (X)
			(OR (CCODEP (CDR X))
			    (MOVD (CAR X)
				  (CDR X)
				  NIL T]
[MAPC [QUOTE ([STRPOS (LAMBDA (X Y START SKIP ANCHOR TAIL)
			      [COND [(LITATOM X)
				     (SETQ X (CDR (VAG (IPLUS (LOC X)
							      2]
				    ((NULL (STRINGP X))
				     (SETQ X (MKSTRING X]
			      [COND ((STRINGP Y))
				    [(LITATOM Y)
				     (SETQ Y (CDR (VAG (IPLUS (LOC Y)
							      2]
				    (T (SETQ Y (MKSTRING Y]
			      [COND (SKIP (SETQ SKIP (NTHCHAR SKIP 1]
			      (COND [START (COND ((MINUSP START)
						  (SETQ START (IPLUS START (NCHARS Y)
								     1]
				    (T (SETQ START 1)))
			      (SETQ Y (SUBSTRING Y START))
			      (PROG ((N START)
				     W X1 Y1)
				    L2
				    (SETQ X1 (SUBSTRING X 1))
				    (SETQ Y1 (SUBSTRING Y 1))
				    LP
				    (COND [(SETQ W (GNC X1))
					   (COND ((EQ W (GNC Y1))
						  (GO LP))
						 ((EQ W SKIP)
						  (GO LP))
						 (T (GO NX]
					  (TAIL (RETURN (IPLUS (NCHARS X)
							       N)))
					  (T (RETURN N)))
				    NX
				    (COND (ANCHOR (RETURN)))
				    (COND ((GNC Y)
					   (SETQ N (ADD1 N))
					   (GO L2))
					  (T (RETURN]
	      (PACKFILENAME [LAMBDA (X)
				    X])
	      (UNPACKFILENAME [LAMBDA (X)
				      X])
	      (RESETRESTORE (LAMBDA (RESETVARSLST0 RESETSTATE)
				    (PROG (RESETZ)
					  LP
					  (COND ((AND RESETVARSLST (NEQ RESETVARSLST RESETVARSLST0))
						 (SETQ RESETZ (CAR RESETVARSLST))
						 (SETQ RESETVARSLST (CDR RESETVARSLST))
						 [COND ((LISTP (CAR RESETZ))
							(APPLY (CAAR RESETZ)
							       (CDR (CAR RESETZ]
						 (GO LP]
      (FUNCTION (LAMBDA (X)
			(OR (GETD (CAR X))
			    (PUTD (CAR X)
				  (CADR X]

(RPAQ? EOLCHARCODE (CHCON1 (QUOTE %
)))

(RPAQ? PRETTYHEADER )

(RPAQ? DWIMFLG )

(RPAQ? UPDATEMAPFLG )

(RPAQ? DFNFLG )

(RPAQ? ADDSPELLFLG )

(RPAQ? BUILDMAPFLG )

(RPAQ? FILEPKGFLG )

(RPAQ? SYSFILES )

(RPAQ? NOTCOMPILEDFILES )

(RPAQ? RESETVARSLST )

(RPAQ? LOADPARAMETERS (QUOTE ((SEQUENTIAL T))))

(ADDTOVAR LOADEDFILELST )

(RPAQ FILERDTBL (OR (READTABLEP (EVALV (QUOTE FILERDTBL)))
		    (COPYREADTABLE (QUOTE ORIG))))

(RPAQQ LISPXHIST NIL)

(RPAQQ LISPXPRINTFLG T)

(RPAQ PRETTYHEADER "FILE CREATED ")

(RPAQQ BELLS "")

(RPAQQ LOADOPTIONS (SYSLOAD NIL T PROP ALLPROP))
(DECLARE: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS FILEPKGFLG PRETTYHEADER DWIMFLG PRETTYHEADER UPDATEMAPFLG LOADOPTIONS LOADPARAMETERS 
	    FILERDTBL DFNFLG ADDSPELLFLG BUILDMAPFLG FILEPKGFLG SYSFILES)
)
(DECLARE: DONTEVAL@LOAD DOCOPY 
(PRINTLEVEL 1000)
(RADIX 10)
(SETSEPR (QUOTE (20 124))
	 1 FILERDTBL)
)
(DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS 

(ADDTOVAR NLAMA DECLARE: FILECREATED PUTPROPS SELECTQ)

(ADDTOVAR NLAML RPAQ? RPAQ RPAQQ)

(ADDTOVAR LAMA )
)
(PUTPROPS BOOTSTRAP COPYRIGHT ("Xerox Corporation" 1983 1984 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (3708 21005 (GETPROP 3718 . 4119) (SETATOMVAL 4121 . 4376) (RPAQQ 4378 . 4423) (RPAQ 
4425 . 4628) (RPAQ? 4630 . 4885) (MOVD 4887 . 5294) (MOVD? 5296 . 5774) (SELECTQ 5776 . 5928) (
SELECTQ1 5930 . 6195) (NCONC1 6197 . 6381) (PUTPROP 6383 . 7596) (PUTPROPS 7598 . 7850) (PROPNAMES 
7852 . 8006) (ADDPROP 8008 . 9518) (REMPROP 9520 . 9952) (NAMEFIELD 9954 . 10748) (FILECREATED 10750
 . 11707) (FILECREATED1 11709 . 12346) (DECLARE: 12348 . 12462) (DECLARE:1 12464 . 13035) (LOAD 13037
 . 19920) (ROOTFILENAME 19922 . 20524) (MEMB 20526 . 20697) (CLOSEF? 20699 . 21003)))))
STOP