(FILECREATED " 6-DEC-82 00:04:14" <BLISP>AERROR.;54    4516

      changes to:  (FNS \LISPERROR)

      previous date: "27-NOV-82 15:48:41" <BLISP>AERROR.;53)


(* Copyright (c) 1982 by Xerox Corporation)

(PRETTYCOMPRINT AERRORCOMS)

(RPAQQ AERRORCOMS ((FNS ERRORM ERRORN ERRORSTRING SETERRORN LISPERROR \LISPERROR \ILLEGAL.ARG 
			\ARG.NOT.LITATOM)
		   (EXPORT (DECLARE: EVAL@COMPILE (VARS \ERRORMESSAGELIST)
				     DONTCOPY
				     (MACROS LISPERROR)))
		   (VARS (\ERRORNUMBER 1)
			 (\ERRORMESSAGE))
		   (GLOBALVARS \ERRORMESSAGELIST \ERRORMESSAGE \ERRORNUMBER)
		   (LOCALVARS . T)))
(DEFINEQ

(ERRORM
  [LAMBDA (X)                      (* lmm "21-APR-80 15:44")
    [COND
      ((NOT (LISTP X))
	(SETQ X (LIST 17 X]
    (PROG NIL
          (TERPRI T)
          (PRIN1 (OR [CAR (NTH \ERRORMESSAGELIST (ADD1 (OR (NUMBERP (CAR X))
							   17]
		     (QUOTE "ERROR"))
		 T T)
          (TERPRI T)
          (RETURN (PRINT (CAR (OR (LISTP (CDR X))
				  (RETURN)))
			 T T])

(ERRORN
  [LAMBDA NIL                      (* lmm: 26 JUN 75 655)
    (CONS \ERRORNUMBER (COND
	    (\ERRORMESSAGE (LIST (CAR \ERRORMESSAGE])

(ERRORSTRING
  [LAMBDA (X)                      (* lmm "21-APR-80 15:46")
    (CAR (NTH \ERRORMESSAGELIST (ADD1 (OR (NUMBERP X)
					  17])

(SETERRORN
  [LAMBDA (NUM MESS)               (* lmm: 29 JUN 75 1516)
    (SETQ \ERRORNUMBER NUM)
    (SETQ \ERRORMESSAGE (LIST MESS])

(LISPERROR
  [LAMBDA (N X CONTINUEOKFLG)      (* lmm " 6-MAY-80 21:30")
                                   (* compiles open as call to \LISPERROR)
    (\LISPERROR X N CONTINUEOKFLG])

(\LISPERROR
  [LAMBDA (X N CONTINUEOKFLG)      (* lmm " 5-DEC-82 23:58")
    (DECLARE (USEDFREE \INTERRUPTABLE))
    (PROG NIL
          (SELECTQ N
		   ((5 26Q)        (* File errors that can happen to files open for output)
		     (\STOP.DRIBBLE? X))
		   NIL)
          (OR \INTERRUPTABLE (RAID "Error with Interrupts off - ↑N to continue"))
      RET (RETURN (PROG1 (COND
			   ((SMALLP N)
			     (ERRORX (LIST N X)))
			   (T (ERROR N X)))
			 (OR CONTINUEOKFLG (GO RET])

(\ILLEGAL.ARG
  [LAMBDA (X)                      (* lmm "25-APR-80 18:02")
    (LISPERROR "ILLEGAL ARG" X])

(\ARG.NOT.LITATOM
  [LAMBDA (X)                      (* lmm "25-APR-80 18:02")
    (LISPERROR "ARG NOT LITATOM" X])
)

(* FOLLOWING DEFINITIONS EXPORTED)


(DECLARE: EVAL@COMPILE 

(RPAQQ \ERRORMESSAGELIST ("SYSTEM ERROR" "UNUSED" "STACK OVERFLOW" "ILLEGAL RETURN" "ARG NOT LIST" 
					 "HARD DISK ERROR"
					 "ATTEMPT TO SET NIL OR T" "ATTEMPT TO RPLAC NIL" 
					 "UNDEFINED OR ILLEGAL GO"
					 "FILE WON'T OPEN" "NON-NUMERIC ARG" "ATOM TOO LONG" 
					 "ATOM HASH TABLE FULL"
					 "FILE NOT OPEN" "ARG NOT LITATOM" "! too many files open" 
					 "END OF FILE"
					 "ERROR" "BREAK" "ILLEGAL STACK ARG" "FAULT IN EVAL" 
					 "ARRAYS FULL"
					 "FILE SYSTEM RESOURCES EXCEEDED" "FILE NOT FOUND" 
					 "BAD SYSOUT FILE"
					 "UNUSUAL CDR ARG LIST" "HASH TABLE FULL" "ILLEGAL ARG" 
					 "ARG NOT ARRAY"
					 "ILLEGAL OR IMPOSSIBLE BLOCK" "STACK PTR HAS BEEN RELEASED" 
					 "STORAGE FULL"
					 "ATTEMPT TO USE ITEM OF INCORRECT TYPE" 
					 "ILLEGAL DATA TYPE NUMBER"
					 "DATA TYPES FULL" "ATTEMPT TO BIND NIL OR T" 
					 "! too many user interrupt characters"
					 "! read-macro context error" "ILLEGAL READTABLE" 
					 "ILLEGAL TERMINAL TABLE"
					 "! swapblock too big for buffer" "PROTECTION VIOLATION" 
					 "BAD FILE NAME"
					 "USER BREAK" "UNBOUND ATOM" "UNDEFINED CAR OF FORM" 
					 "UNDEFINED FUNCTION"
					 "CONTROL-E" "FLOATING UNDERFLOW" "FLOATING OVERFLOW" 
					 "OVERFLOW"
					 "ARG NOT HARRAY" "TOO MANY ARGUMENTS"))
DONTCOPY 
(DECLARE: EVAL@COMPILE 

(PUTPROPS LISPERROR MACRO [ARGS (CONS (QUOTE \LISPERROR)
				      (CONS (CADR ARGS)
					    (CONS (COND
						    [(STRINGP (CAR ARGS))
						      (for X in \ERRORMESSAGELIST as I from 0
							 when (EQUAL X (CAR ARGS))
							 do (RETURN I)
							 finally (RETURN (HELP 
									  "Unknown error message"
									       ARGS]
						    (T (CAR ARGS)))
						  (CDDR ARGS])
)
)


(* END EXPORTED DEFINITIONS)


(RPAQQ \ERRORNUMBER 1)

(RPAQQ \ERRORMESSAGE NIL)
(DECLARE: DOEVAL@COMPILE DONTCOPY

(ADDTOVAR GLOBALVARS \ERRORMESSAGELIST \ERRORMESSAGE \ERRORNUMBER)
)
(DECLARE: DOEVAL@COMPILE DONTCOPY

(LOCALVARS . T)
)
(DECLARE: DONTCOPY (PUTPROPS AERROR COPYRIGHT ("Xerox Corporation" 3676Q)))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (603 2376 (ERRORM 613 . 997) (ERRORN 999 . 1146) (ERRORSTRING 1148 . 1293) (SETERRORN 
1295 . 1435) (LISPERROR 1437 . 1633) (\LISPERROR 1635 . 2128) (\ILLEGAL.ARG 2130 . 2247) (
\ARG.NOT.LITATOM 2249 . 2374)))))
STOP
26Q . 4625Q)))))
STOP