(FILECREATED " 3-Sep-86 11:56:27" {ERIS}<LISPCORE>SOURCES>BOOTSTRAP.;18 37063  

      changes to:  (FNS LOAD)

      previous date: "27-Aug-86 19:54:45" {ERIS}<LISPCORE>SOURCES>BOOTSTRAP.;17)


(* Copyright (c) 1983, 1984, 1985, 1986 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 BOOTSTRAP-NAMEFIELD FILECREATED FILECREATED1 DECLARE: 
             DECLARE:1 LOAD ROOTFILENAME MEMB CLOSEF?)
        (INITVARS (EOLCHARCODE (CHCON1 (QUOTE %
)))
               (PRETTYHEADER)
               (DWIMFLG)
               (UPDATEMAPFLG)
               (DFNFLG)
               (ADDSPELLFLG)
               (BUILDMAPFLG)
               (FILEPKGFLG)
               (SYSFILES)
               (NOTCOMPILEDFILES)
               (RESETVARSLST)
               (LOADPARAMETERS (QUOTE ((SEQUENTIAL T))))
               (LISPXHIST)
               (LISPXPRINTFLG T)
               (PRETTYHEADER "FILE CREATED ")
               (BELLS (QUOTE ""))
               (LOADOPTIONS (QUOTE (SYSLOAD NIL T PROP ALLPROP))))
        (ADDVARS (LOADEDFILELST))
        (GLOBALVARS PRETTYHEADER DWIMFLG PRETTYHEADER UPDATEMAPFLG LOADOPTIONS LOADPARAMETERS 
               FILERDTBL SYSFILES)
        (DECLARE: DONTEVAL@LOAD DOCOPY
               (P (MAPC (QUOTE ((PUTD . /PUTD)
                                (PUTPROP . /PUTPROP)
                                (PUTPROP . PUT)
                                (PUTPROP . SAVEPUT)
                                (PUT . /PUT)
                                (PRIN1 . LISPXPRIN1)
                                (PRIN2 . LISPXPRIN2)
                                (PRINT . LISPXPRINT)
                                (TERPRI . LISPXTERPRI)
                                (SPACES . LISPXSPACES)
                                (GETPROP . GETP)
                                (SET . SAVESET)
                                (NILL . MISSPELLED?)
                                (SETTOPVAL . /SETTOPVAL)
                                (BOOTSTRAP-NAMEFIELD . NAMEFIELD)))
                        (FUNCTION (LAMBDA (X)
                                         (OR (CCODEP (CDR X))
                                             (MOVD (CAR X)
                                                   (CDR X)
                                                   NIL T)))))
                  (AND (CCODEP (QUOTE BOOTSTRAP-NAMEFIELD))
                       (PUTD (QUOTE BOOTSTRAP-NAMEFIELD)))
                  (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)))))))
               (P (PRINTLEVEL 1000)
                  (RADIX 10)))
        (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                                                 (* Pavel "27-Aug-86 19:54")
          
          (* * BOOTSTRAPPING VERSION OF PUTPROPS (\, FOR) WHEN SAVEPUT ISN
          (QUOTE T) DEFINED YET.)
          
          (* * ADDS PROPERTIES TO THE FIRST ARGUMENT
          (\, IN) THE FORM (ATOM KEY1 VAL1 KEY2 VAL2 ...))

    (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])

(BOOTSTRAP-NAMEFIELD
  [LAMBDA (FILE SUFFIXFLG)                                   (* bvm: " 2-Aug-86 14:50")
                                                             (* BOOTSTRAP VERSION --
                                                             this is replaced by real version from 
                                                             MACHINEINDEPENDENT)
    (PROG ((START 1)
           POS 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 (NTHCHARCODE FILE END)
                      (CHARCODE "."))                        (* eliminates null suffix)
                  (SETQ END (SUB1 END]
          [COND
             ((SETQ POS (STRPOS (QUOTE %.)
                               FILE START))
              (COND
                 ((NULL SUFFIXFLG)
                  (SETQ END (SUB1 POS]
          (RETURN (SUBATOM 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))                        (* hdj " 3-Sep-86 11:39")
    (RESETLST (PROG ((*PACKAGE* *INTERLISP-PACKAGE*)
                     (*READ-BASE* 10)
                     (DFNFLG DFNFLG)
                     (BUILDMAPFLG BUILDMAPFLG)
                     (FILEPKGFLG FILEPKGFLG)
                     (ADDSPELLFLG ADDSPELLFLG)
                     (LISPXHIST LISPXHIST)
                     (PRLST (AND FILEPKGFLG (FILEPKGCHANGES)))
                     FILEMAP FNADRLST ADR ROOTNAME TEM FILECREATEDLST LOADA STREAM)
                    (DECLARE (SPECVARS *PACKAGE* *READ-BASE* DFNFLG BUILDMAPFLG FILEPKGFLG 
                                    ADDSPELLFLG LISPXHIST FILECREATEDLST))
                TOP (if (FMEMB LDFLG LOADOPTIONS)
                        then (SETQ DFNFLG LDFLG)
                      elseif (AND DWIMFLG (SETQ TEM (FIXSPELL LDFLG NIL LOADOPTIONS T)))
                        then (SETQ LDFLG TEM)
                             (SETQ DFNFLG LDFLG)
                      else (SETQ LDFLG (ERROR "unrecognized load option" LDFLG))
                           (GO TOP))
                    (RESETSAVE NIL (LIST (QUOTE CLOSEF?)
                                         (SETQ STREAM (OPENSTREAM FILE (QUOTE INPUT)
                                                             (QUOTE OLD)
                                                             NIL LOADPARAMETERS))))
                    (if (NEQ (GETFILEPTR STREAM)
                             0)
                        then                                 (* "this can come out when MSPF")
                             (SETFILEPTR STREAM 0))
                    (RESETSAVE (INPUT STREAM))
                    (SETQ FILE (FULLNAME STREAM))
                    (if PRETTYHEADER
                        then (LISPXTERPRI T)
                             (LISPXPRINT FILE T))
                    (if (EQ LDFLG (QUOTE SYSLOAD))
                        then (SETQ DFNFLG T)
                             (SETQ ADDSPELLFLG NIL)
                             (SETQ BUILDMAPFLG NIL)
                             (SETQ FILEPKGFLG NIL)
                             (SETQ LISPXHIST NIL))
                    (AND LISPXHIST (if (SETQ LOADA (FMEMB (QUOTE SIDE)
                                                          LISPXHIST))
                                       then (FRPLACA (CADR LOADA)
                                                   -1)
                                     else (LISPXPUT (QUOTE SIDE)
                                                 (LIST -1)
                                                 NIL LISPXHIST)))
                                                             (* 
                    "So that UNDOSAVE will keep saving regardless of how many undosaves are involved")
                    (if (AND BUILDMAPFLG (RANDACCESSP STREAM)
                             (OR (NLISTP (SETQ TEM (GETFILEMAP STREAM)))
                                 (CAR TEM)))
                        then                                 (* "no map, or incomplete map on file")
                             (SETQ FILEMAP (TCONC NIL NIL)))
                LP  (if FILEMAP
                        then                                 (* 
                                                             "need to build map, so read carefully")
                             (SETQ LOADA (SKIPSEPRCODES STREAM FILERDTBL))
                             (if (OR (SYNTAXP LOADA (QUOTE LEFTPAREN)
                                            FILERDTBL)
                                     (SYNTAXP LOADA (QUOTE LEFTBRACKET)
                                            FILERDTBL))
                                 then                        (* "See if we have a DEFINEQ")
                                      (SETQ ADR (GETFILEPTR STREAM))
                                      (READCCODE STREAM FILERDTBL) 
                                                             (* "Eat paren")
                                      (if (EQ (RATOM STREAM FILERDTBL)
                                              (QUOTE DEFINEQ))
                                          then (SETQ FNADRLST (TCONC NIL ADR))
                                               (TCONC FNADRLST NIL)
                                               (TCONC FILEMAP (CAR FNADRLST))
                                               (GO DEFQLP))  (* "Not a DEFINEQ, so back out")
                                      (SETFILEPTR STREAM ADR)))
                    (SELECTQ (SETQ LOADA (READ STREAM FILERDTBL))
                        ((STOP NIL) 
                             (if (EQ LDFLG (QUOTE SYSLOAD))
                                 then (AND (NOT (MEMB (SETQ ROOTNAME (ROOTFILENAME FILE (CDR 
                                                                                       FILECREATEDLST
                                                                                             )))
                                                      SYSFILES))
                                           (SETQ SYSFILES (NCONC1 SYSFILES ROOTNAME)))
                                      (SMASHFILECOMS ROOTNAME)
                               elseif FILEPKGFLG
                                 then 
          
          (* * "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.")

                                      (ADDFILE FILE T PRLST FILECREATEDLST))
                             (if FILEMAP
                                 then (PUTFILEMAP FILE (CAR FILEMAP)
                                             FILECREATEDLST)
                                      (if UPDATEMAPFLG
                                          then (SETFILEPTR STREAM ADR) 
                                                             (* 
                                    "address of last expression read.  good hint for finding filemap")
                                               (UPDATEFILEMAP STREAM (CAR FILEMAP))))
                             (if (NOT (MEMB FILE LOADEDFILELST))
                                 then (/SETTOPVAL (QUOTE LOADEDFILELST)
                                             (CONS FILE LOADEDFILELST)))
                             (RETURN FILE))
                        NIL)
                    (if (LISTP LOADA)
                        then (SETQ LOADA (EVAL LOADA))
                      else                                   (* 
                                                             "Atom found.  compiled code defintion.")
                           (if ADDSPELLFLG
                               then (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 (if PRINTFLG
                        then (PRINT LOADA T T))
                    (GO LP)
                DEFQLP
                    (SELCHARQ (SKIPSEPRCODES STREAM FILERDTBL)
                         ((%) %])                            (* "Closes DEFINEQ.")
                              (READCCODE STREAM FILERDTBL)
                              (AND FNADRLST (RPLACA (CDAR FNADRLST)
                                                   (GETFILEPTR STREAM)))
                                                             (* 
                          "FNADRLST is a TCONC format list, hence want to RPLACA CDAR, not just CDR.")
                              (SETQ LOADA (DEFINE (DREVERSE LOADA)))
                              (GO LP1))
                         ((%( %[)                            (* "another function/definition pair")
                              (SETQ ADR (GETFILEPTR STREAM))
                              (SETQ LOADA (CONS (READ STREAM FILERDTBL)
                                                LOADA))
                              (AND FNADRLST (TCONC FNADRLST (CONS (CAAR LOADA)
                                                                  (CONS ADR (GETFILEPTR STREAM)))))
                              (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])
)

(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))))

(RPAQ? LISPXHIST )

(RPAQ? LISPXPRINTFLG T)

(RPAQ? PRETTYHEADER "FILE CREATED ")

(RPAQ? BELLS (QUOTE ""))

(RPAQ? LOADOPTIONS (QUOTE (SYSLOAD NIL T PROP ALLPROP)))

(ADDTOVAR LOADEDFILELST )
(DECLARE: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS PRETTYHEADER DWIMFLG PRETTYHEADER UPDATEMAPFLG LOADOPTIONS LOADPARAMETERS FILERDTBL 
       SYSFILES)
)
(DECLARE: DONTEVAL@LOAD DOCOPY 
(MAPC (QUOTE ((PUTD . /PUTD)
              (PUTPROP . /PUTPROP)
              (PUTPROP . PUT)
              (PUTPROP . SAVEPUT)
              (PUT . /PUT)
              (PRIN1 . LISPXPRIN1)
              (PRIN2 . LISPXPRIN2)
              (PRINT . LISPXPRINT)
              (TERPRI . LISPXTERPRI)
              (SPACES . LISPXSPACES)
              (GETPROP . GETP)
              (SET . SAVESET)
              (NILL . MISSPELLED?)
              (SETTOPVAL . /SETTOPVAL)
              (BOOTSTRAP-NAMEFIELD . NAMEFIELD)))
      (FUNCTION (LAMBDA (X)
                       (OR (CCODEP (CDR X))
                           (MOVD (CAR X)
                                 (CDR X)
                                 NIL T)))))
(AND (CCODEP (QUOTE BOOTSTRAP-NAMEFIELD))
     (PUTD (QUOTE BOOTSTRAP-NAMEFIELD)))
(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))))))

(PRINTLEVEL 1000)
(RADIX 10)
)
(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 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (7614 31919 (GETPROP 7624 . 8213) (SETATOMVAL 8215 . 8510) (RPAQQ 8512 . 8565) (RPAQ 
8567 . 8892) (RPAQ? 8894 . 9285) (MOVD 9287 . 9716) (MOVD? 9718 . 10303) (SELECTQ 10305 . 10505) (
SELECTQ1 10507 . 10849) (NCONC1 10851 . 11198) (PUTPROP 11200 . 12982) (PUTPROPS 12984 . 13556) (
PROPNAMES 13558 . 13752) (ADDPROP 13754 . 15866) (REMPROP 15868 . 16449) (BOOTSTRAP-NAMEFIELD 16451 . 
17794) (FILECREATED 17796 . 19067) (FILECREATED1 19069 . 20347) (DECLARE: 20349 . 20482) (DECLARE:1 
20484 . 21349) (LOAD 21351 . 30641) (ROOTFILENAME 30643 . 31306) (MEMB 31308 . 31567) (CLOSEF? 31569
 . 31917)))))
STOP