NEWIO NEWIO NEWIO NEWIO NEWIO NEWIO NEWIO NEWIO NEWIO NEWIO
----------------------------------------------------------------
THINGS OF NOTE NOT YET IMPLEMENTED:
----------------------------------------------------------------
[1]	FILEPOS NOT YET IMPLEMENTED.
[2]	ALLFILES NOT YET IMPLEMENTED.
[3]	MOBY I/O DOES NOT YET WORK UNDER NEW I/O.

----------------------------------------------------------------
NEW FUNCTIONS:
----------------------------------------------------------------
(^G)	SIGNALS A ^G QUIT; IT REPLACES (IOC G).

(IN <FILE>) READS IN A FIXNUM FROM A BINARY INPUT FILE AND
	RETURNS IT.  TO GET A BINARY FILE, SEE THE NEW
	OPEN FUNCTION.

(OUT <FILE> <FIXNUM>) OUTPUTS THE FIXNUM TO THE BINARY
	FILE AND RETURNS T.

(TRUENAME <FILE>) GIVES THE "TRUE NAME" OF THE FILE,
	AS OPPOSED TO THE FILE NAMES USED TO OPEN IT.
	THIS IS THE NAME FOUND AFTER TRANSLATIONS AND
	LINKS, ETC. (IT IS THE NAME RETURNED BY A .RCHST
	ON THE FILE'S CHANNEL.)

ECHOFILES IS A VARIABLE WHICH, IF NON-NIL, SHOULD BE A
	LIST OF OUTPUT FILES.  THESE OUTPUT FILES
	RECEIVE EVERY CHARACTER SEEN AS INPUT BY TYI
	(AND FUNCTIONS WHICH USE TYI, SUCH AS READ).
	IF A FILE IS A MEMBER OF BOTH THE ECHOFILES
	AND OUTFILES LISTS, IT WILL BE A "DRIBBLE
	FILE", RECORDING BOTH INPUT AND OUTPUT.
	NOTE THAT THE FUNCTION WHICH PRE-SCANS TTY INPUT
	AND PERFORMS RUBOUT PROCESSING LAMBDA-BINDS
	ECHOFILES TO NIL, SO YOU WON'T SEE RUBBED-OUT
	CHARACTERS.

(OPEN <FILE> <MODELIST>) OPENS A FILE AND RETURNS A
	CORRESPONDING FILE OBJECT.  IT IS ACTUALLY AN LSUBR
	OF ZERO TO TWO ARGUMENTS.  THE <FILE> DEFAULTS TO THE
	CURRENT DEFAULT FILE NAMES.  THE <MODELIST> DEFAULTS
	TO NIL.
IF <FILE> IS A NAMELIST OR NAMESTRING, A NEW FILE ARRAY
	IS CREATED.  IF <FILE> IS A FILE ARRAY ALREADY, IT IS
	CLOSED AND RE-OPENED IN THE SPECIFIED MODE; ITS FORMER
	MODES SERVE AS THE DEFAULTS FOR THE <MODELIST>.
	THE <MODELIST> DETERMINES A LARGE NUMBER OF ATTRIBUTES
	FOR OPENING THE FILE.  FOR EACH ATTRIBUTE THERE ARE
	TWO OR MORE MUTUALLY EXCLUSIVE VALUES WHICH MAY BE
	SPECIFIED AS FOLLOWS.  VALUES MARKED BY A * ARE THOSE
	USED AS DEFAULTS WHEN THE <FILE> IS A NAMELIST OR
	NAMESTRING.  IF THE <MODELIST> IS AN ATOM, IT IS THE
	SAME AS SPECIFYING THE LIST OF THAT ONE ATOM.
DIRECTION:
	*  IN		INPUT FILE
	*  READ		SAME AS "IN"
	   OUT		OUTPUT FILE
	   PRINT	SAME AS "OUT"
	   APPEND	OUTPUT, APPENDED TO EXISTING FILE
DATA MODE:
	*  ASCII	FILE IS A STREAM OF ASCII CHARACTERS.
			SYSTEM-DEPENDENT TRANSFORMATIONS MAY
			OCCUR, SUCH AS SUPPLYING LF AFTER CR,
			OR BEING CAREFUL WITH OUTPUT OF ^P,
			OR MULTICS ESCAPE CONVENTIONS.
	   FIXNUM	FILE IS A STREAM OF FIXNUMS.  THIS
			IS FOR DEALING WITH FILES THOUGHT OF
			AS "BINARY" RATHER THAN "CHARACTER".
	   IMAGE	FILE IS A STREAM OF ASCII CHARACTERS.
			ABSOLUTELY NO TRANSFORMATIONS ARE MADE.
DEVICE TYPE:
	*  DSK		STANDARD KIND OF FILE.
	   TTY		CONSOLE.  IN PARTICULAR, ONLY TTY INPUT
			FILES HAVE INTERRUPT CHARACTER FUNCTIONS
			ASSOCIATED WITH THEM.
BUFFERING MODE:
	*  BLOCK	DATA IS BUFFERED.
	   SINGLE	DATA IS UNBUFFERED.
		IF THE DEVICE TYPE IS TTY, THE DEFAULT IS
		SINGLE INSTEAD OF BLOCK ON ITS.
ECHO MODE:
	   ECHO		OPENS OUTPUT TTY IN ECHO AREA (ITS ONLY).
SOME OF THESE VALUES ARE OF COURSE SYSTEM-DEPENDENT.
	YOUR LOCAL LISP SYSTEM WILL ATTEMPT TO DO THE RIGHT
	THING, HOWEVER, IN ANY CASE.
IF THE OPTIONS LIST IS INVALID IN ANY WAY, OPEN MAY EITHER
	GIVE A WRNG-TYPE-ARGS ERROR, OR BLITHELY ASSUME A
	CORRECTED VALUE FOR AN ATTRIBUTE.  IN GENERAL, ERRORS 
	SHOULD OCCUR ONLY FOR TRULY CONFLICTING SPECIFICATIONS.
	ON THE OTHER HAND, SPECIFYING BLOCK MODE FOR A DEVICE
	THAT THE SYSTEM WANTS TO HANDLE ONLY IN CHARACTER MODE
	MAY JUST GO AHEAD AND USE CHARACTER MODE.
(OPENI X)  ==  (OPEN X 'READ)
(OPENO X)  ==  (OPEN X 'PRINT)
(OPENA X)  ==  (OPEN X 'APPEND)

(RUBOUT <CHAR> <FILE>) ATTEMPTS TO RUB OUT ONE CHARACTER.
<CHAR> SHOULD BE A FIXNUM BETWEEN 0 AND 177 (AN ASCII VALUE).
<FILE> SHOULD BE A TTY OUTPUT FILE; IF OMITTED, T IS ASSUMED.
IF IT IS NOT POSSIBLE TO RUB OUT THE CHARACTER CORRECTLY,
RUBOUT WILL RETURN NIL INSTEAD OF T; IT IS UP TO THE CALLER
TO DO SOMETHING ABOUT THIS CASE.  CHARACTERS WHICH CANNOT
CORRECTLY BE RUBBED OUT INCLUDE TAB AND CARRIAGE RETURN.
IF THE OUTPUT TTY CAN DO CURSOR POSITIONING AND SELECTIVE
RASURE, THEN THE CHARACTER IS RUBBED OUT BY ERASING IT
FROM THE SCREEN AND BACKING UP THE CURSOR; OTHERWISE, THE
CHARACTER IS PRINTED ON THE TTY (RUBOUT ECHO).

(SSTATUS TTYSCAN <FUNCTION> <FILE>) SETS UP A TTY PRE-SCAN
FUNCTION FOR <FILE>, WHICH MUST BE A TTY INPUT FILE.
IF <FILE> IS OMITTED, T IS ASSUMED.
THE <FUNCTION> SHOULD ACCEPT THREE ARGUMENTS:
	(1) THE FILE TO DO PRE-SCANNING FOR.
	(2) THE INPUT FUNCTION TO PRE-SCAN FOR.
	    POSSIBILITIES ARE READ, TYI, READLINE,
	    EDIT, AND PERHAPS OTHERS.
	(3) THE NUMBER OF HANGING LEFT PARENTHESES, AS
	    A FIXNUM (MEANINGFUL ONLY IF ARGUMENT 2
	    IS 'READ).
IT IS THE RESPONSIBILITY OF THE PRE-SCAN FUNCTION TO
READ IN SOME CHARACTERS FROM THE FILE HANDED TO IT AS
ITS FIRST ARGUMENT, AND TO RETURN A LIST OF FIXNUMS
BETWEEN 0 AND 177 OCTAL.  TYPICALLY THE PRE-SCAN FUNCTION
WILL PROVIDE FOR RUBOUT PROCESSING, ETC.
IF THE PRE-SCAN FUNCTION RETURNS NIL, AN END-OF-FILE
WILL BE SIGNALED FOR THE TTY INPUT FILE.  THIS IS A WAY
TO SIGNAL OVER-RUBOUT.
(THE INITIAL LISP SYSTEM PROVIDES FOR THE INITIAL TTY INPUT
FILE A PRE-SCAN FUNCTION WHICH DOES STANDARD RUBOUT PROCESSING.)
(STATUS TTYSCAN <FILE>) NATURALLY RETURNS THE PRE-SCAN
FUNCTION FOR <FILE> (T IF <FILE> IS OMITTED).


----------------------------------------------------------------
THINGS WHICH HAVE CHANGED FROM OLD I/O AND NOT IN THE MANUAL:
----------------------------------------------------------------

IN NEW I/O FILES ARE SPECIFIED BY MEANS OF NAMESTRINGS AND
NAMELISTS AS DOCUMENTED IN THE MANUAL.
THERE IS FURTHERMORE A COMPATIBILITY FEATURE WHICH ALLOWS
OLD I/O 4-LISTS TO BE USED INTERCHANGEABLY WITH NEW I/O
NAMELISTS.  IF THE CAR OF A PUTATIVE NAMELIST IS ATOMIC,
THEN IT IS ASSUMED TO BE AN OLD I/O 4-LIST.
FINALLY, NEW I/O ON THE PDP-10 KNOWS MOST STANDARD DEVICE
NAMES; IF IT SEES A NAME WHERE A DEVICE BELONGS, AND IT IS
NOT ONE OF THE STANDARD DEVICE NAMES, AND NO SNAME WAS
SUPPLIED, THEN THE NAME IS TAKEN TO BE THE SNAME, AND *
IS SUPPLIED FOR THE DEVICE.
ALL THESE COMPATIBILITY FEATURES ARE FOR THE PDP-10 ONLY!
EXAMPLES:
	THESE ARE ALL EQUIVALENT AS FILE NAMES:
		(FOO BAR * GLS)
		(FOO BAR GLS)
		((GLS) FOO BAR)
		((* GLS) FOO BAR)
THE ARGUMENT TO AN OLD I/O FUNCTION IS ONE OF THESE LISTS;
THUS ONE MAY SAY EQUIVALENTLY:
		(UREAD FOO > * GLS)
		(UREAD FOO > DSK GLS)	;IF YOUR DEFAULT DEV IS DSK:
		(UREAD FOO)		;IF YOUR DEFAULT IS DSK:GLS;
					; BECAUSE UREAD SUPPLIES >
		(UREAD (GLS) FOO)	;IF YOUR DEFAULT DEV IS DSK:
		(UREAD (DSK GLS) FOO)
		(UREAD (DSK GLS) FOO >)

HERE ARE DEFINITIONS OF THE OLD I/O FUNCTIONS IN TERMS OF THE
NEW ONES.  THEY MAY BE TAKEN QUITE LITERALLY.
(DEFUN UREAD FEXPR (FILENAME)
       (UCLOSE)
       ((LAMBDA (FILE)
		(EOFFN FILE
		       (FUNCTION
			  (LAMBDA (EOFFILE EOFVAL)
				  (SETQ UREAD NIL))))
		(INPUSH (SETQ UREAD FILE))
		(CAR (DEFAULTF FILE)))
	(OPEN (*UGREAT FILENAME) 'IN)))

(DEFUN UCLOSE FEXPR (X)
       (COND (UREAD
	      (AND (EQ UREAD INFILE) (INPUSH -1))
	      (CLOSE (PROG2 NIL UREAD (SETQ UREAD NIL))))
	     (T NIL)))

(DEFUN UWRITE FEXPR (DEVDIR)
       (OR DEVDIR (SETQ DEVDIR (CAR (DEFAULTF NIL))))
       (*UWRITE (CONS DEVDIR (COND ((STATUS FEATURE DEC10)
				    (CONS (STATUS JNAME) '(OUT)))
				   ((STATUS FEATURE ITS)
				    '(.LISP. OUTPUT))))
		'OUT
		(LIST DEVDIR)))

(DEFUN UAPPEND FEXPR (FILENAME)
       (PROG2 (SETQ FILENAME (*UGREAT FILENAME))
	      (*UWRITE FILENAME 'APPEND FILENAME)
	      (RENAME UWRITE
		      (COND ((STATUS FEATURE DEC10)
			     (CONS (STATUS JNAME) '(OUT)))
			    ((STATUS FEATURE ITS)
			     '(/.LISP/. APPEND))))))

(DEFUN *UWRITE (NAME MODE NEWDEFAULT)	;INTERNAL ROUTINE
       (COND (UWRITE
	      (SETQ OUTFILES (DELQ UWRITE OUTFILES))
	      (CLOSE UWRITE)
	      (SETQ UWRITE NIL)))
       ((LAMBDA (FILE)
		(SETQ OUTFILES
		      (CONS (SETQ UWRITE FILE)
			    OUTFILES))
		(CAR (DEFAULTF NEWDEFAULT)))
	(OPEN NAME MODE)))

(DEFUN UFILE FEXPR (SHORTNAME)
       (COND ((NULL UWRITE)
	         (ERROR 'NO/ UWRITE/ FILE
			(CONS 'UFILE SHORTNAME)
			'IO-LOSSAGE))
	     (T (PROG2 NIL
		       (CAR (DEFAULTF (RENAME UWRITE
					      (*UGREAT SHORTNAME))))
		       (SETQ OUTFILES (DELQ UWRITE OUTFILES))
		       (CLOSE UWRITE)
		       (SETQ UWRITE NIL)))))

(DEFUN CRUNIT FEXPR (DEVDIR)
       (CAR (DEFAULTF (AND DEVDIR (LIST DEVDIR)))))

(DEFUN *UGREAT (NAME)			;INTERNAL ROUTINE
       (MERGEF (MERGEF NAME
		       (COND ((STATUS FEATURE DEC10)
			      '(* . LSP))
			     ((STATUS FEATURE ITS)
			      '(* . >))))
	       NIL))

(DEFUN UPROBE FEXPR (FILENAME)
       (SETQ FILENAME (MERGEF (*UGREAT FILENAME) NIL))
       (AND (PROBEF FILENAME) FILENAME))

(DEFUN UKILL FEXPR (FILENAME)
	    (DEFAULTF (DELETEF FILENAME))))



CURSORPOS MAY TAKE AN EXTRA ARGUMENT TO DETERMINE WHICH OUTPUT
TTY TO DO THE CURSOR POSITIONING ON.  IF THE LAST ARGUMENT CAN
BE TAKEN TO BE A TTY, IT IS.
ONE INCOMPATIBILITY IS THAT (CURSORPOS 'T) NOW MEANS GET THE
COORDINATES OF TTY "T" RATHER THAN GO TO THE TOP OF THE SCREEN.
TO GO TO THE TOP OF THE SCREEN FOR THE DEFAULT TTY, USE
(CURSORPOS 'TOP) OR (CURSORPOS 124) OR (CURSORPOS 'T T).

LISTEN SIMILARLY TAKES AN OPTIONAL ARGUMENT TELLING WHICH INPUT
TTY TO LISTEN TO.  NOTE THAT (LISTEN T) IS NOT QUITE THE SAME
AS (LISTEN); THE LATTER MERELY RETURNS THE RESULT OF A .LISTEN,
WHILE THE FORMER ACCOUNTS FOR BUFFERED-UP CHARACTERS WITHIN LISP.

TYIPEEK NOW TAKES UP TO THREE ARGUMENTS.
THE FIRST ARGUMENT IS AS IN OLD I/O; IT SPECIFIES THE KIND
OF PEEKING.  A FIRST ARGUMENT OF NIL IS THE SAME AS NO ARGUMENT
AT ALL, EXCEPT THAT YOU NEED IT TO GET IN THE OTHER TWO
ARGUMENTS.  THESE EXTRA ARGUMENTS ARE AS FOR READ, NAMELY
A FILE AND/OR EOF VALUE (WHICH SHOULD BE A FIXNUM).
AN INCOMPATIBLE CHANGE IS THAT TYIPEEK BY DEFAULT RETURNS
-1 INSTEAD OF 3 AT END OF FILE AND NEWIO.

(STATUS FILEMODE <FILE>) RETURNS A DOTTED PAIR WHOSE CAR
IS A LIST OF VALID OPTIONS TO THE OPEN FUNCTION, DESCRIBING
THE ATTRIBUTES OF THE FILE, AND WHOSE CDR IS A LIST OF
SEMI-SYSTEM-DEPENDENT SYMBOLS DESCRIBING ATTRIBUTES WHICH CANNOT
BE FED TO OPEN.  AMONG THESE ATTRIBUTES ARE:
	RUBOUT		THIS TTY CAN SELECTIVELY ERASE.
	SAIL		THIS TTY HAS THE SAIL CHARACTER SET.
	CURSORPOS	THIS TTY CAN DO CURSOR POSITIONING.

(SSTATUS TTYCONS <TTY1> <TTY2>) EFFECTIVELY BINDS TWO TTY
FILES INTO A SINGLE CONSOLE.  ONE OF THE TTY'S SHOULD BE AN
INPUT TTY, AND THE OTHER AN OUTPUT TTY.  INITIALLY THE
SYSTEM PERFORMS (SSTATUS TTYCONS T T) FOR YOU.
(STATUS TTYCONS <TTY>) RETURNS THE TTY WHICH THE ONE YOU
SPECIFIED IS LINKED TO, OR NIL IF IT ISN'T LINKED.
THIS IS USEFUL, FOR EXAMPLE, IN A **MORE** INTERRUPT,
TO DETERMINE WHICH INPUT TTY TO READ THE CHARACTER FROM.

(STATUS TTYINT <CHAR> <INPUT TTY>)
(SSTATUS TTYINT <CHAR> <FUNCTION> <INPUT TTY>)
THESE STATUS FUNCTION ARE USED TO SET UP AND EXAMINE
INTERRUPT CHARACTER FUNCTIONS FOR TTY INPUT FILES.
IF <FILE> IS OMITTED, T (THE STANDARD TTY) IS ASSUMED.
<CHAR> SHOULD BE EITHER A NUMERIC ASCII VALUE, OR
A SINGLE CHARACTER OBJECT.  NOTE THAT <CHAR> IS ALWAYS
EVALUATED, UNLIKE (STATUS CHTRAN), FOR EXAMPLE.
<FUNCTION> SHOULD BE EITHER A FUNCTION OF TWO ARGUMENTS
OR A FIXNUM.  IF IT IS A FUNCTION, THEN WHEN THE INTERRUPT
OCCURS IT RECEIVES AS ARGUMENTS THE FILE ON WHICH THE
INTERRUPT OCCURRED, AND THE CHARACTER TYPED, AS A FIXNUM.
IF THE FUNCTION IS A FIXNUM, IT REPRESENTS THE INTERNAL
SYSTEMIC INTERRUPT INITIALLY ASSOCIATED WITH THAT CHARACTER.
THUS, FOR EXAMPLE:
	(SSTATUS TTYINT 7
		 '(LAMBDA (F CH) (PRINC '|WHY DID YOU TYPE ^G? |)))
	(SSTATUS TTYINT 6 7)
WILL CAUSE ^F T DO A "^G QUIT", AND ^G MERELY TO PRINT THE
MESSAGE "WHY DID YOU TYPE ^G? ".
NOTE THAT AN INTERRUPT CAN BE ASSOCIATED WITH ANY ASCII
CHARACTER, NOT JUST CONTROL CHARACTERS.  (FOR A FRUSTRATING
EXPERIENCE, SET ")" TO BE A "^G QUIT".)  ON ITS, HOWEVER,
ONE MUST USE (SSTATUS TTY) TO TELL ITS THAT THINGS LIKE
"?" OR "#" ARE TO BE CONSIDERED INTERRUPT CHARACTERS
(THIS IS SIMILAR TO THE ACTIVATION CHARACTER PROBLEM).
THE MEANINGFUL SYSTEMIC INTERRUPT VALUES ARE:
  OCTAL VALUE	CHAR	WHAT IT DOES
	3	^C	(SETQ ^D NIL)
	4	^D	(SETQ ^D T)
	7	^G	^G QUIT
	22	^R	(SETQ ^R T)
	24	^T	(SETQ ^R NIL)
	26	^V	(SETQ ^W NIL)
	27	^W	(SETQ ^W T)
	30	^X	^X QUIT
	32	^Z	RETURN TO DDT
THE DIFFERENCE BETWEEN (SSTATUS TTYINT 1 4) AND
(SSTATUS TTYINT 1 '(LAMBDA (F CH) (SETQ ^D T)))
IS THAT THE FORMER WILL LET THE INTERRUPT HAPPEN AND
TAKE EFFECT EVEN IF IN A PLACE WHERE A GENERAL USER
FUNCTION MAY NOT BE RUN, E.G. IN THE MIDDLE OF A GARBAGE
COLLECTION.
NOTE THAT INITIALLY ^S IS SET TO BE LIKE ^W AS AN
INTERRUPT CHARACTER (SEE BELOW).

^Q IS NO LONGER INITIALLY AN INTERRUPT CHARACTER,
BUT A SPLICING MACRO AND FORCE-FEED WHOSE DEFINITION
IS (LAMBDA NIL (SETQ ^Q T) NIL).  THIS HAS THE SAME
EFFECT WHEN TYPED AT THE KEYBOARD AS BEFORE, BUT
PREVENTS CERTAIN TIMING SCREWS.

^S NO LONGER DOES (SETQ ^Q NIL).  INSTEAD, IT IS THE
SAME AS ^W AS AN INTERRUPT CHARACTER.  UNLIKE ^W,
IT IS ALSO A SPLICING MACRO AND FORCE-FEED, WITH THE
DEFINITION (LAMBDA NIL (SETQ ^W NIL) (TERPRI) NIL).
THUS IF A LONG PRINTOUT IS COMING AT YOU, JUST TYPE
^S AND YOU WILL SEE A TERPRI WHEN CONTROL RETURNS TO
THE KEYBOARD.  THIS IS LIKE ^S IN DDT, AND REPLACES
THE OLD TRICK OF TYPING ^W AND THEN (IOC V).

^Z NO LONGER DOES A :VK TO DDT.

^U NO LONGER RELEASES THE PAGEPAUSE (WHICH IS ALSO GONE).

^B AND ^E DO NOT TOGGLE LPT OUTPUT.
LOSERS CAN PROGRAM THIS FOR THEMSELVES.
SEE ML:GLS;NIFTY QIO.

^H IS ALPHABETIC IN NEW I/O, FOR COMPATIBILITY WITH
MULTICS, AND SO YOU CAN UNDERLINE NAMES.  BEWARE!
A<BACKSPACE>_ IS NOT THE SAME ATOM AS _<BACKSPACE>A.
(THERE WILL EVENTUALLY BE A USER-PROGRAMMABLE
SOLUTION TO THIS "BUG" - A LINE CANONICALIZER.)

^B IN NEW I/O GIVES A "^B BREAK", WHICH IS THE SAME AS
THE "^H BREAK" OF OLD I/O.

FOR TTY OUTPUT FILES ON ITS, THE ENDPAGEFN IS NOT TRIPPED WHEN
THE LINENUM EXCEEDS PAGEL.  RATHER, THE **MORE** INTERRUPT
IS USED, WHICH IS MORE ACCURATE FOR DETECING THE BOTTOM OF
THE SCREEN.  WHEN THE TTY REACHES THE BOTTOM OF THE SCREEN,
THE ENDPAGEFN FOR THE TTY IS INVOKED; IT RECEIVES AS ARGUMENT
THE FILE ON WHICH THE INTERRUPT OCCURRED.

HERE ARE SOME NEAT FUNCTIONS FOR USING THE **MORE** FEATURE
(THEY LIVE IN ML:GLS;NIFTY QIO):

(DECLARE (SPECIAL **MORE** MORE-FLUSH))
(SETQ **MORE** '##MORE##)
(SETQ MORE-FLUSH NIL)

;;; TTY-ENDPAGEFN IS AN ENDPAGEFN FOR THE TTY FOR PROCESSING
;;; **MORE** INTERRUPTS.  WHAT IT DOES DEPENDS ON TWO
;;; GLOBAL VARIABLES (BOUND BY THE CATCHMORE MACRO):
;;;   **MORE**	      MORE-FLUSH      ACTION
;;;	NIL		NIL		NOTHING
;;;	NON-NIL		NIL		"DUMB" MORE PROCESSING;
;;;					I.E. PRINT THE VALUE
;;;					OF **MORE** AND WAIT FOR
;;;					THE LOSER TO TYPE SOMETHING,
;;;					BUT NO PROVISION FOR FLUSHING
;;;	NIL		NON-NIL		FLUSH IMMEDIATELY BY DOING
;;;					(THROW NIL CLEVER-MORE).
;;;					THIS IS GOOD FOR PRINTING
;;;					EXACTLY ENOUGH TO FILL A SCREEN.
;;;	NON-NIL		NON-NIL		"SMART" MORE PROCESSING;
;;;					I.E. PRINC THE VALUE OF
;;;					**MORE** AND WAIT FOR A
;;;					CHARACTER.  IF SPACE OR
;;;					RUBOUT, GOBBLE IT.  IF IT
;;;					WAS SPACE, JUST RETURN;
;;;					OTHERWISE FLUSH BY PRINC'ING
;;;					MORE-FLUSH AND DOING
;;;					(THROW NIL CLEVER-MORE).

(DEFUN TTY-ENDPAGEFN (FILE)
       (COND (**MORE** (PRINC **MORE**)
		       ((LAMBDA (IFILE)
				((LAMBDA (CH)
					 (AND (OR (= CH 40)
						  (= CH 177))
					      (TYI IFILE))
					 (COND ((AND MORE-FLUSH
						     (NOT (= CH 40)))
						(PRINC MORE-FLUSH)
						(THROW NIL CLEVER-MORE))
					       (T (CURSORPOS NIL 0 FILE)
						  (CURSORPOS 'L FILE)
						  (CURSORPOS 'T FILE))))
				 (TYIPEEK NIL IFILE)))
			(OR (STATUS TTYCONS FILE) T)))
	     (MORE-FLUSH (THROW NIL CLEVER-MORE))))

(ENDPAGEFN T 'TTY-ENDPAGEFN)

;;; (CATCHMORE X Y Z) EVALUATES Z WITH A **MORE** CATCH
;;; AROUND IT.  THIS COOPERATES WITH TTY-ENDPAGEFN
;;; TO DO **MORE** PROCESSING.
;;; THUS, FOR EXAMPLE, (CATCHMORE '**MORE** 'FLUSHED <STUFF>)
;;; WHERE <STUFF> DOES SOME PRINTING WILL PERFORM THE
;;; STANDARD KIND OF **MORE** PROCESSING, FLUSHING <STUFF>
;;; IF A NON-SPACE IS TYPED.
;;; THE MACRODEF MACRO-DEFINER LIVES IN ML:GLS;MACROS >.

(MACRODEF CATCHMORE (MOREMSG FLUSHMSG . BODY)
	  (CATCH ((LAMBDA (**MORE** MORE-FLUSH) . BODY)
		  MOREMSG FLUSHMSG)
		 CLEVER-MORE))

(DEFUN DIR FEXPR (X)		;LIST AN ITS FILE DIRECTORY
       (TERPRI)
       (CURSORPOS 'C)
       ((LAMBDA (FILE)
		(CATCHMORE '|---TYPE SPACE FOR MORE---|
			   '|OH, WELL, SO MUCH FOR THAT...|
			   (DO ((CH (TYI FILE) (TYI FILE)))
			       ((= CH 14))
			       (TYO CH)))
		(CLOSE FILE))
	(OPEN (CONS (CONS 'DSK X) '(/.FILE/. /(DIR/)))))
       (ASCII 0))

FASLOADING WITHIN A FASLOAD WORKS PRETTY WELL.
NATURALLY, YOU CAN ONLY FASLOAD *BETWEEN* FUNCTION;
"EVALUATED CONSTANTS" WITHIN A FUNCTION MAY NOT
DO FASLOADS.  (IF YOU DON'T UNDERSTAND THIS LAST ITEM,
DON'T WORRY.)

FORCE-OUTPUT IS AS IN THE MANUAL; IT FORCES AN BUFFER OUT.
CLEAR-INPUT AND CLEAR-OUTPUT BOTH EXIST.  ON ITS THEY ARE
MEANINGFUL ONLY FOR TTY FILES, THOUGH THEY DON'T HURT ON
ANY OTHER FILES.

THE STATUS CALLS BELOW ARE EQUIVALENT TO THE
EXPRESSIONS TO THE RIGHT, AND ARE INCLUDED ONLY
FOR COMPATIBILITY WITH OLD I/O.  AVOID USING THESE
STATUS CALLS IN NEW CODE.
NOTE THAT (STATUS UREAD) ETC. RETURNS A NEW I/O NAMELIST,
WHICH IS NOT QUITE OF THE SAME FORM AS AN OLD I/O 4-LIST.

(STATUS UREAD)        <=>  (TRUENAME UREAD)
(SSTATUS UREAD ...)   <=>  (UREAD ...)
(STATUS UWRITE)       <=>  (CAR (TRUENAME UWRITE))
(SSTATUS UWRITE ...)  <=>  (UWRITE ...)
(STATUS CRFILE)       <=>  (CDR (DEFAULTF NIL))
(SSTATUS CRFILE ...)  <=>  (DEFAULTF '(...))
(STATUS CRUNIT)       <=>  (CRUNIT NIL)
(SSTATUS CRUNIT ...)  <=>  (CRUNIT ...)

FOR COMPATIBILITY WITH OLD I/O, IF THE FILE IS OMITTED
IN THE STATUS CALLS BELOW, THE VALUE T (THE STANDARD
INITIAL TTY) IS ASSUMED.

(STATUS TTY X) HANDS BACK THE TTYST1, TTYST2, AND TTYSTS
	VARIABLES FOR THE TTY INPUT FILE X AS A LIST
	OF THREE FIXNUMS.

(SSTATUS TTY M N X) SETS THE TTYST1 AND TTYST2 VARIABLES
	FOR THE TTY INPUT FILE X TO THE FIXNUMS M AND N.

(STATUS TTYREAD X) HANDS BACK THE TTYREAD SWITCH FOR THE
	TTY INPUT FILE X.  IF NIL, THEN ONLY FORCE-FEED
	CHARACTERS CAUSE THE TTY PRE-SCAN FUNCTION TO
	RETURN WITH ITS BUFFERED LIST OF CHARACTERS.

(SSTATUS TTYREAD VAL X) SETS THE SWITCH TO T OR NIL
	ACCORDING TO VAL.

(STATUS LINMODE X) HANDS BACK THE LINMODE SWITCH FOR THE
	TTY INPUT FILE X.  IF T, THEN ONLY CARRIAGE
	RETURNS CAUSE THE TTY PRE-SCAN FUNCTION TO
	RETURN WITH ITS BUFFERED LIST OF CHARACTERS.

(SSTATUS LINMODE VAL X) SETS THE LINMODE SWITCH.
	IT ALSO AFFECTS THE ACTIVATION BITS IN
	THE TTYST1 AND TTYST2 VARIABLES.

----------------------------------------------------------------
THINGS WHICH HAVE DISAPPEARED IN NEW I/O, NOT TO BE IMPLEMENTED
----------------------------------------------------------------
(STATUS INTERRUPT) AND (SSTATUS INTERRUPT) DO NOT EXIST
IN NEWIO.  (ENDPAGEFN <FILE> <FUNCTION>) IS USED TO SET UP
**MORE** INTERRUPTS; (SSTATUS TTYINT) IS USED TO SET FUNCTIONS
FOR INTERRUPT CHARACTERS.  ALL OTHER INTERRUPT FUNCTIONS
ARE THE VALUES OF ATOMIC SYMBOLS, AND SO CAN BE SET UP
WITH SETQ.  THE NAMES OF THESE VARIABLES ARE:

ALARMCLOCK		UNDF-FNCTN
AUTOLOAD		UNBND-VRBL
ERRSET			WRNG-TYPE-ARG
*RSET-TRAP		UNSEEN-GO-TAG
GC-DAEMON		WRNG-NO-ARGS
GC-OVERFLOW		GC-LOSSAGE
PDL-OVERFLOW		FAIL-ACT
			IO-LOSSAGE

THE ONLY ONE OF THESE WHICH IS NEW IN NEWIO IS AUTOLOAD,
WHICH HOLDS THE AUTOLOAD INTERRUPT HANDLER.

LOADARRAYS AND DUMPARRAYS NO LONGER EXIST.  A MORE GENERAL
NEW I/O PRIMITIVE WILL EVENTUALLY ENABLE THE USER TO WRITE
THESE FUNCTIONS FOR HIMSELF (A STANDARD PACKAGE EQUIVALENT
TO THE OLD ONES WILL BE PROVIDED).

IOC NO LONGER EXISTS IN NEW I/O.  USE THE FOLLOWING
	TABLE OF EQUIVALENCES:
(IOC C) <=> (SETQ ^D NIL)
(IOC D) <=> (SETQ ^D T)
(IOC G) <=> (^G)
(IOC Q) <=> (SETQ ^Q T)
(IOC R) <=> (SETQ ^R T)
(IOC S) <=> (SETQ ^Q NIL)
(IOC T) <=> (SETQ ^R NIL)
(IOC V) <=> (SETQ ^W NIL)
(IOC W) <=> (CLEAR-OUTPUT (SETQ ^W T))
(IOC X) <=> (^X)
(IOC Z) <=> (VALRET ':VK/ )
TO INVOKE USER INTERRUPT FUNCTIONS, JUST FUNCALL THEM.

IOG NO LONGER EXISTS.  INSTEAD OF (IOG NIL ...) SAY INSTEAD
	((LAMBDA (^Q ^R ^W) ...) NIL NIL NIL).

(STATUS IOC), (SSTATUS IOC) NO LONGER EXIST.
	THEIR EFFECT CAN BE DUPLICATED BY USING
	SETQ, FUNCALL, OR THE NEW ^X AND ^G
	FUNCTIONS.

(STATUS TERPRI), (SSTATUS TERPRI) NO LONGER EXIST.
	TO GET THEIR EFFECT, USE THE LINEL FUNCTION
	TO SET THE LINEL FOR EACH OUTPUT FILE TO 0.
	(A LINEL OF ZERO MEANS INFINITY.)

(STATUS PAGEPAUSE), (SSTATUS PAGEPAUSE) NO LONGER EXIST.
	THEY HAVE BEEN SUPERSEDED BY THE **MORE**
	INTERRUPT FEATURE.
