MONDAY  MAY 16,1977  LQ+6D.8H.0M.26S.   LISP 1272   - GLS -

I BELIEVE THAT I HAVE FINALLY KILLED THE GC BUG THAT WAS
CAUSING THE TOPS-10 IMPLEMENTATION TO GET MPV ON STARTUP.
NUMEROUS OTHER BUGS HAVE BEEN KILLED ALSO.

AS ALWAYS, NUMBERED ITEMS ARE FOR ALL LISPS, AND LETTERED
ONES FOR NEWIO ONLY.  THE OTHERS ARE IN NON-STANDARD CATEGORIES.

[1] THE VALUE OF HUNKP CONTROLS PRINT, PURCOPY, AND EQUAL
[2] PURE HUNKS EXIST (PURCOPY WILL WIN ON HUNKS)
[3] NEW PREDICATE: SYMBOLP
[4] CHANGES TO RANDOM; ALSO ([S]STATUS RANDOM).
[5] WARNING ABOUT MOST NEGATIVE NUMBER (THE "SETZ" PROBLEM)
[6] +, +$, AND THE LIKE NEVER DETECT OVERFLOW OR UNDERFLOW
[7] FLONUM OUTPUT HAS BEEN IMPROVED
[8] SQRT HAS BEEN IMPROVED
[9] VALUE OF FASLOAD IS NOW THE FUNCTION PROPERTIES TO CHECK

[A] NEW FUNCTION: FILEP
[B] FOR INFERIOR JOB HACKERS: JOBS CAN HAVE "PROPERTY LISTS"
[C] ASCII MODE I/O TO AND FROM INFERIORS IS PRESENTLY BROKEN

[&] THE NEW FUNCTION LH| PERFORMS A COMPLETELY WEIRD CROCK FOR LH

[;] THE SEGMENT TABLE BITS $FXP AND $FLP HAVE BEEN CHANGED
----------------------------------------------------------------
[1] THE VARIABLE HUNKP (INITIALLY T), IF NIL, CAUSES THE FUNCTIONS
    PRINT, EQUAL, AND PURCOPY TO TREAT HUNKS AS LISTS (AS MOST
    OTHER SYSTEM FUNCTIONS DO).  IF NON-NIL, THEN THESE THREE
    FUNCTIONS WILL TREAT THE HUNNKS AS HUNKS; IN PARTICULAR,
    EQUAL WILL COMPARE THE HUNKS ELEMENT-BY-ELEMENT.

[2] PURE HUNKS EXIST (PURCOPY WILL WIN ON HUNKS).  THIS JUST FILLS
    IN A TRIVIAL HOLE THAT I DIDN'T GET AROUND TO IMPLEMENTING
    EARLIER.  (STATUS PURSPCNAMES) WILL REFLECT THE PRESENCE
    OF THIS FEATURE.

[3] (SYMBOLP X) IS NON-NIL IFF X IS AN ATOMIC SYMBOL.
    THIS CATEGORY INCLUDES NIL; THAT IS, (SYMBOLP 'NIL) => T.

[4] THE RANDOM FUNCTION NOW HAS BETTER BEHAVIOR.  THE TWO-ARGUMENT
    FORM HAS BEEN ELIMINATED (WHICH USED TO INITIALIZE THE GENERATOR),
    SINCE THE STATE CANNOT BE CONTAINED IN TWO FIXNUMS ANY MORE.
    A NEW STATUS FUNCTION EXISTS FOR THIS PURPOSE.
    (STATUS RANDOM) RETURNS A LIST WHICH SUMMARIZES THE STATE
    OF THE RANDOM NUMBER GENERATOR.  NO GUARANTEES ARE MADE AS TO
    ITS FORMAT, EXCEPT THAT IT MAY BE FED AS AN ARGUMENT X TO
    (SSTATUS RANDOM X), WHICH WILL RESTORE THE GENERATOR TO THAT
    FROZEN STATE.  (SSTATUS RANDOM N) FOR ANY FIXNUM N IS ALSO
    PERMISSIBLE; THIS WILL INITIALIZE THE GENERATOR IN A WAY THAT
    DEPENDS IN AN UNSPECIFIED WAY ON N.  (THIS IS SO THAT PEOPLE
    CAN DO, FOR EXAMPLE, (SSTATUS RANDOM (TIME)) OR SOMETHING.)

[5] THE PDP-10 HARDWARE (BOTH KA10 AND KL10) HAS A WEIRD GLITCH TO
    THE EFFECT THAT IT FAILS TO DIVIDE THE MOST NEGATIVE FIXNUM
    (-400000000000) BY 1 CORRECTLY, EVEN THOUGH THE RESULTS ARE
    WELL-DEFINED AND REPRESENTABLE.   THE GENERIC FUNCTIONS
    (QUOTIENT, *QUO, REMAINDER) HAVE BEEN FIXED TO COMPENSATE FOR
    THIS PROBLEM; THEY ARE CONCEPTUALLY "GUARANTEED" TO RETURN
    CORRECT ANSWERS INDEPENDENT OF SUCH HARDWARE LOSSES.  HOWEVER,
    THERE IS NO EFFECTIVE WAY TO FIX THE FIXNUM-ONLY FUNCTIONS
    (//, \); SUCH FUNCTIONS ARE PERMITTED TO HAVE THE CHARACTERISTICS
    IMPOSED BY THE HOST HARDWARE (THUS ON MULTICS // MAY HAVE
    OTHER PECULIARITIES, FOR ALL I KNOW).  THIS IS BECAUSE THESE
    FUNCTIONS ARE INTENDED TO BE OPEN-CODED AS SINGLE HOST HARDWARE
    INSTRUCTIONS.  BEWARE!

[6] THE FIXNUM- AND FLONUM-ONLY ARITHMETIC FUNCTIONS ARE NOW
    *DEFINED* TO DO "WHAT THE HARDWARE DOES".  THE INTERPRETED
    VERSIONS USED TO DETECT OVERFLOW AND UNDERFLOW, BUT NO MORE.
    THUS YOU CAN USE + TO COMPUTE STRANGE CHECKSUMS, ETC.
    IN ANY CASE, COMPILED AND INTERPRETED CODE SHOULD BE COMPATIBLE
    WITH RESPECT TO THESE FUNCTIONS.  ANY PECULIAR SCREWS IN THE
    HARDWARE ARE NOT COMPENSATED FOR (SEE [5] ABOVE).  THE GENERIC
    ARITHMETIC FUNCTIONS ARE "GUARANTEED" TO BEHAVE "MATHEMATICALLY"
    AND TO COMPENSATE AS NECESSARY FOR SUCH SCREWS.

[7] AN IMPROVED FLONUM PRINT ALGORITHM HAS BEEN INSTALLED.
    I (GLS) HAVE "PROVED" THAT IT HAS THESE PROPERTIES:
    (1) IT OUTPUTS ENOUGH DIGITS THAT NO INFORMATION IS LOST
	(A PERFECT READER, WHICH I DO NOT YET CLAIM LISP HAS,
	CAN ALWAYS RECOVER THE ORIGINAL FLONUM BY ROUNDING).
    (2) IT OUTPUTS NO MORE DIGITS THAN NECESSARY TO ACHIEVE (1).
    (3) IT OUTPUTS THE BEST POSSIBLE DECIMAL FLONUM OF THE
	NUMBER OF DIGITS IN (2).

[8] THANKS TO AN ALGORITHM FROM KAHAN AND HELP FROM RJF (FATEMAN),
    THE SQRT ROUTINE HAS BEEN IMPROVED.  IT IS CONSIDERABLY FASTER.

[9] THE VALUE OF FASLOAD IS NOW THE LIST OF PROPERTIES FASLOAD SHOULD
    CHECK FOR TO DECIDE WHETHER TO PRINT A WARNING MESSAGE.  ITS
    INITIAL VALUE IS (SUBR FSUBR LSUBR), AND SO WILL HAVE THE SAME EFFECT
    AS BEFORE, WHEN THE INITIAL VALUE WAS T.  ALSO AS BEFORE, SETTING FASLOAD
    TO NIL WILL SUPPRESS ALL SUCH ERROR MESSAGES.  ONE CAN BE VERY PARANOID,
    FOR EXAMPLE, AND SET IT TO (EXPR SUBR LSRUB FEXPR FSUBR ARRAY MACRO).

[A] THE PREDICATE FILEP RETURNS T IFF ITS ARGUMENT IS A FILE OBJECT.
    IT WILL RETURN T EVEN IF IT IS A CLOSED FILE; TO DETECT AN OPEN
    FILE, USE (AND (FILEP X) (STATUS FILEMODE X)).

[B] INFERIOR JOB OBJECTS NOW HAVE AN EXTRA SLOT J.CRUFT
    WHICH IS GC-PROTECTED.  SEE SYS:.FASL DEFS FOR THE
    JOB OBJECT DEFINITIONS.  BY CONVENTION, THIS NEW SLOT
    IS USED TO HOLD A PROPERTY LIST FOR VARIOUS DATA ABOUT
    THE JOB.

[C] BECAUSE OF AN ITS DEFICIENCY, THE NEW CODE THAT ALLOWS FILEPOS
    TO WORK ON OUTPUT FILES AND SIOT TO BE USED FOR ALL ASCII I/O
    DOESN'T WORK ON THE USR DEVICE (INFERIOR JOBS).  THE BASIC
    PROBLEM IS THAT SIOT DOESN'T WORK ON THE USR DEVICE IN ITS.
    ONE CONSEQUENCE IS THAT LISPT WILL NOT WORK ON ITS 1051 AND ABOVE
    (FOR WHICH THE NEW SIOT I/O CODE WILL BE PROVIDED IN LISP).

[&] THE FUNCTION LH| IS A HACK FOR THE BENEFIT OF THIRD-FLOOR
    HACKERS.  IT NORMALLY EXISTS ONLY IN THE ITS VERSION.
    THIS FEATURE IS ONLY SEMI-OFFICIAL, AND I WON'T GUARANTEE
    IT TO WORK FOR ANYONE BUT LH AND FRIENDS.
    (LH| <SIZE> <SPACE>) ALLOCATES A CHUNK OF MEMORY <SIZE>
    WORDS BIG OF DATA TYPE <SPACE>.  (ACTUALLY, <SIZE> IS
    ROUNDED UP TO BE AN INTEGRAL NUMBER OF PAGES.)
    THE RETURNED VALUE IS A FIXNUM WHICH IS THE ADDRESS OF
    THE FIRST WORD OF THE CHUNK OF MEMORY.  IF ZERO IS RETURNED,
    IT WAS NOT POSSIBLE TO OBTAIN THE MEMORY.  (THIS SHOULD
    BE FAMILIAR TO GETCOR HACKERS!)  ONE SHOULD **NOT** USE
    (DECLARE (FIXNUM (LH/|))); IT IS NOT A NUMBER FUNCTION
    JUST BECAUSE IT RETURNS A FIXNUM!  NOTICE THAT ONE MUST USE
    A "/" TO GET THE "|" IN THE NAME OF THE FUNCTION.
    THE CHUNK OF MEMORY WILL BE MADE TO HAVE THE DATA TYPE
    INDICATED BY <SPACE>; ONE CAN ALLOCATE THE MEMORY AT WILL
    AND CREATE POINTERS INTO IT.  GC WILL MARK FROM ALL WORDS
    IN THE SPACE IF <SPACE> IS LIST, BIGNUM, OR ANY KIND OF HUNK.
    HOWEVER, THE DATA IN THE MEMORY ITSELF IS NOT MARKED OR SWEPT.
    NO GUARANTEES ARE MADE IF <SPACE> IS "SYMBOL" OR "ARRAY";
    ALL OTHER DATA TYPES SHOULD WORK, HOWEVER.

[;] FOR ANY .FASL CODE HACKERS WHO MAY CARE: THE BITS $FXP AND
    $FLP IN SEGMENT TABLE ENRTIES HAVE DISAPPEARED.  THE BIT
    THAT USED TO BE $FXP IS NOW CALLED $PDLNM, AND $FLP IS NO
    LONGER USED.  PDL NUMBER SEGMENTS NOW HAVE FX+$PDLNM OR
    FL+$PDLNM SET INSTEAD OF $FXP OR $FLP.  (THIS IS TO ALLOW
    INTRODUCTION OF OTHER NUMBER PDLS IN THE FUTURE IF DESIRED.)
    THIS CHANGE IS UPWARD-COMPATIBLE FOR COMPILED CODE WHICH
    OPEN-CODES TYPE TESTS; EVENTUALLY THE COMPILER WILL BE
    CHANGED TO REFLECT THE NEW BITS.