TUESDAY JUNE 15,1976 FM+3D.2H.27M.33S. LISP 1160 - GLS - NOTE THAT NUMBERED ITEMS ARE FOR BOTH NEWIO AND OLDIO, WHILE LETTERED ITEMS ARE FOR NEWIO ONLY. NOTE ALSO THAT NUMBERED AND LETTERED ITEMS ARE INTERMIXED SLIGHTLY. [0] NEW COMPILER FEATURES [0A] (PROGN 'COMPILE A1 ... AN) AT TOP LEVEL COMPILES A1 ... AN [0B] (DEFUN (FOO BAR) ...) PULLS A SPECIAL GENSYM HACK [0C] (RECOMPL '(A B C ...)) IS USED TO RECOMPILE A FILE [0D] THE COMPILER NOW RECOGNIZES (CGOL) SPECIALLY [1] THE VARIABLE ZFUZZ CONTROLS PRECISION OF PLUS AND DIFFERENCE [2] DEFPROP AND DEFUN DO A REMPROP LOOP, NOT JUST A SINGLE REMPROP [3] P% IS "LISP TYPEOUT MODE", AND GETS SET UP IN & IF POSSIBLE [A] TYI ARRANGES TO READ NON-ACTIVATION CHARACTERS [B] TYI ON TTY DOESN'T CONFUSE CURSORPOS ANY MORE [C] THE VARIABLES TYI AND TYO CONTAIN THE INITIAL TTY FILE OBJECTS [D] SETQ OF READ NOW WORKS IN NEWIO; "LOAD" USES IT TOO [E] RECALL THAT HH$X IS BB$X IN NEWIO [F] SPECIAL TREATMENT OF CTRL AND META CHARACTERS IN NEWIO [G] MAR INTERRUPT FEATURE [F1] THE MAR-BREAK USER INTERRUPT [F2] (STATUS MAR) AND (SSTATUS MAR) [F3] SUSPEND SAVES AND RESTORES THE MAR [F4] ^G CIRCUMVENTS THE MAR ON RESTORED VARIABLES [H] OTHER NEW USER INTERRUPTS [G1] TTY-RETURN (TTY JUST RETURNED TO THE JOB) [G2] SYS-DEATH AND (STATUS ITS) [G3] MACHINE-ERROR (MEMORY ERRORS, ILLEGAL OPERS, PARITY ERRORS) [4] HUNKS PACKAGE [5A] NEW DATA TYPES [5B] NEW PRIMITIVES: CXR, RPLACX, HUNK, HUNKIFY, HUNKSIZE [5C] EQUAL AND SXHASH TREAT HUNKS SPECIALLY [5D] PRINT TREATS HUNKS SPECIALLY [5E] TREATMENT OF HUNKS AS LIST STRUCTURE [5F] (STATUS FEATURE HUNK) [5G] (STATUS SPCNAMES) [5H] (STATUS GCSIZE), ETC., AND (ALLOC X) [I] HUMBLE PACKAGE FOR HACKING INFERIOR JOBS ON ITS [I1] SPECIAL VARIABLES AND THE JOB TABLE [I2] CREATE-JOB [I3] SELECT-JOB [I4] KILL-JOB [I5] LOAD-JOB [I6] JOB-USET-READ AND JOB-USET-WRITE [I7] EXAMINE-JOB AND DEPOSIT-JOB [I8] *ATTY AND *DTTY [I9] AUXILIARY PACKAGES ---------------------------------------------------------------- [0] NEW COMPILER FEATURES [0A] IF THE FORM (PROGN 'COMPILE A1 ... AN) IS SEEN AT THE TOP LEVEL OF A FILE, THE COMPILER COMPILES THE FORMS A1 ... AN AS IF THEY ALL WERE SEEN AT TOP LEVEL. IN THIS WAY A MACRO CAN "RETURN MULTIPLE FORMS" TO BE COMPILED (AFTER ALL, THE CONSTRUCT ALSO WORKS IN THE INTERPRETER). [0B] (DEFUN (FOO BAR) ...) IN THE INTERPRETER DEFINES FOO TO HAVE A BAR PROPERTY WHICH IS A LAMBDA EXPRESSION. THE COMPILER CREATES A GENSYM G0034, OUTPUTS THE FORM (DEFPROP FOO G0034 BAR), AND THEN COMPILES THE FUNCTION UNDER THE NAME G0034. IN THIS WAY (FUNCALL (GET 'FOO 'BAR) ...) WILL ALWAYS WORK, FOR EXAMPLE. CONTRAST THIS WITH (DEFUN (FOO BAR BAZ) ...), WHICH IN THE INTERPRETER GIVES FOO A BAR PROPERTY, AND WHEN COMPILED GIVES FOO A BAZ PROPERTY. [0C] THE VARIABLE RECOMPL, IF NON-NIL, CAUSES THE COMPILER TO IGNORE ALL FORMS IN A FILE EXCEPT DECLARATIONS AND FUNCTIONS WHOSE NAMES APPEAR IN THE LIST WHICH IS THE VALUE OF RECOMPL. THE FUNCTION RECOMPL APPENDS ITS ARGUMENT TO THE RECOMPL LIST. THE IDEA IS THAT ONE CAN SPECIFY TO THE COMPILER WHICH FUNCTIONS IN A FILE HAVE CHANGED, AND PRODUCE AN "UPDATE" FASL FILE CONTAINING ONLY THE DIFFERENCES. [0D] THE COMPILER NOW RECOGNIZES THE FORM (CGOL), AND TREATS IT SOMEWHAT LIKE (DECLARE (EVAL (READ))) (CGOL). [1] IF THE VARIABLE ZFUZZ IS NON-NIL, THEN PLUS AND DIFFERENCE PERFORM A SPECIAL FUZZ CHECK ON FLOATING POINT NUMBERS. IF A AND B ARE THE NUMBERS TO BE ADDED (POSSIBLY AFTER CONTAGIOUS CONVERSION TO FLOATING POINT), THEN IF A + B < B * ZFUZZ THEN THE RESULT IS FORCED TO ZERO. THIS HACK WAS INVENTED FOR BMT; IT MAY CHANGE IF HE DECIDES IT ISN'T THE RIGHT THING. [2] BEFORE PUTTING THE NEW PROPERTY ON AN ATOM, DEFPROP AND DEFUN USED TO PERFORM A SINGLE REMPROP OF THE PROPERTY. NOW THEY LOOP, REMOVING ALL INSTANCES OF THE PROPERTY FROM THE ATOM. THIS IS TO ALLOW FOR TRACE, WHICH CREATES ATOMS WITH MULTIPLE OCCURRENCES OF A GIVEN PROPERTY NAME. [3] FOR THOSE WHO HACK LISP FROM DDT: THE SYMBOL P% IS A PUSHJ INSTRUCTION SUITABLE FOR USE AS A DDT USER TYPEOUT MODE (BY DEPOSITING IT INTO ..TAMPER OR SOME SIMILAR LOCATION). IF WHEN THE LISP IS STARTED UP DDT HAS A SYMBOL TABLE LOADED FOR THE LISP, LISP MOVES THE TYPEOUT MODE IN ..TAMPER TO ..TPERCE, AND DEPOSITS P% IN ..TAMPER. IN THIS WAY THE DDT COMMAND & MEANS LISP TYPEOUT MODE, AND SQUOZE TYPEOUT MAY BE DONE VIA $%;. THIS FORM OF LISP TYPEOUT MODE TYPES OUT $Q, NOT THE CONTENTS OF . AS P.$X AND PL.$X DO. IF $Q HAS A NON-ZERO LEFT HALF, THEN BOTH THE LEFT AND RIGHT HALVES ARE PRINTED AS S-EXPRESSIONS, SEPARATED BY ",,". THIS TYPEOUT MODE IS USEFUL IN CONJUNCTION WITH THE "RAID REGISTER" FEATURE OF DDT ($V). REMEMBER, LETTERED ITEMS ARE FOR NEWIO ONLY! [A] WHEN INPUTTING FROM A TTY USING THE TYI FUNCTION (AS OPPOSED TO READ OR READLINE), NEWIO ARRANGES TO SET THE %TIACT BIT. THE EFFECT OF THIS IS TO READ ANY CHARACTER IMMEDIATELY, EVEN IF NO ACTIVATION CHARACTER HAS BEEN TYPED YET. THIS WILL ALLEVIATE THE SCREW INVOLVING (STATUS TTY) FOR MOST PEOPLE. [B] MANY PLACES IN NEWIO ARE NOW MUCH MORE CLEVER ABOUT UPDATING THE CHARPOS AND LINENUM OF A TTY OUTPUT FILE WHEN INPUT HAS BEEN DONE ON THE ASSOCIATED TTY. IN PARTICULAR, THE TYI FUNCTION AND THE PRE-SCAN FUNCTION FOR READ BOTH UPDATE THINGS CORRECTLY. THE VARIOUS DDT TYPEOUT HACKS ALSO ARRANGE TO UPDATE THINGS CORRECTLY. [C] THE VARIABLES TYI AND TYO NOW COME INITIALIZED RESPECTIVELY TO THE INITIAL TTY INPUT AND OUTPUT FILE OBJECTS. T STILL WORKS AS AN ARGUMENT TO MOST I/O FUNCTIONS, BUT TO AVOID AMBIGUITIES USE THE OBJECTS IN TYI AND TYO. ALSO, SEVERAL PLACES IN NEWIO WHICH USED TO SUPPLY A T FOR A FILE OBJECT NOW SUPPLY THE TTY FILE OBJECT ITSELF, PARTICULARLY THE PLACE THAT SUPPLIES ARGUMENTS TO INTERRUPT FUNCTION. [D] NEWIO NOW UNDERSTANDS THAT IF THE VARIABLE READ IS NON-NIL IT IS A USER READ FUNCTION. THE LOAD FUNCTION, WHEN LOADING AN EXPR FILE, USES THIS USER READ FUNCTION ALSO. [E] MORE FOR DDT HACKERS: SINCE THE ^H BREAK WAS RENAMED THE ^B BREAK IN NEWIO, THE HH$X HACK IS CALLED BB$X IN NEWIO. [F] IF AN INPUT TTY IS OPEN IN 12-BIT MODE, THE DEFAULT READ PRE-SCAN FUNCTION TRIES TO THROW AWAY INTERRUPT CHARACTERS. THIS IS SO THAT TOP CHARACTERS CAN GO THROUGH AS ALPHABETICS, WITHOUT LETTING CONTROL CHARACTERS CONFUSE THE READER. IT HAS ALWAYS BEEN TRUE THAT IF A TTY INPUT INTERRUPT FUNCTION WAS REALLY A NUMBER, THEN IT MEANT THAT THE "INTERNAL" INTERRUPT ACTION SPECIFIED BY THAT NUMBER WAS TO BE TAKEN; FURTHERMORE, IF THE 200 OR 400 BIT WAS SET IN THE NUMBER, THE CTRL OR META BIT WAS REQUIRED TO BE PRESENT IN THE TYPED CHARACTER (THIS WAS SO THAT CTRL/G WOULD QUIT BUT "PI" WOULD NOT, FOR INSTANCE). A NEW TWIST IS THAT THE 200000000 AND 400000000 (200 AND 400 IN THE LEFT HALF) BITS REQUIRE THE ABSENCE OF THE CTRL AND META BITS IN THE TYPED CHARACTER FOR THE INTERRUPT ACTION TO TAKE PLACE. THUS, FOR EXAMPLE: (SSTATUS TTYINT 7 207) ;CTRL/G AND META/CTRL/G QUIT (SSTATUS TTYINT 7 607) ;ONLY META/CTRL/G QUITS (SSTATUS TTYINT 7 400000207) ;CTRL/G QUITS, BUT NOT META/CTRL/G (SSTATUS TTYINT 600000007) ;"PI" QUITS, BUT NOT CTRL/G OR META/CTRL/G [G] MAR INTERRUPT FEATURE AT LONG LAST, THE MAR BREAK IS AVAILABLE TO THE LISP USER! THIS IS A FEATURE WHICH DETECTS WHEN A GIVEN MEMORY LOCATION IS REFERENCED AND GIVES AN INTERRUPT. [F1] THE VARIABLE MAR-BREAK, IF NON-NIL, IS A USER INTERRUPT FUNCTION WHICH IS CALLED WHEN THE MAR BREAK IS FIRED. IT TAKES ONE ARGUMENT WHICH PRESENTLY IS ALWAYS NIL. [F2] (STATUS MAR) AND (SSTATUS MAR) TO "ARM" THE MAR BREAK, IT IS NECESSARY TO SAY (SSTATUS MAR N LOC) WHERE N CONTROLS WHEN THE MAR IS FIRED, AND LOC IS THE PLACE TO MONITOR. N MAY TAKE ON THE FOLLOWING VALUES: 0 TURN OFF THE MAR FEATURE 1 BREAK ON INSTRUCTION FETCH 2 BREAK ON WRITE 3 BREAK ON ALL REFERENCES ON THE KL-10, THESE ADDITIONAL VALUES ARE REPUTED TO WORK: 10 BREAK ON DATA READ 11 BREAK ON READ AND FETCH 12 BREAK ON READ AND WRITE, BUT NOT FETCH 13 BREAK ON FETCH AND WRITE, BUT NOT READ THE 4 BIT (EXEC VS. USER MODE) IS IGNORED (USER IS FORCED). LOC IS ANY S-EXPRESSION; THAT CELL IS THE ONE MONITORED. THUS (SETQ FOO (LIST 'A 'B)) (SSTATUS MAR 2 FOO) WILL TRIP THE MAR BREAK IF THE LIST CELL IN FOO IS EVER RPLACA'D OR RPLACD'D. AS AN EXAMPLE: (DEFUN MAR-TRACER (X) (TERPRI) (PRINC '|NOW THE VARIABLE |) (PRIN1 THE-MAR-VARIABLE) (PRINC '| HAS THE VALUE |) (PRIN1 (SYMEVAL THE-MAR-VARIABLE)) (SSTATUS MAR 2 (GET THE-MAR-VARIABLE 'VALUE))) (SETQ MAR-BREAK 'MAR-TRACER) (DEFUN MAR FEXPR (X) (SETQ THE-MAR-VARIABLE (CAR X)) ;; MAKE SURE THE VARIABLE HAS A VALUE CELL (COND ((NOT (BOUNDP THE-MAR-VARIABLE)) (SET THE-MAR-VARIABLE NIL))) (SSTATUS MAR 2 (GET THE-MAR-VARIABLE 'VALUE))) (DEFUN UNMAR () (SSTATUS MAR 0 NIL)) (MAR QUUX) (SETQ QUUX 5) NOW QUUX HAS THE VALUE 5 (DO ((QUUX 0 (+ QUUX 1))) ((= QUUX 2)) (HACK QUUX)) NOW QUUX HAS THE VALUE 0 NOW QUUX HAS THE VALUE 1 NOW QUUX HAS THE VALUE 2 NOW QUUX HAS THE VALUE 5 NIL (STATUS MAR) RETURNS A 2-LIST DESCRIBING THE CURRENT STATE OF THE MAR, OR NIL IF THE MAR IS NOT IN USE. NOTE THAT USING THE MAR FROM DDT WILL NOT CONFUSE LISP, AND LISP TRIES NOT TO CONFUSE DDT. IF LISP IS NOT USING THE MAR, THEN IT DOESN'T EVEN TAKE THE MAR INTERRUPT FROM ITS, AND SO DDT CAN TRAP IT. [F3] THE SUSPEND FUNCTION DOES ITS BEST TO SAVE AND RESTORE THE STATE OF THE MAR. [F4] WHEN A ^G FORCES A QUIT BACK TO TOP LEVEL, THE MAR BREAK IS DISABLED DURING THE UNBINDING OF VARIABLES, AND RE-ENABLED AFTERWARDS. THIS IS BECAUSE DURING A QUIT LISP IS NOT IN A GOOD STATE FOR RUNNING USER INTERRUPTS. [H] OTHER NEW USER INTERRUPTS [G1] TTY-RETURN, IF NON-NIL, IS A USER INTERRUPT FUNCTION WHICH IS RUN WHENEVER THE TTY IS GIVEN TO THE LISP JOB. (THIS IS DRIVEN BY THE %PIATY BIT IN ITS.) THIS IS USEFUL FOR TELLING LISP THAT SOME OTHER JOB MAY HAVE MESSED UP THE SCREEN DISPLAY. THE ARGUMENT TO THE FUNCTION IS PRESENTLY ALWAYS NIL. [G2] SYS-DEATH, IF NON-NIL, IS A USER INTERRUPT FUNCTION WHICH IS RUN WHENEVER THE STATE OF THE SYSTEM IS GOING DOWN, BEING REVIVED, OR BEGIN DEBUGGED. (THIS IS DRIVEN BY THE %PIDWN AND %PIDBG BITS IN ITS.) THE ARGUMENT TO THE FUNCTION IS PRESENTLY ALWAYS NIL. USEFUL IN CONJUNCTION WITH THIS INTERRUPT IS (STATUS ITS). THIS RETURNS A LIST OF FIVE NUMBERS: (1) THE TIME, IN SECONDS, UNTIL THE SYSTEM GOES DOWN, AS A FLONUM, -1.0 IF THE SYSTEM DOES NOT PLAN TO GO DOWN, OR -2.0 IF THE SYSTEM IS ALREADY DOWN. (2) A FIXNUM, NON-ZERO IF THE SYSTEM IS BEING DEBUGGED. (3) THE NUMBER OF USERS ON THE SYSTEM, AS A FIXNUM. (4) THE NUMBER OF MEMORY ERRORS THE SYSTEM HAS SURVIVED. (5) THE TIME IN SECONDS THE SYSTEM HAS BEEN UP, AS A FLONUM. THIS INFORMATION COMES FROM THE ITS "SSTATU" SYSTEM CALL. [G3] MACHINE-ERROR, IF NON-NIL, IS A USER INTERRUPT FUNCTION WHICH IS RUN WHENEVER A MEMORY PROTECTION VIOLATION, WRITE INTO READ-ONLY MEMORY, ILLEGAL OPERATION, OR PARITY ERROR OCCURS. THE FUNCTION RECEIVES TWO ARGUMENTS: THE FIRST IS THE PROGRAM COUNTER WHEN THE ERROR OCCURRED (NOT THE MEMORY LOCATION OF THE ERROR!), AND THE SECOND IS A SYMBOL DESCRIBING THE TYPE OF ERROR: EXAMINE ATTEMPT TO REFERENCE NON-EXISTENT MEMORY DEPOSIT WRITE INTO READ-ONLY MEMORY EVAL ILLEGAL OPERATION ODDP PARITY ERROR NOTE THAT THE LISP SYSTEM MAY INTERCEPT SOME OCCURRENCES OF THESE ERRORS, SINCE THEY CAN BE USED FOR VARIOUS SHARED-MEMORY HACKS. IF THE USER INTERRUPT FUNCTION EVER RETURNS, THE PROGRAM IS RESUMED AT THE PROGRAM COUNTER AS OF THE ERROR; THAT IS, THE ERRONEOUS OPERATION IS RETRIED. BEWARE OF LOOPS! IT IS EXPECTED THAT THE INTERRUPT FUNCTION WILL NORMALLY ERROR OUT. IF NO USER INTERRUPT FUNCTION IS SUPPLIED, LISP WILL BEHAVE AS IT ALWAYS HAS, AND ERROR OUT TO TOP LEVEL. THE NEXT FEATURE IS AVAILABLE IN ALL BIBOP LISPS, WHETHER OLDIO OR NEWIO. [4] HUNKS PACKAGE THE HUNKS PACKAGE PROVIDES LISP WITH A KIND OF "RECORD" OR "SMALL VECTOR" FEATURE. THE HUNK DATA TYPE INTERACTS SMOOTHLY WITH THE LIST DATA TYPE TO PROVIDE SOME INTERESTING CAPABILITIES. [5A] A NEW DATA TYPE IS INTRODUCED INTO LISP, THE "HUNK". HUNKS ARE SHORT VECTORS OF S-EXPRESSIONS. IN THE CURRENT IMPLEMENTATION THERE ARE ACTUALLY SEVERAL SPACES OF FOR HUNKS, VARIOUSLY CALLED HUNK4, HUNK8, HUNK16, ETC. THESE WILL BE EXPLAINED IN DETAIL BELOW. IN SOME CONTEXTS ORDINARY LIST CELLS ARE CONSIDERED TO BE HUNKS OF LENGTH 2. HUNKS ARE NOT CONSIDERED TO BE ATOMS; (ATOM H) RETURNS NIL FOR ANY HUNK H. [5B] (HUNKP X) IS A PREDICATE WHICH RETURNS T IFF X IS A HUNK. IN THIS CONTEXT A LIST CELL IS NOT CONSIDERED TO BE A HUNK. (CXR N H) RETURNS THE N'TH ELEMENT OF THE HUNK H. (CXR 0 H) IS EQUIVALENT TO (CAR H), AND (CXR 1 H) IS EQUIVALENT TO (CDR H); IN FACT, THE CAR AND CDR FUNCTIONS MAY BE USED ON HUNKS AS WELL AS ON LISTS. (RPLACX N H Z) REPLACES THE N'TH COMPONENT OF H WITH Z. THE VALUE OF RPLACX IS ITS (MODIFIED) SECOND ARGUMENT. THUS (RPLACX 0 H Z) IS EQUIVALENT TO (RPLACA H Z), AND (RPLACX 1 H Z) IS EQUIVALENT TO (RPLACD H Z). (HUNK N) CREATES A HUNK OF SIZE N AND RETURNS IT. (HUNK 0) RETURNS NIL, AND (HUNK 1) OR (HUNK 2) RETURNS A LIST CELL. ALL COMPONENTS ARE INITIALIZED TO NIL. THE COMPONENTS ARE NUMBERED FROM 0 TO N-1. (HUNKIFY A0 A2 ... AN-1) IS EQUIVALENT TO ((LAMBDA (H) (RPLACX 0 A0) ... (RPLACX N-1 AN-1)) (HUNK N)) THAT IS, IT CREATES A HUNK WHOSE COMPONENTS ARE THE ARGUMENTS TO HUNKIFY. NOTE THAT, AS FUNNY BOUNDARY CASES, (HUNKIFY) RETURNS NIL, AND (HUNKIFY X) IS THE SAME AS (NCONS X). (HUNKSIZE H) RETURNS THE NUMBER OF COMPONENTS IN THE HUNK H. HUNKSIZE OF A LIST CELL IS 2; HUNKSIZE OF NIL IS 0. [5C] EQUAL WILL COMPARE HUNKS BY DOING A RECURSIVE COMPONENT BY COMPONENT COMPARISON. SXHASH WILL COMPUTE THE HASH ON THE BASIS OF ALL COMPONENTS. [5D] HUNKS ARE PRINTED USING AN EXTENSION TO DOT NOTATION SUGGESTED BY RMS. SINCE LIST CELLS ARE CONSIDERED TO BE 2-HUNKS, AND ARE PRINTED AS (CAR . CDR), THE RESULT OF (HUNKIFY A0 A1 A2 +++ AN-2 AN-1) IS PRINTED AS (A0 . A2 . A3 . +++ . AN-2 . AN-1 . A1), WHERE "+++" IS USED AS AN ELLIPSIS TO AVOID CONFUSION WITH THE DOT NOTATION. THUS WE HAVE: (HUNKIFY 0) => (0) (HUNKIFY 0 1) => (0 . 1) (HUNKIFY 0 1 2) => (0 . 2 . 1) (HUNKIFY 0 1 2 3) => (0 . 2 . 3 . 1) THE REASON FOR THE STRANGE PLACEMENT OF A1 IS SO THAT THE CDR WILL BE LAST. THIS MAY SEEM RATHER KLUDGY, BUT ACTUALLY LENDS ITSELF TO CERTAIN ELEGANT EXTENSIONS. ONE IS A GENERAL EXTENSION OF THIS DOT NOTATION TO LIST NOTATION. AS AN EXAMPLE, CONSIDER: (A B . C . D E . F G H I . J . K) THIS IS HOW PRINT WOULD REPRESENT THE RESULT OF: (HUNKIFY 'A (HUNKIFY 'B (HUNKIFY 'E (HUNKIFY 'G (HUNKIFY 'H (HUNKIFY 'I 'K 'J))) 'F) 'C 'D)) THE BASIC IDEA IS THAT CONSECUTIVE ITEMS SEPARATED BY DOTS ALL BELONG TO THE SAME HUNK; ITEMS SEPARATED ONLY BY SPACES BELONG TO DIFFERENT HUNKS, AND THE SECOND HUNK IS THE CDR (I.E. THE (CXR 1)) OF THE FIRST HUNK. ANOTHER WAY TO THINK ABOUT IT IS TO REPLACE THE TWO PARENS BY SUPER-BRACKETS, AND THEN BETWEEN TWO ITEMS SEPARATED BY SPACE BUT NOT DOT INSERT ".(". NOTE THAT THE DEFINITION OF (HUNKIFY X) AS (NCONS X) CAUSES THE BOUNDARY CONDITION AT THE END OF THE LIST TO WIN. AS A SPECIAL CASE, IF THE CDR OF A HUNK (OTHER THAN A LIST CELL) IS NIL, THAT NIL MAY BE ELIDED (BUT THE PRECEDING DOT MAY NOT BE ELIDED!). THUS: (HUNKIFY 1 (HUNKIFY 2 NIL 3 4) 5) => (1 . 5 2 . 3 . 4 .) (HUNKIFY 'A (HUNKIFY 'B (HUNKIFY 'C NIL 'D) 'E) 'F) => (A . F B . E C . D .) MAYBE EVENTUALLY READ WILL KNOW HOW TO READ THESE IN. [5E] MOST OTHER FUNCTIONS WHICH OPERATE ON LIST STRUCTURE WILL TREAT HUNKS AS LIST CELLS, USING ONLY THE FIRST TWO POINTERS. (IN PARTICULAR, SUBST AND SUBLIS DO NOT PRESENTLY KNOW ANYTHING SPECIAL ABOUT HUNKS; HENCE (SUBST NIL NIL H) WILL NOT COPY A HUNK!) EVAL ALSO TREATS HUNKS AS LIST CELLS; THUS THE EXPRESSION (PLUS . FIXNUM . SIMP 1 2 3) EVALUATES TO 6, IGNORING "FIXNUM" AND "SIMP". IMAGINE THE POSSIBILITIES FOR HACKING! [5F] (STATUS FEATURE HUNK) IS NON-NIL IFF LISP HAS THE HUNK STUFF. [5G] (STATUS SPCNAMES) WILL INCLUDE THE NAMES OF ALL THE ACTUAL SPACES. IN THE CURRENT IMPLEMENTATION HUNKS HAVE SPACES FOR HUNKS OF VARIOUS POWERS OF TWO IN SIZE, NAMELY 4., 8., 16., ... UP TO SOME LIMIT (PROBABLY 16., THOUGH IT IS AN ASSEMBLY PARAMETER I CAN CHANGE IF ANYONE NEEDS IT). A HUNK OF 11. POINTERS IS MADE USING ONE OF 16. POINTERS AND MARKING 5. OF THEM AS UNUSED. IT IS PROBABLY NOT A GOOD IDEA TO DEPEND ON THIS IMPLEMENTATION, AS ONE CAN IMAGINE MORE HACKISH IMPLEMENTATIONS (BUDDY BLOCK, ETC.). [5H] (STATUS GCSIZE), (STATUS GCMAX), (ALLOC T), AND SIMILAR HACKS ALL KNOW ABOUT THE SPACE NAMES FOR HUNKS AS RETURNED BY (STATUS SPCNAMES). THIS LAST MESS IS IN NEWIO ONLY! [I] HUMBLE PACKAGE FOR HACKING INFERIOR JOBS ON ITS LIBLSP;HUMBLE FASL CONTAINS A COLLECTION OF PRIMITIVES FOR HACKING INFERIOR JOBS FROM LISP. SOME LESS PRIMITIVE PACKAGES WHICH USE HUMBLE ALSO EXIST; JLK IS A GOOD PERSON TO ASK. [I1] THE FOLLOWING SPECIAL VARIABLES ARE SACRED TO HUMBLE: CURRENT-JOB THE-JOB-INPUT-CHANNEL THE-JOB-OUTPUT-CHANNEL THE-JOB-INPUT-CHANNEL-FILE-OBJECT THE-JOB-OUTPUT-CHANNEL-FILE-OBJECT THE USER OF HUMBLE NEED CONCERN HIMSELF ONLY WITH CURRENT-JOB. IF NON-NIL, THIS IS THE JOB OBJECT FOR THE CURRENT JOB. HUMBLE USES TWO I/O CHANNELS, WHICH ARE USED TO SERVE THE CURRENT JOB. JOB OBJECTS ARE SIMILAR TO NEWIO FILE OBJECTS. THEIR FORMAT IS DOCUMENTED (AND SYMBOLS DEFINED) IN LISP;DEFNS >. HUMBLE AND LISP MAINTAIN INTERNALLY A TABLE OF JOB OBJECTS (KEPT AT LOCATION JOBTB). IF A JOB OBJECT IS EVER GARBAGE COLLECTED, GC PRINTS A MESSAGE AND .UCLOSE'S THE JOB. [I2] (CREATE-JOB <JOBINTFN> <CHNINTFN> <JNAME> <UNAME> <FOREIGN>) CREATES A JOB OBJECT, AND MAKES IT CURRENT. <JOBINTFN> AND <CHNINTFN> ARE THE INTERRUPT FUNCTIONS TO BE USED IF AN INTERRUPT IS RECEIVED ON THE INFERIOR OR ON THE I/O CHANNELS USED TO SERVICE INFERIORS, RESPECTIVELY. THEY RECEIVE ONE ARGUMENT, THE JOB OBJECT OR FILE OBJECT ASSOCIATED WITH THE INTERRUPT. <UNAME> AND <FOREIGN> ARE OPTIONAL ARGUMENTS. <UNAME> = NIL (DEFAULT) MEANS YOUR UNAME. <FOREIGN> = T (NON-DEFAULT) MEANS REQUIRE FOREIGN JOB. CREATE-JOB RETURNS A LIST OF TWO THINGS: (1) ONE OF THE FOLLOWING ATOMS: INFERIOR, REOWNED, FOREIGN (2) THE NEWLY CREATED JOB OBJECT IF <FOREIGN> WAS NON-NIL AND THE JOB WAS NOT FOUND, NIL IS RETURNED. [I3] (SELECT-JOB <JOB>) MAKES THE SPECIFIED JOB CURRENT IN THE EXPECTED MODE (FOREIGN OR NOT), RETURNING VALUES AS FOR CREATE-JOB. [I4] (KILL-JOB) KILLS THE CURRENT JOB. [I5] (LOAD-JOB <FILENAME>) OPENS UP FILE <FILENAME> (SPECIFIED AS A NEWIO NAMELIST OR NAMESTRING) AND LOADS IT INTO TH CURRENT JOB AS A BINARY PROGRAM (USES THE LOAD SYSTEM CALL). RETURNS: NIL WON! BIN? FILE NOT BIN FILE? FILE NOT FOUND [I6] (JOB-USET-READ <NUM>) RETURNS VALUE OF USET VAR <NUM>, OR NIL IF NO CURRENT JOB. (JOB-USET-WRITE <NUM> <VAL>) WRITES USET VAR <NUM>, THEN RETURNS T FOR SUCCESS OR NIL IF NO CURRENT JOB OR THE CURRENT JOB IS FOREIGN. <NUM> SHOULD HAVE THE 400000 BIT SET. [I7] (EXAMINE-JOB <LOC>) EXAMINES LOCATION <LOC> OF CURRENT JOB. RETURNS NIL ON FAILURE (INDICATES BAD ERROR). (DEPOSIT-JOB <LOC> <VAL>) DEPOSITS <VAL> IN <LOC> OF CURRENT JOB. RETURNS NIL ON FAILURE (INDICATES BAD ERROR). [I8] (*ATTY) DOES A .ATTY TO THE CURRENT JOB; (*DTTY) DOES A .DTTY. BOTH RETURN T FOR SUCCESS AND NIL FOR FAILURE. [I9] THERE EXIST PACKAGES OF MACROS AND HIGHER-LEVEL FUNCTIONS FOR HACKING INFERIOR JOBS. SEE JLK OR RZ FOR IDEAS.