perm filename UPDATE.RNO[IL,LSP]1 blob sn#080411 filedate 1974-01-07 generic text, type T, neo UTF8
.IM 9
.LC.CS.SS.F.J
.STUPDATE11
.BP.NPB1.PP
1 . 5 .↑40
4. CONTROL-↑E: ↑THIS DOES AN
↑←↑-(ERR NIL)↑←↑-,
WHICH RETURN ↑-NIL↑-
TO THE LAST ↑←↑-ERRSET↑←↑-. (↑SEE SECTION ON CHANGES TO ↑←↑-ERR↑←↑-
AND ↑←↑-ERRSET↑←↑-).
.SP2
5. CONTROL-↑Z: ↑THIS RETURNS THE USER TO THE ↑←TOP-LEVEL↑← OF
↑-LISP↑-,
.NCS
(I.E. EITHER THE ↑-READ-EVAL-PRINT↑- LOOP OR THE CURRENT
↑←↑-INITFN↑←↑-).
.SP2
.CS
6. ↑CONTROL-↑R: ↑THIS RESTORES THE NORMAL SYSTEM
↑-OBLIST↑-. ANOTHER OF THE ABOVE CONTROL CHARACTERS MUST BE TYPED
AFTER THIS CHARACTER IS TYPED.
THIS WILL OFTEN RECOVER AFTER A ↑-GARBAGED OBLIST↑- MESSAGE.

.ENDUPDATE11
.STUPDATE0
.START OF CHAPTER 4



.STUPDAT1
.LC.CS.F.J


.BP
.UM 8

.NPB1.PP
4 .↑40


.C
↑-EXTENSIONS TO THE STANDARD INPUT/OUTPUT FUNCTIONS↑-
.SP3
.NF.UL
↑←↑PROJECT-↑PROGRAMMER ↑NUMBERS FOR ↑DISK ↑I/↑O↑←
.F.J
.SP2
↑IN ↑←ALL↑← ↑I/↑O FUNCTIONS (INCLUDING ↑-↑←INPUT↑←↑- AND ↑-↑←OUTPUT↑←↑-),
THE USE OF A TWO ELEMENT LIST (↑←NOT A DOTTED PAIR↑←) IN PLACE OF
A DEVICE WILL CAUSE THE FUNCTION TO ASSUME ↑-DSK:↑- AND USE THE
LIST AS THE PROJECT-PROGRAMMER NUMBER.
.NF.SP3.UL
↑SAVING ↑FUNCTION ↑DEFINITIONS, ETC.↑40ON ↑DISK ↑FILES
.SP2
.NF.UL.UC
(DSKOUT "FILE" "EXPRSLIST")
.F.J.SP
.IM 8
↑-↑←DSKOUT↑←↑- IS AN ↑-FEXPR↑- AND IS USED TO CREATE AN ENTIRE OUTPUT FILE ON DISK
FILE ↑-DSK: "FILE".↑- ↑IT SETS THE LINELENGTH TO ↑-LPTLENGTH↑-,
AND EVALUATES ALL OF THE EXPRESSIONS IN "↑-EXPRSLIST↑-".
↑IF AN EXPRESSION ON "↑-EXPRSLIST↑-" IS ATOMIC, THEN THAT ATOM
IS GIVEN TO ↑-↑←GRINL↑←↑- INSTEAD OF BEING EVALUATED DIRECTLY.
IF THE VALUE OF ↑-FILBAK↑- IS NON-↑-NIL↑- AND THE FILE
ALREADY EXISTS, ↑←↑-DSKOUT↑←↑- WILL ATTEMPT TO RENAME
THE FILE WITH AN EXTENSION OF THE VALUE OF ↑-FILBAK↑-.
AN ERROR MESSAGE WILL BE PRINTED ON THE ↑-TTY:↑-
IF THE FILE CANNOT BE BACKED UP.
↑-FILBAK↑- IS INITIALLY SET TO ↑-LBK↑-.
.UM 8
.SP
↑←↑EXAMPLE:↑←
.SP
.IM 8
↑IF ↑-FNLIST↑- IS A LIST OF YOUR FUNCTIONS, THEY
CAN BE SAVED ON A DISK FILE, ↑-FUNCS.LSP↑- BY:
.SP
↑-(DSKOUT (FUNCS.LSP) FNLIST (PRINT (QUOTE END-OF-FILE)))↑-
.SP
AND THE FILE ↑-FUNCS.LSP↑- WILL BE RENAMED TO ↑-FUNCS.LBK↑- IF IT
ALREADY EXISTS.
.UM 8
.BP
.B
.NPB1.PP
4 . 1 .↑40
.NF
↑←↑READING ↑FILES ↑BACK ↑IN↑←
.SP2.NF
↑-↑←(DSKIN "LIST OF FILE-NAMES")↑←↑-
.SP.F.J
.IM 8
↑-READ-EVAL-PRINT↑-S THE CONTENTS OF THE GIVEN FILES. ↑THIS IS THE
FUNCTION TO USE TO READ FILES CREATED BY ↑-↑←DSKOUT↑←↑-.
.UM 8
.SP.NF
↑←↑EXAMPLE:↑←
.SP
.IM 8
(↑-DSKIN (FUNCS.LSP) DTA0: (DATA.LSP))↑-
.SP
↑READS ↑-FUNCS.LSP↑- FROM ↑-DSK↑-: AND ↑-DATA.LSP↑- FROM ↑-DTA0:↑-.
.SP
↑-(DSKIN (667 2) (DSKLOG.LSP))↑-
.SP
↑READS ↑-DSKLOG.LSP↑- FROM THE DISK AREA OF [667,2].
.UM 8
.BP
.LC.CS.F.J
.NPB2.PP
4 . 1 .↑40
.BP.NF.TIT
↑←↑READING ↑DIRECTORIES↑←
.SP.LC.CS.F.J.STIT
↑THE FOLLOWING FUNCTIONS ARE FOR READING  DIRECTORIES. ↑←↑-UFDINP↑←↑- IS
ANALOGOUS TO THE FUNCTION ↑←↑-INPUT↑←↑- IN THAT IT OPENS A FILE ON A SPECIFIED
CHANNEL. THE CHANNEL MUST BE SELECTED VIA ↑←↑-INC↑←↑- IN ORDER
TO BE READ. THE FILE IS OPENED IN BINARY IMAGE MODE AND SHOULD NOT
BE READ BY THE NORMAL ↑-LISP↑- READ FUNCTIONS. ALL FUNCTIONS
ARE ↑-SUBRS↑- AND THUS EVALUATE THEIR ARGUMENTS.
.IM 8
.SP2.UD8.CS.LC.F.J.FUN
↑←↑-(UFDINP CHANNEL PPN)↑←↑-
.F.J.CS.LC.SP.EXPL
↑←↑-UFDINP↑←↑- OPENS THE DIRECTORY OF ↑-PPN↑- ON ↑-CHANNEL↑-. IT
RETURNS THE VALUE OF ↑-CHANNEL↑- AS ITS RESULT.
↑-PPN↑- IS EITHER OF THE FORM
↑-(PROJ PROG)↑- WHERE ↑-PROJ↑- AND ↑-PROG↑- ARE BOTH ↑-INUM↑-S OR ↑-NIL↑-.
IF ↑-PPN↑- IS ↑-NIL↑- THE USER'S DIRECTORY IS ASSUMED.
.SP.NF.UD8.NLC.EXAM
↑←↑EXAMPLE:↑←

*↑-(UFDINP T (QUOTE (2206,1)))↑-

T
.SP2.UD8.CS.LC.F.J.FUN

↑←↑-(RDFILE)↑←↑-
.F.J.CS.LC.SP.EXPL
↑←↑-RDFILE↑←↑- RETURNS THE NEXT FILE IN THE  DIRECTORY THAT IS OPEN
ON THE CURRENT INPUT CHANNEL. IT RETURN A FILE WHICH IS EITHER AN
ATOM OR AN ATOMIC DOTTED PAIR. IT DOES AN ↑←↑-(ERR $EOF$)↑←↑- WHEN IT REACHES
THE END OF FILE.
.SP.NF.UD8.NLC.EXAM
↑←↑EXAMPLE:↑←

*(PROG (X) (INC (UFDINP T NIL) NIL)
	   (SETQ X (ERRSET (RDFILE)))
	   (INC NIL NIL)
	   (COND ((CONSP X)(RETURN (CAR X)))

(INIT . LSP)
.BP
.SP2.UD8.CS.LC.F.J.FUN
↑←↑-(DIR PPN)↑←↑-
.F.J.CS.LC.SP.EXPL
↑←↑-DIR↑←↑- RETURNS A LIST OF FILES FROM THE DIRECTORY OF ↑-PPN↑-.
IF ↑-PPN↑- IS ↑-NIL↑-, THE USER'S DIRECTORY IS ASSUMED.
.SP.NF.UD8.NLC.EXAM
↑←↑EXAMPLE:↑←
(DIR (QUOTE (2206 4)))

((INIT . LSP) (FOO .LSP) MYFILE))
.CS.LC.F.J
.UM 8.BP.NF.TIT
↑←↑FILE ↑MANIPULATION↑←
.SP.LC.CS.F.J.STIT
↑THE FOLLOWING FUNCTIONS ENABLE THE USER TO MANIPULATE
FILES IN THOSE DIRECTORIES TO WHICH HE HAS LEGITIMATE ACCESS.
THE DEFINITION OF ACCESS PRIVILEGES IS SYSTEM
DEPENDENT. THESE FUNCTIONS USE THE ↑-RENAME UUO↑- TO EFFECT THE DESIRED
MANIPULATIONS.
A ↑-FILESPEC↑- IS DEFINED AS FOLLOWS:
.SP2
.NCS.NF
↑-(DEV FILNAM)↑-
.SP2
↑A ↑-DEV↑- IS EITHER AN ATOM WHOSE LAST CHARACTER IS A COLON, ↑I.↑E.
↑-DSK:↑- OR A A LIST OF THE FORM:
.SP1
↑-(PROJ PROG)↑-
.SP1.F.CS
WHERE ↑-PROJ↑- AND ↑-PROG↑- ARE BOTH NUMBERS. ↑-DEV↑- IS OPTIONAL AND IF
OMMITTED THE USER'S DISK AREA IS ASSUMED.
.SP
↑A ↑-FILNAM↑- IS EITHER AN ATOM OR AN ATOMIC DOTTED PAIR.
.IM 8
.SP.NF.UD8.NLC.EXAM
↑←↑EXAMPLE:↑←

↑-MYFILE↑-
↑-(FILE . EXT)↑-
.SP2.UD8.CS.LC.F.J.FUN
↑←↑-(*RENAME FILESPEC1 FILESPEC2)↑←↑-
.F.J.CS.LC.SP.EXPL
↑←↑-*RENAME↑←↑- IS A ↑-SUBR↑- THAT RENAMES ↑-FILESPEC1↑- TO ↑-FILESPEC2↑-.
IT RETURNS ↑-T↑- IF
THE RENAME IS SUCCESSFUL AND ↑-NIL↑- IF IT FAILS.
IF A DEVICE IS SPECIFIED IN ↑-FILESPEC1↑- AND NO DEVICE IS SPECIFIED
IN ↑-FILESPEC2↑- THE DEVICE SPECIFIED IN ↑-FILESPEC1↑- IS CARRIED OVER TO
↑-FILESPEC2↑-.
↑THUS:
.SP.NF.NLC.EXAM
↑-(*RENAME (QUOTE ((2206 4)(FOO . LSP)))
	 (QUOTE ((FOO . BAK))))↑-

.LC
IS EQUIVALENT TO:
.NLC
(*RENAME (QUOTE ((2206 4)(FOO . LSP)))
	 (QUOTE ((2206 4)(FOO . BAK))))
.F.J.CS.LC.SP.EXPL
↑IF NO DEVICE IS SPECIFIED IN EITHER ↑-FILESPEC↑-, THE USER'S DISK AREA
IS ASSUMED.
.BP
.SP2.UD8.CS.LC.F.J.FUN
↑←↑-(RENAME DEV1 FILNAM1 DEV2 FILNAM2)↑←↑-
.F.J.CS.LC.SP.EXPL
↑←↑-RENAME↑←↑- IS AN ↑-FSUBR↑- THAT RENAMES ↑-FILNAM1↑- TO
↑-FILNAM2↑-. THE ↑-DEV↑-'S ARE OPTIONAL. IF ↑-DEV2↑- IS NOT SPECIFIED, ↑-DEV1↑-
IS ASSUMED. IF BOTH ↑-DEV↑-'S ARE NOT SPECIFIED, THE DEFAULT IS THE
USER'S DISK AREA.
↑←↑-RENAME↑←↑- RETURNS ↑-T↑- IF THE RENAMING IS SUCCESSFUL AND ↑-NIL↑- IF IT
FAILS
.SP.NF.UD8.NLC.EXAM
↑←↑EXAMPLES:↑←

*(RENAME DSK: (FOO . LSP)(FOO . BAK))

T
*(RENAME FOO FIE)

T
*(RENAME (2206 4)(FOO . LSP)(2206 3)(FOO . LSP))

T
.SP2.UD8.CS.LC.F.J.FUN
↑←↑-(DELETE DEV1 FILNAM1 DEV2 FILNAM2 ...)↑←↑-
.F.J.CS.LC.SP.EXPL
↑←↑-DELETE↑←↑- IS AN ↑-FSUBR↑- THAT DELETES THE FILES IN THE LIST.
THE ↑-DEV↑-'S ARE OPTIONAL, AND A ↑-DEV↑- IS EFFECTIVE OVER THE FOLLOWING
↑-FILNAM↑-'S UNTIL A NEW ↑-DEV↑- IS ENCOUNTERED.
↑←↑-DELETE↑←↑- ALWAYS RETURNS ↑-NIL↑-.
THE USER'S DISK AREA IS ASSUMED IF NO ↑-DEV↑- HAS BEEN SPECIFIED.
.SP.NF.UD8.NLC.EXAM
↑←↑EXAMPLES:↑←

*(DELETE FOO (FOO1 . LSP) (2206 4) (OLDFIL . COM))

NIL
.BP.FILBAK
.SP2.UD8.CS.LC.F.J.FUN

↑←↑-(FILBAK FILE NEWEXT)↑←↑-
.F.J.CS.LC.SP.EXPL
↑←↑-FILBAK↑←↑- IS A ↑-SUBR↑- THAT ATTEMPTS TO RENAME ↑-FILE↑- WITH THE EXTENSION OF ↑-NEWEXT↑-.
↑-FILE↑- CAN BE EITHER A ↑-FILNAM↑- OR A ↑-FILSPEC↑-.
↑←↑-FILBAK↑←↑- RETURNS ↑-T↑- IF THE RENAMING WAS SUCCESSFUL
AND ↑-NIL↑- IF IT FAILS.
.SP.NF.UD8.NLC.EXAM
↑←↑EXAMPLES:↑←

↑-(FILBAK (QUOTE FOO)(QUOTE BAK))↑-

.LC
WILL RENAME THE FILE ↑-FOO↑- TO ↑-FOO.BAK↑-.
.NLC

↑-(FILBAK (QUOTE (FOO . LSP))(QUOTE BAK))↑-

.LC
WILL RENAME THE FILE ↑-FOO.LSP↑- TO ↑-FOO.BAK↑-
.NLC

(FILBAK (QUOTE ((2206 4) (FOO . LSP)))
	(QUOTE BAK))

.LC
WILL RENAME THE FILE ↑-FOO.LSP↑-[2206,4] TO ↑-FOO.BAK↑-[2206,4].
.NLC
.SP2.UD8.CS.LC.F.J.FUN
↑←↑-(MYPPN)↑←↑-
.F.J.CS.LC.SP.EXPL
↑←↑-MYPPN↑←↑- RETURNS THE USER'S PROJECT PROGRAMMER NUMBER IN A FORM
SUITABLE FOR USE BY THE DIRECTORY AND ↑I/↑O FUNCTIONS.
.SP.NF.UD8.NLC.EXAM
↑←↑EXAMPLE:↑←

*↑-(MYPPN)↑-

(2206 4)
.SP2.UD8.CS.LC.F.J.FUN
↑←↑-(LOOKUP DEV FILNAM)↑←↑-
.F.J.CS.LC.SP.EXPL

↑←↑-LOOKUP↑←↑- IS A ↑-SUBR↑-
THAT DETERMINES WHETHER THE FILE ↑-DEV FILNAM↑- EXISTS OR NOT.
↑←↑-LOOKUP↑←↑- RETURNS ↑-NIL↑- IF IT CAN'T FIND THE FILE AND
↑-(LIST DEV FILNAM↑-) IF THE FILE DOES EXIST. IF ↑-DEV↑- IS ↑-NIL↑-,
↑-DSK:↑- IS ASSUMED AND ↑-(LIST FILNAM)↑- IS RETURNED.
.UM 8.BP.NF.TIT
↑←↑QUEUEING ↑FILES↑←
.IM 8
.SP1.UD8.CS.LC.F.J.FUN
↑←↑-(QUEUE QNAM: DEV: FILNAM SWITCHES DEV: FILNAM SWITCHES ....)↑←↑-
.F.J.CS.LC.SP.EXPL
↑←↑-QUEUE↑←↑- IS AN ↑-FSUBR↑- THAT QUEUES FILES TO THE SPECIFIED DEVICE OR
QUEUE. IT IS ESSENTIALLY THE SAME AS THE MONITOR COMMAND
↑-QUEUE↑-, BOTH IN SYNTAX AND EFFECT. THE MAIN USE OF THIS FUNCTION
IS TO GET OUTPUT TO LINE PRINTER, PAPER TAPE PUNCHES, ETC. HOWEVER,
THE INPUT QUEUE CAN ALSO BE SPECIFIED IN ORDER TO BATCH A JOB.
.SP
A QUEUE NAME ↑-QNAM:↑- IS AN ATOM OF THREE TO SIX LETTERS WHOSE LAST LETTER
IS A COLON. THE FIRST THREE LETTERS INDICATE THE GENERAL QUEUE (SEE BELOW)
AND THE FOLLOWING LETTERS INDICATE THE SPECIFIC QUEUE.
.SP2.NF..NLC.NAJ
LPT	=LINE PRINTER QUEUE
PTP	=PAPER TAPE PUNCH QUEUE
PLT	=PLOTTER QUEUE
CDP	=CARD PUNCH QUEUE
INP	=JOB BATCH QUEUE
.F.J.CS.LC.SP.EXPL
↑THUS ↑-(QUEUE LPT: ...)↑- WOULD QUEUE TO THE LINE PRINTER WITHOUT
SPECIFYING A SPECIFIC LINE PRINTER QUEUE. ↑-(QUEUE LPT0: ...)↑-
WOULD QUEUE TO LINE PRINTER 0.
AS IN THE MONITOR COMMAND, IF THE QUEUE NAME
↑-QNAM:↑- IS NOT SPECIFIED, THE DEFAULT IS TO ↑-LPT:↑-.
.SP2
↑IF AN ↑-INPUT↑- QUEUE IS SPECIFIED, A MAXIMUM OF TWO FILES IS
PERMITTED. THE SECOND FILE IS TAKEN AS THE NAME OF THE LOG
FILE. IF IT IS NOT SPECIFIED, THE FILENAME OF THE FIRST FILE WITH
AN EXTENSION OF ↑-.LOG↑- IS ASSUMED.
.BP
SWITCHES CONSIST OF TWO ELEMENT LISTS, THE FIRST ELEMENT BEING
THE SWITCH AND THE SECOND THE VALUE.
IN THE CASE OF A REQUIRED NON-NUMERIC VALUE (AS IN ↑-DISP↑-)
ONLY THE FIRST THREE LETTERS OF THE ARGUMENT ARE LOOKED AT
I↑56E↑56 ↑-PRESERVE↑- AND ↑-PRE↑- ARE EQUIVALENT.
.CLEAR TABS
.SET TABS 1,8,21,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59
.NLC.NF.NAJ
.SP
↑←SWITCH↑←	↑←ARGUMENT↑←	↑←EXPLANATION↑←	↑←QUEUES ALLOWED↑←
.SP2
COPIES	NUMERIC	NUMBER OF COPIES	LPT,PTP,CDP,PLT
		TO BE OUTPUT
FORM	NON-NUMERIC	FORMS FOR DEVICE	LPT,PTP,CDP,PLT
LIMIT	NUMERIC	OUTPUT LIMIT	LPT,PTP,CDP,PLT
DISP	'PRE'	PRESERVE FILE	ALL
	'REN'	RENAME FILE OUT OF
		DIRECTORY AND DELETE
		AFTER SPOOLING	ALL
	'DEL'	DELETE AFTER SPOOLING	ALL
CPU	NUMERIC	MAXIMUM CPU SECS FOR JOB INP ONLY
.CLEAR TABS
.SET TABS 1,9,17,25,33,41,49,57,65,73,81,89,97,105
.F.J.CS.LC.SP.EXPL
↑DEFAULTS ARE SYSTEM DEFINED EXCEPT FOR ↑-DISP↑- WHICH DEFAULTS TO
↑-PRE↑- SO THAT ALL FILES ARE PRESERVED.
.SP
↑AS IN THE MONITOR COMMAND, SWITCHES ARE IN EFFECT UNTIL SUPERSEDED
BY ANOTHER INSTANCE OF THE SWITCH. SWITCHES MAY PRECEDE THE FIRST FILE
OR DEVICE.
.SP2
↑-DEV↑-'S ARE EITHER AN ATOM WHOSE LAST CHARACTER IS A COLON
OR A PPN SPECIFICATION.
A DEVICE AFFECTS ONLY THE FILES FOLLOWING IT. IT IS SUPERSEDED BY
ANOTHER DEVICE. IF NO DEVICE IS SPECIFIED, ↑-DSK:↑- IS ASSUMED.
.SP.F.AJ.UD8.EXAM
.BP.QUEUE EXAMPLES
↑←↑EXAMPLES:↑←
.SP 1
↑-*(QUEUE LPT: DSK: FOO (FOO .  LSP))↑-
.SP 1
↑PRINTS THE FILES ↑-FOO↑- AND ↑-FOO.LSP↑- ON THE LINE PRINTER.
.SP 1
↑-*(QUEUE LPT: (FOO . LSP)(COPIES 2))↑-
.SP 1
↑PRINTS TWO COPIES OF ↑-FOO.LSP↑- ON THE LINE PRINTER.
.SP 1
↑-*(QUEUE INP: (FOO . CTL))↑-
.SP 1
↑QUEUES A JOB USING ↑-FOO.CTL↑- AS ITS COMMAND FILE, LEAVING A ↑-LOG↑-
FILE IN ↑-FOO.LOG↑-.
.SP 1
↑-*(QUEUE INP: (FOO . CTL)(FOO . LOG))↑-
.SP 1
↑SAME AS ABOVE.
.SP 1
.LC.CS.F.J.STIT
.BP
.UM 8
↑←↑RECOVERY ↑FROM ↑-QMANGR↑- ↑ERRORS↑←
.SP 1
↑THE ↑←↑-QUEUE↑←↑- FUNCTION MUST SWAP THE ↑-LISP↑- HIGH SEGMENT FOR
THE ↑-QMANGR↑- HIGH SEGMENT.
IT THEN TRANSFERS CONTROL TO THE ↑-QMANGR↑- HIGH SEGMENT. IN MOST CASES,
IF ↑-QMANGR↑- FINDS AN ERROR, IT SIMPLY PRINTS AN ERROR MESSAGE. IN
A FEW CASES, HOWEVER, IT RETURNS CONTROL TO THE MONITOR.
THE ↑-REE↑- COMMAND WILL RESTORE THE APPROPRIATE HIGH SEGMENT AND
PROCESSING WILL CONTINUE. NOTE THAT IN THIS INSTANCE, THE SYSTEM DOES
NOT WAIT FOR CONTROL CHARACTERS.
.SP 1
↑A ↑-.START↑- COMMAND TO THE MONITOR WILL ALSO RESTORE THE USER'S
HIGH SEGMENT. HOWEVER, THIS IS NOT RECOMMENDED AS THE 
REALLOCATION PROCEDURE WILL BE ENTERED.
.BP
.ENDUPDATE0


.IM 8
.STUPDATE2
.LC.CS
.UM 8
.NPB1.PP
4 . 5 .↑40
↑←↑-(READP)↑←↑-
.IM 8
.SP
↑←↑-READP↑←↑- RETURNS ↑-T↑- IF A CHARACTER CAN BE INPUT
AND ↑-NIL↑- OTHERWISE.
↑←↑-READP↑←↑- DOES ↑←NOT↑← INPUT A CHARACTER.
.UM 8
.SP
↑←↑-(UNTYI)↑←↑-
.IM 8
.SP
↑←↑-UNTYI↑←↑- "UNREADS" A CHARACTER (SUCH AS A CHARACTER
INPUT BY A ↑←↑-TYI↑←↑- OR A ↑←↑-READCH↑←↑-), SO THAT THE
NEXT CALL TO ↑-READ↑-, ↑-TYI↑-, ETC., WILL PICK UP
THE ↑-UNTYI↑-'ED CHARACTER AS THE NEXT CHARACTER TO BE 
READ, AND RETURNS THE
↑-ASCII↑- CODE FOR THAT CHARACTER. ↑←↑NOTE↑←: ↑IN THE ↑-LISP↑- ↑-READ↑- ROUTINE, AN ATOM
MAY BE TERMINATED EITHER BY A ↑←BREAK CHARACTER↑←
(A CHARACTER WHICH MUST BE INTERPRETED BY ↑-READ↑- AS WELL 
AS SERVING TO TERMINATE THE ATOM, SUCH AS "(", ")", "[", AND ".")
OR A ↑←SEPARATOR↑← CHARACTER (A CHARACTER USED ONLY TO 
SEPARATE ATOMS, ETC., BUT NOT IN ITSELF MEANINGFUL, SUCH
AS CARRIAGE RETURN OR BLANK).  IN ORDER TO SAVE A BREAK CHARACTER
FOR LATER INTERPRETATION, THE ↑-LISP READ↑- ROUTINES USE
A ↑←ONE-CHARAACTER↑← BUFFER.  ↑-UNTYI↑- SIMPLY  
STORES ITS ARGUMENT IN THIS BUFFER; THUS ↑←THERE
ARE TWO PROBLEMS IN USING ↑-UNTYI↑-↑←.
FIRST, IF ↑-UNTYI↑- IS USED SEVERAL TIMES IN SUCCESSION
WITH NO INTERVENING ↑-READ↑-'S, ↑-TYI↑-'S, ETC.,THEN ONLY THE
MOST RECENT CHARACTER IS ACTUALLY "UNREAD"--ALL OTHERS
ARE LOST.  SECOND, IF THERE IS A BREAK CHARACTER IN THE ONE-CHARACTER
BUFFER WHEN AN ↑-UNTYI↑- IS PERFORMED, THE BREAK CHARACTER
WILL BE LOST.

.UM 8
.SP.NF
↑EXAMPLE:
.SP
.IM 8
.F.AJ
↑THE FOLLOWING EXAMPLE ILLUSTRATES HOW THE NEXT CHARACTER 
MAY BE EXAMINED WITHOUT AFFECTING THE READ ROUTINES:
.NF
.AJ
↑-*(DE PEEKC () (UNTYI (TYI)))
.SP
*(PROG () (CLRBFI) (PEEKC) (RETURN (TYI))
.SP
*A↑-
.SP
101
.SP
.UM 8
↑←↑-(ERRCH↑40N)↑←↑-
.F.J.SP.IM 8
↑←↑-ERRCH↑←↑- CHANGES THE BELL CHARACTER THAT CAUSES AN ↑-(ERR
(QUOTE ERRORX))↑-. ↑N IS THE ↑-ASCII↑- REPRESENTATION OF
THE CHARACTER. ↑←↑-ERRCH↑←↑- RETURNS THE ↑-ASCII↑- REPRESENTATION
OF THE OLD CHARACTER. NOTE THAT IF THE NEW CHARACTER IS NOT A BREAK
CHARACTER TO THE MONITOR, IT WILL NOT BE PROCESSED UNTIL IT IS READ
IN THE NORMAL COURSE OF READING.
.ENDUPDATE2
.STUPDATE3
.UM 8.LC.F.J.BP.NPB9.PP
4 .↑40
.NF
.TIT
↑←↑READING WITHOUT ↑INTERNING↑←
.F.J.SP1
.IM 8.UD8.NF
↑←↑-(RDNAM)↑←↑-
.SP.F.J.CS.LC
↑←↑-RDNAM↑←↑- FUNCTIONS IN THE SAME MANNER AS ↑-READ↑- EXCEPT THAT
IT DOES NOT INTERN THE ATOMS THAT IT READS.
THUS AN ATOM READ BY ↑←↑-RDNAM↑←↑- AND AN ATOM READ BY ↑←↑-READ↑←↑-
ARE ↑←↑-**NOT**↑←↑- ↑-↑←EQ↑←↑-.
.UD8.SP.NF
↑←↑EXAMPLE:↑←

↑-*(PROG () (CLRBFI) (RETURN (EQ (RDNAM) (READ))))
*FOO
*FOO

NIL↑-






.ENDUPDATE3
.END OF CHAPTER 4
.STUPDATE8
.UM 8
.BP
.LC.SS
.NPB1.PP
6 .↑40










.LC.NF
.C
↑-NEW PREDICATES↑-
.SP3
↑←↑DATA ↑TYPE ↑PREDICATES↑←
.SP2
↑←↑-(CONSP X)↑-↑←

.IM 8
↑THE VALUE OF ↑←↑-CONSP↑-↑← IS ↑X IFF ↑X IS NOT AN ATOM.
↑←↑-CONSP↑-↑← IS EQUIVALENT TO:

	  ↑-(LAMBDA (X) (COND ((NOT (ATOM X)) X)))↑-
.UM 8

↑←↑EXAMPLES:↑←	↑-(CONSP T)	= NIL
		(CONSP 1.23)	= NIL
		(CONSP (QUOTE (X Y Z)))	= (X Y Z)
		(CONSP (CDR (QUOTE (X))))	= NIL↑-
.SP2
↑←↑-(STRINGP X)↑-↑←
.SP.F.J
.IM 8
↑THE VALUE OF ↑←↑-STRINGP↑-↑← IS ↑T IFF ↑X IS A STRING.

.SP2
.NF
.UD8
↑←↑-(PATOM X)↑-↑←
.SP.F.J
↑THE VALUE OF ↑-↑←PATOM↑←↑- IS ↑T IFF ↑X IS AN ATOM ↑←OR↑← ↑X IS A
POINTER OUTSIDE OF FREE STORAGE.
.NF.SP2
.UD8
↑←↑-(LITATOM X)↑-↑←
.SP.F.J
↑THE VALUE OF ↑-↑←LITATOM↑←↑- IS ↑T IFF ↑X IS A LITERAL ATOM, I.E↑56,
AN ATOM BUT ↑←NOT↑← A NUMBER.
.ENDUPDATE8
.STUPDATE10
.BP.NF
.NPB3.PP
6 .↑40
.UM 8
↑←↑PREDICATES THAT ↑RETURN ↑USEFUL ↑NON-↑-NIL↑- ↑VALUES↑←
.SP2
↑←↑-(MEMBER X Y)↑-↑←
.SP1.AJ.F
.IM 8
↑←↑-MEMBER↑-↑← IS THE SAME AS THE OLD ↑←↑-MEMBER↑-↑← EXCEPT THAT IT RETURNS
THE TAIL OF ↑Y STARTING AT THE POSITION WHERE ↑X IS FOUND.
.UM 8
.SP1
.NF
↑←↑EXAMPLES:↑←
.SP
	↑-(MEMBER (QUOTE (C D)) (QUOTE ((A B)(C D)E)))
					= ((C D) E)
	(MEMBER (QUOTE C) (QUOTE C)))	= NIL↑-
.SP2
↑←↑-(MEMB X Y)↑-↑←
↑←↑-(MEMQ X Y)↑-↑←
.SP1
.IM 8
.AJ.F
↑←↑-MEMQ↑-↑← IS THE SAME AS THE OLD ↑←↑-MEMQ↑-↑← EXCEPT THAT IT RETURNS THE 
TAIL OF ↑Y STARTING AT THE POSITION WHERE ↑X IS FOUND.
.UM 8
.NF.SP1
↑←↑EXAMPLES:↑←
.SP
	↑-(MEMQ (QUOTE (C D)) (QUOTE ((A B)(C D)E)))	= NIL
	(MEMB (QUOTE A) (QUOTE (Q A B)))			= (A B)↑-
.SP2
↑-↑←(TAILP X Y)↑←↑-
.F.J.SP
.IM 8
↑THE VALUE OF ↑←↑-TAILP↑-↑← IS ↑X IFF ↑X IS A LIST AND A TAIL
OF ↑Y, I.E↑56, ↑X IS ↑←↑-EQ↑-↑← TO SOME NUMBER OF ↑←↑-CDR↑-↑←S & 0 OF
↑Y.
.NF.SP2
.UM 8
↑←↑-(AND X1 X2 ... X↑-N)↑←	= ↑XN IF ↑←ALL↑← ↑XI ARE NON-↑-NIL↑-
			= ↑N↑I↑L OTHERWISE
.SP2
↑←↑-(OR X1 X2 ... X↑-N)↑←	= ↑THE FIRST NON-↑N↑I↑L ARGUMENT
			= ↑N↑I↑L IF ↑←ALL↑← ↑XI ARE ↑N↑I↑L
.SP2.F.J
.IM 8
↑AS WITH THE OLD ↑←↑-AND↑←↑- AND ↑←↑-OR↑←↑- THESE FUNCTIONS ONLY
EVALUATE AS MANY OF THEIR ARGUMENTS AS NECESSARY
TO DETERMINE THE ANSWER (E.G. ↑←↑-AND↑←↑- STOPS EVALUATION AFTER
THE FIRST ↑-NIL↑- ARGUMENT).
.UM 8

.ENDUPDATE10
.STUPDATE6
.BP
.LC.SS
.NPB1.PP
7 .↑40
.C
↑-NEW NUMERIC FUNCTIONS↑-
.SP3
↑←↑MINIMUM AND ↑MAXIMUM↑←
.SP2
↑←↑-(*MIN X Y)↑-↑←		= ↑MINIMUM OF ↑X AND ↑Y
.SP1
↑←↑-(MIN X1 X2 ... X↑-N)↑←	= ↑MINIMUM OF ↑X1, ↑X2, ... , ↑XN
.SP1
↑←↑-(*MAX X Y)↑-↑←		= ↑MAXIMUM OF ↑X AND ↑Y
.SP1
↑←↑-(MAX X1 X2 ... X↑-N)↑←	= ↑MAXIMUM OF ↑X1, ↑X2, ... , ↑XN
.SP.NF
↑←↑-(INUMP X)↑←↑-
.SP.F.IM 8
↑←↑-INUMP↑←↑- RETURNS ↑X IFF ↑X IS AN ↑-INUM↑-. IT RETURNS ↑-NIL↑-
OTHERWISE.
.NF.UD8.SP
↑←↑-(NUMTYPE X)↑←↑-
.F.J.SP
↑←↑-NUMTYPE↑←↑- RETURNS ↑-FIXNUM↑- IF THE NUMBER ↑X IS A
FIXED POINT NUMBER
AND ↑-FLONUM↑- IF IT IS A FLOATING POINT NUMBER.

.ENDUPDATE6
.STUPDATE5

.BP
.UM 8
.NF
.NP3.PP
8 .↑40
↑←↑MISCELLANEOUS ↑USEFUL ↑FUNCTIONS↑←
.SP2.NF.UL
↑-(UNBOUND)↑-
.IM 8
.SP.F.J
↑-↑←UNBOUND↑←↑- RETURNS THE
UN-INTERNED ATOM ↑-UNBOUND↑- WHICH THE SYSTEM
PLACES IN THE ↑←↑-CDR↑-↑← OF AN ATOM'S
↑-SPECIAL↑- (↑-VALUE↑-) CELL TO INDICATE THAT THE ATOM CURRENTLY
HAS NO ASSIGNED VALUE EVEN THOUGH IT HAS A ↑-SPECIAL↑- (↑-VALUE↑-)
CELL ON ITS PROPERTY LIST.
.SP2.NF.UL
.UD8
↑-(SYSCLR)↑-
.SP.F.J
↑RE-INITIALIZES ↑-LISP↑- TO READ THE USER'S
↑-INIT.LSP↑- FILE
WHEN IT RETURNS TO THE TOP LEVEL, E↑56G↑56 BY A ↑CONTROL-↑G
OR A ↑-START↑-, OR A ↑-REENTER↑-.
↑←↑-SYSCLR↑←↑- ALSO RESETS THE GARBAGE COLLECTION TIME
INDICATOR TO 0 AND THE ↑-CONS↑-ES PERFORMED INDICATOR TO 0.
IT ALSO PERFORMS AN ↑-EXCISE↑-.
.UM 8.SP.NF
↑←↑-(INITFL "FILELST")↑←↑-
.IM 8.SP.F.J
↑←↑-INITFL↑←↑- IS AN ↑-FSUBR↑- THAT SETS UP THE FILE LIST FOR THE USER'S
↑-INIT↑- FILE. ↑-FILELST↑- MAY CONSIST OF MORE THAN ONE FILE.
HOWEVER, IF THERE IS MORE THAN ONE FILE IN THE LIST, THE FILES FOLLOWING
THE FIRST ONE MUST BE FOUND OR AN ERROR WILL BE GENERATED. THE FIRST
FILE IN THE LIST IS OPTIONAL. THE ↑-INIT↑- FILE IS INITIALLY ↑-INIT.LSP↑-.
↑←↑-INITFL↑←↑- RETURNS THE OLD FILE LIST AS ITS RESULT.
.SP.UD8.NF
↑←↑EXAMPLE:↑←
.SP
↑-*(INITFL (INIT1 . LSP) (MYFILE . LSP) FOO)↑-

↑-((INIT . LSP))↑-
.BP.NPB1.PP
8 . 3 .↑40
.UM 8
.F.J.SP2
↑←↑-******WARNING******↑←↑-:
.SP1
↑THE FOLLOWING TWO FUNCTIONS
CAN CATASTROPHICALLY DESTROY THE GARBAGE COLLECTOR BY
CREATING A CIRCLE IN THE FREE LIST IF THEY ARE USED TO RETURN
TO THE FREE LIST ANY WORDS WHICH ARE STILL IN USE.  ↑DO NOT
USE THESE FUNCTIONS UNLESS YOU ARE CERTAIN WHAT YOU ARE DOING.
(↑THEY ARE ONLY USEFUL IN RARE CASES WHERE A SMALL AMOUNT OF
WORKING STORAGE IS NEEDED BY A ROUTINE WHICH IS
CALLED QUITE OFTEN.)
.SP2.NF.UL
↑-(FREE X)↑-
.IM 8
.SP.F.J
↑-↑←FREE↑←↑- RETURNS THE ↑←WORD↑← ↑X TO THE FREE STORAGE
LIST AND RETURNS ↑-NIL↑-.
.SP2.NF.UL
.UD8
↑-(FREELIST X)↑-
.SP.F.J
↑-↑←FREELIST↑←↑- RETURNS ALL OF THE WORDS ON THE TOP LEVEL OF THE
LIST ↑X TO THE FREE STORAGE LIST AND RETURNS ↑-NIL↑-. ↑-↑←FREELIST↑←↑-
TERMINATES ON A ↑-↑←NULL↑←↑- CHECK.

.BP.NF.UM 8
↑←↑NEW ↑SYMBOL ↑TABLE ↑FUNCTIONS↑←
.F.CS.J.LC
.SP
↑THE FUNCTIONS IN THIS SECTION ARE SIMILAR TO THE CURRENTLY EXISTING
SYMBOL TABLE FUNCTIONS EXCEPT THAT THEY EITHER STRIP OFF (FOR STORING)
OR ADD ON THE ATOM RELOCATION. THIS ALLOWS ↑-MACRO↑- CODE TO USE THE ATOM RELOCATION REGISTER
↑S TO REFER TO FREE STORAGE AND THUS ALLOW EXPANSION OF BINARY PROGRAM
SPACE WITHOUT DESTROYING ↑-LOAD↑-ED CODE. THEY
OPERATE IN EXACTLY THE SAME MANNER AS THEIR OLDER
COUNTERPARTS. AN ERROR IS GENERATED IF THE ARGUMENTS OR RETURNING VALUE
IS NOT A TRUE CONS CELL.
.IM 8.SP.NF
.UD8
↑←↑-(*RPUTSYM SYM VAL)↑←↑-
.SP.F.J.CS.LC
↑←↑-*RPUTSYM↑←↑- PUTS (↑-VAL↑- - ATOM RELOCATION) IN THE SYMBOL TABLE
UNDER ↑-SYM↑-.
.SP.NF.UD8
↑←↑-(RPUTSYM X1 X2 ...)↑←↑-
.SP.F.J
↑←↑-RPUTSYM↑←↑- FUNCTIONS IN THE SAME MANNER AS ↑←↑-PUTSYM↑←↑-, I↑56E↑56
IF ↑XN IS AN ATOM, THEN ↑XN IS PLACED IN THE SYMBOL TABLE WITH
↑XN LESS THE RELOCATION AS ITS VALUE.
OTHERWISE ↑-(EVAL (CADR XN))↑- IS PLACED IN THE SYMBOL TABLE AS THE
VALUE OF ↑-(CAR XN)↑-.
.SP.NF.UD8
↑←↑-(*GETSYM X)↑←↑-
.SP.F.J
↑←↑-*GETSYM↑←↑- GETS THE VALUE OF THE SYMBOL ↑X, ADDS ON THE
RELOCATION AND RETURNS THE CELL POINTED TO AS ITS VALUE.
.SP.NF.UD8
↑←↑-(GETSYM P S1 S2 ...)↑←↑-
.SP.F.J
↑←↑-GETSYM↑←↑- SEARCHES THE SYMBOL TABLE FOR THE SYMBOL ↑SN AND PLACES
THE RELOCATED VALUE ON THE PROPERTY LIST OF ↑SN UNDER PROPERTY ↑P.
.ENDUPDATE.STUPDATE4
.BP.F.J.UM 8
.LC.CS.F.J.NPB1.PP
11 .↑40
.C
↑-CONTIGUOUS BLOCKS OF STORAGE↑-
.SP2

.F.J.CS.STIT
↑A NEW DATA TYPE, ↑-BLOCK↑-, HAS BEEN ADDED TO ↑-UCILSP↑-. A ↑-BLOCK↑-
CONSIST OF A BLOCK OF CONTIGUOUS STORAGE LOCATIONS IN ↑BINARY
↑PROGRAM ↑SPACE. ↑-BLOCK↑-S ARE SIMILAR TO ARRAYS IN THAT THEY MAY
CONTAIN POINTERS THAT ARE PROTECTED FROM GARBAGE COLLECTION, OR
THEIR CONTENTS MAY BE IGNORED BY THE GARBAGE COLLECTOR. THEY
DIFFER, HOWEVER, IN THE MEANS OF ACCESS. ↑-BLOCK↑-S ARE ACCESSED
BY A POINTER INTO ↑BINARY ↑PROGRAM ↑SPACE AND ALL OF THE FUNCTIONS
WHICH WILL ACT ON A CONS CELL WILL WORK EQUALLY WELL ON AN ELEMENT OF
A BLOCK (EXCEPT FOR PRINTING).
↑-BLOCK↑-S CAN BE USED FOR SETTING UP LISTS THAT ARE ALSO TABLES,
AS IN SETTING UP MULTIPLE ↑-OBLIST↑-S. ↑-NOTE BENE↑-: THE
VALUE RETURNED BY THE ↑-BLOCK↑- FUNCTIONS IS A TRUE ADDRESS, NOT
A ↑-LISP↑- NUMBER.
.SP2.CS.LC.F.J.FUN
.IM 8.UD 8
↑←↑-(GTBLK LENGTH GC)↑←↑-
.F.J.CS.LC.SP.EXPL
↑←↑-GTBLK↑←↑- IS A  ↑-SUBR↑- THAT RETURNS A ZEROED ↑-BLOCK↑- OF ↑-LENGTH↑- WORDS. IF
↑-GC↑- IS ↑-NIL↑-, THEN THE CONTENTS OF THE ↑-BLOCK↑- ARE IGNORED BY
THE GARBAGE COLLECTOR. IF ↑-GC↑- IS NON-↑-NIL↑- THEN THE CONTENTS ARE
TREATED AS POINTERS AND THE CELLS POINTED TO WILL NOT
BE COLLECTED.
.SP2.LM9.UD8.CS.LC.F.J.FUN
↑←↑-(BLKLST LIST LENGTH)↑←↑-
.F.J.CS.LC.SP..EXPL
↑←↑-BLKLST↑←↑- IS A ↑-SUBR↑- THAT RETURNS A POINTER TYPE ↑-BLOCK↑-
OF ↑-LENGTH↑- WORDS. IT CHAINS THE WORDS IN THE ↑-BLOCK↑- SUCH
THAT THE ↑-CDR↑- OF EACH WORD IS THE SUCCEEDING WORD.
THE TOP LEVEL OF ↑-LIST↑- IS THEN MAPPED INTO THE ↑-CAR↑-'S OF THE BLOCK.
IF ↑-LENGTH↑- IS ↑-NIL↑-, THEN THE LENGTH OF THE LIST IS USED.
IF ↑-(LENGTH LIST)↑- IS LESS THAN ↑-LENGTH↑-, THEN THE ↑-CAR↑-'S OF THE
REMAINDEF OF THE ↑-BLOCK↑- ARE SET TO ↑-NIL↑-. IF
↑-(LENGTH LIST)↑- IS GREATER THAN ↑-LENGTH↑-, THE LIST IS TRUNCATED.


.ENDUPDATE4