perm filename LOADUP[FOO,LMM] blob sn#094031 filedate 1974-03-25 generic text, type T, neo UTF8
(FILECREATED "25-MAR-74 19:23:10" S-LOADUP)


  (LISPXPRINT (QUOTE LOADUPVARS)
              T)
  (RPAQQ LOADUPVARS ((FNS LOADUP STARTUP STARTLOAD LOADDEF FILEOF FILESOF LD)
          (VARS S-STRGENFILES)
          (ADVICE FILEVARS FILEFNS)))
(DEFINEQ

(LOADUP
  [LAMBDA (TYPE)
    (MINFS 5000 8)
    (MINFS 5000 1)
    (STARTUP TYPE)
    [ADVISE (QUOTE (IOFILE IN DICTBLOCK))
            (QUOTE BEFORE)
            (QUOTE (RETURN (INPUT (INFILE U]
    [ADVISE (QUOTE START)
            (QUOTE BEFORE)
            (QUOTE (OR (LISTP (CAR (QUOTE CATALOG.DICTIONARY)))
                       (MAKTAB NIL NIL (QUOTE CATALOG.DICTIONARY)
                               (QUOTE <MASINTER>CATALOG.INDEX]
    (PROGN [SETQQ RESETVARSLST (((SETQ CONSOLETIME0 (CLOCK 0)))
                   ((SETQ CPUTIME0 (CLOCK 2)))
                   ((SETQ GREETCLK (CLOCK 3)))
                   ((OR (EQ (MKATOM (USERNAME))
                            USERNAME)
                        (GREET]
           (PROG1 (SYSOUT (QUOTE STRGEN.SYS))
                  (SETQ RESETVARSLST])

(STARTUP
  [LAMBDA (TYPE)                                (* Used to create the system)
    (PROG ((NOTSOURCEFLG (NOT (MEMB (QUOTE SOURCES)
                                    TYPE)))
           (NOTCOMFLG (MEMB (QUOTE NOCOMS)
                            TYPE)))
          (MAPC
            (OR (CDR (ASSOC (QUOTE FILES)
                            TYPE))
                S-STRGENFILES)
            (FUNCTION (LAMBDA (FILE COMFILE GOTCOM)
                (SETQ COMFILE (PACK (LIST FILE ".COM")))
                [SETQ GOTCOM
                  (OR
                    (MEMB COMFILE FILELST)
                    (AND
                      (NOT NOTCOMFLG)
                      (INFILEP COMFILE)
                      (PROG ((OLD LINKEDFNS))
                            [RESETVAR NOLINKMESS T
                              (RESETVAR LINKEDFNS NIL
                                (PROG1 (STARTLOAD COMFILE)
                                       (SETQ OLD (NCONC
                                                    OLD (PROG1 LINKEDFNS
                                                               (RELINK 
                                                                  LINKEDFNS]
                            (SETQ LINKEDFNS OLD]
                [OR NOTSOURCEFLG (STARTLOAD FILE (AND GOTCOM (QUOTE PROP]
                (/PUT FILE (QUOTE FILE)
                      (LIST NIL (PACK (LIST (MKATOM (SUBSTRING FILE 3))
                                            "VARS"])

(STARTLOAD
  [LAMBDA (FILE LOADFLG EVENIFLOADED)
    (COND
      ((AND (NOT EVENIFLOADED)
            (MEMB FILE FILELST))
        (LISPXPRINT (CONS FILE (QUOTE (already loaded)))
                    T))
      (T (LOAD FILE LOADFLG)))
    [OR (GETP FILE (QUOTE FILE))
        (/PUT FILE (QUOTE FILE)
              (LIST NIL
                    (PACK (LIST (SUBSTRING FILE
                                           (OR (STRPOS "S-" FILE NIL NIL T T)
                                               1))
                                "VARS"]
    FILE])

(LOADDEF
  [LAMBDA (FN ONLYTHISONEFLG)

          (* Loads the definitions of all of the functions in the file 
          which contains FN -
          However, if ONLYTHISONEFLG is on, just loads the definition 
          of this one function)


    (PROG [(FILE (NAMEFIELD (OR [FILEOF (OR FN (SETQ FN (PROGN (LISPXPRIN1
                                                                 "=" T)
                                                               (LISPXPRINT
                                                                 LASTWORD T]
                                (ERROR FN "not found on any file"]
          (PROG1 [COND
                   (ONLYTHISONEFLG (LOADFNS (LIST FN)
                                            FILE
                                            (QUOTE PROP)))
                   (T (STARTLOAD FILE (QUOTE PROP]
                 (RPLACA (QUOTE LASTWORD)
                         FN])

(FILEOF
  [LAMBDA (FN)
    (CAR (SOME FILELST (FUNCTION (LAMBDA (FILE)
                   (OR (MEMB FN (CAR (FILEFNS FILE)))
                       (NEWFILE2 FN (CAR (FILEVARS FILE))
                                 (QUOTE FNS])

(FILESOF
  [LAMBDA (FN)
    (SUBSET FILELST (FUNCTION (LAMBDA (FILE)
                (OR (MEMB FN (CAR (FILEFNS FILE)))
                    (NEWFILE2 FN (CAR (FILEVARS FILE))
                              (QUOTE FNS])

(LD
  [LAMBDA (X)
    (LOADDEF X T])
)
  (RPAQQ S-STRGENFILES
         (S-LOADUP S-TOTAL S-FORS S-GENLISP S-CL S-CYCLIC S-CYCLIC2 S-DICT 
                   S-CATALOG S-DRAW S-EXAMPLE S-EXPAND S-EXPLAIN S-GROUP 
                   S-LABELER S-STRUCTURE S-TOPLEVEL S-TREE))
(DEFLIST(QUOTE(
  [FILEVARS (NIL (BEFORE NIL (COND ([CADR (SETQ !VALUE (GETP FILE (QUOTE FILE]
                                    (RETURN (CADR !VALUE]
  [FILEFNS (NIL (BEFORE NIL (COND ([CAR (SETQ !VALUE (GETP FILE (QUOTE FILE]
                                   (RETURN (CAR !VALUE]
))(QUOTE READVICE))

STOP