5/22/73 - JONL - A NEW LSUBR, ERROR, OF 0, 1, 2, OR 3 ARGS IS NOW AVAILABLE TO ALLOW THE USER TO ENTER THE LISP ERROR SYSTEM. THE FIRST ARG, IF PRESENT, IS TAKEN TO BE A MESSAGE, AND IS PRINC'D JUST LIKE THE MESSAGES THAT ARE PRINTED OUT WHEN AN ERROR IS DETECTED BY THE LISP SYSTEM. THE SECOND ARG, IF PRESENT, IS CONSIDERED TO BE AN OFFENDING PIECE OF DATUM WHICH IS PRINTED JUST BEFORE THE MESSAGE. THE THIRD ARG, IF PRESENT, IS TAKEN TO BE AN LISP ERROR INTERRUPT NUMBER, OR THE ATOM WHOSE VALUE HOLDS THAT INTERRUPT FUNCTION; AND THE CORRESPONDING CORRECTABLE-ERROR INTERRUPT FUNCTION IS CALLED. IN THIS LAST CASE, THE SECOND ARG TO ERROR IS PASSED ALONG AS THE ARGUMENT TO THE INTERRUPT FUNCTION [THE USUAL PROTOCOL FOR CORRECTING AN ERROR APPLIES, SEE PRIOR DISCUSSION IN THIS FILE], AND THE CORRECTED RETURN-VALUE IS THE VALUE OF ERROR. IF THERE IS NO THIRD ARGUMENT, THEN AN ORDINARY BOMB-OUT UNCORRECTABLE LISP ERROR IS PERFORMED. FOR EXAMPLE, SUPPOSE ONE WANTS TO CAUSE A WRNG-TYPE-ARG ERROR WHEN AN ATOM ATOM PASSED TO "GOODP" IS EITHER UNBOUND (IN THE LISP SENSE) OR ELSE HAS THE VALUE "MUNBOUND": (DEFUN GOODP (X) (COND ((OR (NOT (EQ (TYPEP X) 'PNAME)) (NOT (BOUNDP X)) (EQ (EVAL X) 'MUNBOUND)) (ERROR 'ATOM-WITH-RANDOM-VALUE X 7)) (T X))) BRIEF REVIEW ERROR INTERRUPT FUNCTION NUMBERS, AND GLOBAL VARIABLE WHOSE VALUE HOLDS THE INTERRUPT FUNCTION: ERROR CHANNEL # USER INTERRUPT # GLOBAL VARIABLE 0 5 UNDF-FUNCTION 1 6 UNBND-VRBL 2 7 WRNG-TYPE-ARG 3 8. UNSEEN-GO-TAG 4 9. WRNG-NO-ARGS 5 10. GC-LOSSAGE 6 11. FAIL-ACT NOTE THAT (ERROR) EVAL'S THE SAME AS (ERR), AND IN THE EXAMPLE ABOVE, ONE COULD ALSO HAVE WRITTEN (ERROR 'ATOM-WITH-RANDOM-VALUE X 'WNRG-TYPE-ARG) CURSORPOS HAS BEEN MADE AN LSUBR - WITH NO ARGUMENTS IT RETURNS THE POSITION OF THE DISPLAY CURSOR AS A DOTTED PAIR (LINENO . COLUMNO), WHERE LINE NUMBER 0 IS THE TOP LINE OF THE SCREEN, AND COLUMN NUMBER 0 IS THE LEFTMOST [FOR NON-DISPLAY CONSOLES, CURSORPOS ALWAYS RETURNS NIL]. WITH TWO ARGUMENTS, (CURSORPOS X Y) MOVES THE DISPLAY CURSOR TO THE XTH LINE, YTH COLUMN, AND THEN RETURNS T [AGAIN, RETURNS NIL FOR NON-DISPLAY CONSOLES]. A NEW SUBR OF THREE ARGUMENTS, SETSYNTAX, IS IMPLEMENTED TO FACILITATE CERTAIN READTABLE SYNTAX HACKING. THE ARGUMENTS ARE 1) EITHER A FIXNUM LESS THAN 128., OR A SINGLE CHARACTER, WHICH SPECIFIES THE ENTRY OF THE READTABLE TO BE HACKED; 2) ONE OF 2A) NIL, MEANING NO ACTION ON THE CHAR'S SYNTAX, 2B) A FIXNUM, WHICH IS THE NEW SYNTAX CATEGORY FOR THE FIRST ARG, 2C) A SINGLE-CHARACTER ATOM, MEANING NEW SYNTAX FOR FIRST ARG TO BE SAME AS THE INITIAL, SYSTEM-SET SYNTAX FOR THIS CHAR, 2D) THE ATOM "MACRO", MEANING ELEMENTAL READ-MACRO SYNTAX, AND IMPLYING THAT THE THIRD ARG IS THE MACRO FUNCTION, 2E) THE ATOM "SPLICING", MEANING SPLICING READ-MACRO; 3) ONE OF 3A) NIL, MEANING NO ACTION ON CHTRAN OF FIRST ARG, OR ELSE, IF SECOND ARG IS OPTION 2D OR 2E, THEN MEANING IS TO TURN OFF THE READ-MACRO, RESTORING THE SYNTAX AND CHTRAN TO THE INITIAL SYSTEM VALUE FOR THAT CHAR, 3B) A FIXNUM, MEANING THE ASCII INPUT TRANSLATION FOR THE FIRST ARG, 3C) A SINGLE CHARACTER ATOM, MEANING TRANSLATE TO ASCII VALUE OF THAT CHARACTER, 3D) A FUNCTION, WHICH IS THE MACRO FUNCTION REQUIRED BY OPTIONS 2D AND 2E. SETSYNTAX ALWAYS RETURNS T. TWO NEW STATUS CALLS: (STATUS UDIR) RETURNS AN ATOM WHOSE PNAME IS THE SAME AS THE INITIAL WORKING DIRECTORY OF THE USER LOGGED IN. ON THE PDP10 SYSTEM, THIS WILL ALWAYS BE THE SAME AS (STATUS UNAME), BUT ON THE MULTICS SYSTEM, THESE TWO ARE DIFFERENT. (STATUS HACTRN) RETURNS NON-NIL IF AND ONLY IF THE LISP IS AN INFERIOR JOB TO A HACTRN. THIS WILL ALLOW A LISP IN A DISOWNED TREE TO CONTINUE INTERACTION WITH A HACTRN ABOVE IT, TYPICALLY FOR THE PURPOSE OF ADDING TO, OR INSPECTING ITS JOB SYMBOL TABLE. ALSO, ONE MIGHT TEST THIS BEFORE VALRET'ING A STRING. NEEDLESS TO SAY, THIS CALL IS IMPLEMENTED ONLY IN THE ITS PDP10 VERSION.