THURSDAY JULY 01,1976 NM+4D.11H.48M.23S. LISP 1168 - GLS - [1] HUNK STUFF HAS CHANGED; HUNK,HUNKIFY => MAKHUNK,HUNK [2] TOPLEVEL AND BREAKLEVEL FLUSH SPACES AFTER ATOMS [3] PRINT IS MORE CLEVER ABOUT AUTO-TERPRI AND PRINLEVEL [4] NEW FUNCTION "SUBR" FINDS ROUTINE A PC IS IN FOR NEWIO ONLY: [A] MAR-BREAK INTERRUPT TURNS OFF MAR [B] ALL THE NEW INTERRUPTS RUN IN (NOINTERRUPT T) STATE [C] THE VARIABLE DEFAULTF IS THE DEFAULT FILE NAMES [D] MACHINE-ERROR INTERRUPT NOW GETS MORE ARGUMENTS ---------------------------------------------------------------- [1] THE HUNK STUFF HAS BEEN REVISED AS FOLLOWS: (CXR 0 X) = (CDR X), (CXR 1 X) = (CAR X) THIS IS THE REVERSE OF WHAT IT INITIALLY WAS. THE OTHER COMPONENTS ARE STILL COMPONENTS 2 THROUGH N-1. THE OLD "HUNKIFY" FUNCTION HAS BEEN RENAMED "HUNK". IT TAKES ITS ARGUMENTS IN THE ORDER 1, 2, 3, ..., N-1, 0. THIS IS THE ORDER THEY ARE PRINTED IN. THUS: (SETQ FOO (HUNK 1 2 3 4 5)) (1 . 2 . 3 . 4 . 5) (CXR 1 FOO) 1 (CXR 2 FOO) 2 (CXR 0 FOO) 5 THE OLD "HUNK" FUNCTION HAS BEEN RENAMED "MAKHUNK". IT ALSO HAS AN EXTENDED DEFINITION: IF THE ARGUMENT TO MAKHUNK IS A FIXNUM, IT CREATES A HUNK THAT BIG FILLED WITH NILS. IF THE ARGUMENT IS A LIST, IT CREATES A HUNK FILLED WITH THE ELEMENTS OF THE LIST. THUS (MAKHUNK (LIST A B C D)) = (HUNK A B C D) [2] IN THE SYSTEM-SUPPLIED TOPLEVEL AND BREAKLEVEL READ-EVAL-PRINT LOOPS, JUST AFTER AN ITEM IS READ THE FOLLOWING OCCURS: (AND (ATOM THE-ITEM) (NOT (ZEROP (BOOLE 1 100000 (STATUS SYNTAX (TYIPEEK))))) (TYI)) IN THIS WAY THE SPACE THAT TERMINATED THE ATOM (IF IT WAS IN FACT A SPACE) IS FLUSHED. THIS IS SO THAT THE SPACE WILL NOT HANG AROUND AND CONFUSE, E.G., **MORE** PROCESSING. USER TOPLEVELS AND BREAKLEVELS SHOULD DO A SIMILAR THING. I WOULD APPRECIATE GETTING COMMENTS ABOUT THIS GENERAL PROBLEM ABOUT SPACES AFTER ATOMS. SHOULD THERE BE TWO READ FUNCTIONS, ONE WHICH FLUSHES SPACES AND ONE WHICH DOES NOT? OR WHAT? -- GLS [3] A NEW USELESS FEATURE OF PRINT IS THAT THE AUTO-TERPRI HACK IS MORE CLEVER. UP TO NOW PRINT HAS CALCULATED THE SIZE OF EACH ATOMIC SYMBOL AND PUT A TERPRI (CARRIAGE RETURN) BEFORE THE SYMBOL IF IT WON'T FIT ON THE CURRENT OUTPUT LINE. NOW IT CALCULATES OR ESTIMATES THE LENGTH OF EACH ATOM (NUMBERS, ETC., AS WELL AS SYMBOLS), AND ALLOWS FOR ANY PARENTHESES WHICH MUST PRECEDE OR FOLLOW THE ATOM. THUS, IF THE NEXT FRAGMENT TO PRINT IS "((FOOBAR)))", PRINT WILL TERPRI IF THERE ARE NOT AT LEAST ELEVEN CHARACTERS LEFT IN THE OUTPUT LINE. THIS MEANS THAT YOU DON'T GET ISOLATED LEFT PARENS AT THE END OF A LINE, OR RIGHT PARENS AT THE BEGINNING OF A LINE. [4] THE NEW FUNCTION "SUBR" (ONLY IN BIBOP LISPS, FOR OBSCURE TECHNICAL REASONS), TAKES ONE ARGUMENT, A FIXNUM, AND TRIES TO DETERMINE WHAT FUNCTION THAT NUMBER WOULD BE A PC IN. THIS HACK IS ONLY APPROXIMATE, AND DEPENDS ON LOOKING AT ALL THE PROPERTY LISTS OF ATOMS IN THE CURRENT OBARRAY. THE ATOM WITH THE CLOSEST REASONABLE SUBR, FSUBR, LSUBR, OR ARRAY PROPERTY IS RETURNED AS THE RESULT. IF NO REASONABLE RESULT IS FOUND, THE ATOM "?" IS RETURNED. (WHAT THIS DOES IS PROVIDE A HANDLE ON AN INTERNAL ROUTINE LISP HAS HAD FOR A LONG TIME ANYWAY. SEE ITEM [D] BELOW.) FOR NEWIO ONLY: [A] WHEN THE MAR-BREAK USER INTERRUPT GOES OFF, AN IMPLICIT (SSTATUS MAR 0 NIL) HAS BEEN PERFORMED. IT IS UP TO THE MAR-BREAK FUNCTION TO RE-ENABLE THE MAR IF DESIRED. THIS IS SIMILAR TO THE OPERATION OF THE ALARMCLOCK FUNCTION. THE INTENTION IS TO HELP PREVENT INFINITE LOOPS. [B] ALL THE NEW ASYNCHRONOUS INTERRUPTS ANNOUNCED LAST TIME, NAMELY MAR-BREAK, SYS-DEATH, AND TTY-RETURN, ARE RUN IN (NOINTERRUPT T) MODE JUST LIKE TTY CHARACTER INTERRUPTS. (I FORGOT TO DOCUMENT THIS LAST TIME.) [C] THE VARIABLE DEFAULTF NOW CONTAINS NEWIO'S DEFAULT FILE NAMES, IN THE FORM OF A NAMELIST. THIS IS SO YOU CAN LAMBDA-BIND THEM. THE FUNCTION DEFAULTF STILL EXISTS AND IS EQUIVALENT TO: (DEFUN DEFAULTF (X) (SETQ DEFAULTF (MERGEF (OR X DEFAULTF) DEFAULTF))) [D] THE MACHINE-ERROR INTERRUPT HAS BEEN CHANGED TO TAKE FOUR ARGUMENTS. THEY ARE A SYMBOL AND THREE FIXNUMS, IN THAT ORDER (THIS INVOLVES A REVERSAL OF ITS FORMAR ARGUMENTS.) THE SYMBOL STILL INDICATES THE ERROR TYPE. THE THREE FIXNUMS ARE, IN ORDER, THE LOCATION OF THE ERROR, THE PC AS OF THE ERROR, AND THE JPC AS OF THE ERROR. FOR THE NONCE, THE FIRST AND THIRD FIXNUMS ARE ALWAYS ZERO, BUT EVENTUALLY WILL CONTAIN INFORMATION AS CORRECT AS ITS CAN SUPPLY. AS AN EXAMPLE OF A MACHINE-ERROR FUNCTION, THIS ONE DOES APPROXIMATELY WHAT THE SYSTEM DEFAULT HANDLER DOES: (DEFUN MACHINE-ERROR-HANDLER (TYPE LOC PC JPC) (TERPRI) (PRINC (COND ((EQ TYPE 'EXAMINE) '|;REFERENCE TO NON-EXISTENT MEMORY|) ((EQ TYPE 'DEPOSIT) '|;WRITE INTO READ-ONLY MEMORY|) ((EQ TYPE 'EVAL) '|;ILLEGAL MACHINE OPERATION|) ((EQ TYPE 'ODDP) '|;PARITY ERROR|))) (PRINC '| FROM LOCATION |) (PRIN1 PC) (TERPRI) (PRINC '|;PROGRAM TRAPPED WHILE IN |) (PRIN1 (SUBR PC)) ;SEE ITEM [4] ABOVE FOR SUBR (ERROR)) ANOTHER ONE TO USE IS: (DEFUN MACHINE-ERROR-HANDLER (TYPE LOC PC JPC) ((LAMBDA (ARGS) (BREAK MACHINE-ERROR)) (LIST (COND ((EQ TYPE 'EXAMINE) 'REFERENCE-TO-NON-EXISTENT-MEMORY) ((EQ TYPE 'DEPOSIT) 'WRITE-INTO-READ-ONLY-MEMORY) ((EQ TYPE 'EVAL) 'ILLEGAL-MACHINE-OPERATION) ((EQ TYPE 'ODDP) 'PARITY-ERROR)) 'AT 'LOCATION LOC 'FROM 'WITHIN (SUBR PC)))) WHEN THE BREAK OCCURS, THE VARIABLE ARGS, FOLLOWING CONVENTION, HAS THE USEFUL DATA.