Laboratory for Computer Science 545 Technology Square, Rm 834 March 8, 1980 Greetings to MACLISP lovers in the TOPS-10/TOPS-20 world: This note is arranged as a series of notices for TOPS-10/TOPS-20 users of maclisp, in a decreasing order of urgency, so read down as far as your interest holds out! A book on LISP is being published by Pat Winston and Nick Horn, to be available from Addison-Wesley; draft copie may be available from the authors, at the M.I.T Artificial Intelligence Lab, 545 Technology Square, Cambridge, MA 02139 (also, DARPA network address PHW@MIT-AI, or BKPH@MIT-AI, or telephone 617-254-6218). While not exactly a reference manual for maclisp, it is essentially maclisp oriented, with short reference appendices on INTERLISP and MACLISP. A "mini" maclisp manual, written in mosaic style by Dave Touretzky at Carnegie-Mellon, is being included with this mailing distribution; while not exactly a teaching document, it will prove to be most helpful to those who are already minimally acquainted with MACLISP. Quick *flash* for TOPS-20/TENEX users: The file SUBFORK has a function, SUBSYS, which permits doing general JSYS calls from LISP; in particular, (EXEC) gets you a recursive call to EXEC. An inferior-fork EMACS may now be used with maclisp, through an interface similar to the LEDIT one on ITS systems (it too uses SUBFORK). Johan DeKleer first brought up this facility on a TENEX at XEROX, and some extensions have been made to it by Bruce Roberts on a TOPS-20 at BBN; it is described a bit more near the end of this note. Some annoying bugs now fixed: OPEN - OPEN of the TTY device, OPEN in FIXNUM mode, and OPEN in APPEND (write-over) mode should all now work. LENGTHF - now returns correct value. (SSTATUS LINMODE 'T) - in this mode, read will use RDTTY and thus have regular twenex-system rubout processing. ALLOC - typing -A at the initial "Alloc?" will load your "LISP.INI" file. Remember also typing "?" gives help. TOPS-20/TENEX - the LISP.EXE file is now capable of running on either a TOPS-20 system, or a TENEX system, and decides upon startup which kind is supporting it; Job Symbol table - the symbol table provided by LINK is flushed upon initialization, so the core image is about 32.K smaller [use IDDT and the command ";O lisp.symbols" to regain symbols]. Bootstrapping from - there are four 1-block files whose names are like "xxxBOOT.EXE" - they should be placed on as "xxx.EXE"; they are "bootstrap loaders" which merely get the highest version number [or lowest version number in the case of "OxxxBOOT.EXE"] of the files LISP.EXE and COMPLR.EXE - the idea is that one can update the maclisp system without having to write on the directory; PPN properties - TOPS-20 users who cant allocate a directory "" may find the "software" LISP device of some use (see below under discussion of directory for autoload files and the PPN property.) Quick *flash* for TOPS-10/CMU users: A long-standing bug (since the inception of NEWIO for TOPS-10) has serendipitously been fixed, by which some LISP INIT files would fail upon the second buffer load, or by which an apparently random error "Address Check on Device ..." would bomb out to monitor. We are moving in the direction of letting "LISP:" be a standard software device to hold all the MACLISP software; TOPS-10 systems may still fall back on the ersatz device (LSP:); still, one may use a PPN property on a lisp SYMBOL to extend this notion further. The compiler now sets (SSTATUS LINMODE 'T). For TOPS-10 systems running on a KI or KL, you can now assemble LISP for placeing the hisegment well above the 400000 limit, and thus increase the amount of free storage, or binary-program space, available by 50% or more. Simply edit the LISP.MID source to set the symbol HSGORG to the higher address (e.g. "HSGORG==600000"). The TOPS-10 version can now run on a CMU operating system without modification (and vice-versa). Standard conventional notes accopanying a maclisp distribution note: -- Most of the code files are new, and only a few files remain the same from the time of summer of 1979. Fast, optimal STRINGs are now possible in pdp10 maclisp - see the first page of the STRING.LSP file for a listing of features/functions. A compatibility package for NIL (New-Implementation-of-Lisp) code is also included as NILAID (TOPS-20 users will have a NILAID.EXE file already on the tape - TOPS-10 users can make one up by running NILAID.INI as an "init" file). NILAID is a basically a maclisp loaded up with the NIL-compatibility functions, plus most other helpful functions from the out-of-core files - see NILAID.INI, and the first page of NILAID.LSP, to see which files are included in the dumped file NILAID.EXE. -- As in previous mailings, this tape has quite a number of different "save sets", dumped out by the DUMPER program (in INTERCHANGE format for those of you on TOPS-10 systems, compatible with BACKUP); they are put on in order of decreasing utility, most important first. Generally speaking, you will want to keep on disk all the files from the first two save sets (except the REL file), and on TOPS-10 systems, you will have to keep, momentarily, the fasl files for making up a compiler until you have SSAVEd a complr. For TOPS-20 systems, all files have been DUMPER'd from the directory, except the MIDAS and ATSIGN stuff, which come from a variety of directories: , , Files from the directory correspond to documentation files. -- The next file on this tape will be a listing, in a tape-dump command format, of all the files on the tape. Some of the support software may be new to you, but most of it is optional and included so that you may try it out. It would be a good idea to look at the first few pages or so of any source file with which you are unfamiliar, for we often place a lot of commentary there. -- The file on tape called LISP.NEWS is a collection of documentation updates, with the most recent on top; you might want to look at the most recent few pages to be sure that you are aware of recent changes to MACLISP. The file QIOORD.DOC is a machine-generated, alphabetized listing of all functions in MACLISP; the file NEWIO.DOC is an short, introductory description of how to use the I/O functions. Remember that a large amount of the NEWIO documentation appears in the LISP.NEWS file, entry dated "April 18, 1975". There is yet another movement afoot for various users to contribute to the waning MACLISP Manual Revision 1, chapters 1-3 of which are on this tape as the file LISP.DOC, but there is nothing in "hardcopy" yet. -- Using the LEDIT feature under TOPS-20/TENEX: The file LEDIT.:EJ is the compiled teco library file with the necessary subroutines. To get an inferior-fork EMACS from MACLISP, just load in LEDIT.FAS, and do (LEDIT). Then to facilitate returning code to your lisp, you should have the LEDIT libaray loaded into your emacs - most conveniently done in an EMACS init file, but at anytime loadable by a command like MMLoad LibraryLEDIT Below is the minimal documentation that DeKleer has produced for using the LEDIT interface - for more information, I suggest looking at the source files LEDIT.LSP, SUBFORK.LSP, and LEDIT.EMACS (which especially will help teco-lovers understand what the special LEDIT commands do). " The EMACS job is started as an inferior fork to the MACLISP job. The Lisp function LEDIT throws you into the lower fork, and creates one if it doesn't exist. LEDIT takes no arguments. It also presumes that the EMACS job contains the Lisp Library. Therefore you must either load it in your init file, or load it when it is first entered. The LISP library in the standard ITS implementation will peform adequately. Just type something random when it asks for a job name. [1] While editing in EMACS, you may copy the DEFUN you are working on to a temporary buffer (for loading into lisp when you exit) by the command meta-Z. There are two ways of exiting from the EMACS. [2] ^X^Z - control is returned but functions aren't returned to MACLISP (calls ^R Return to Superior) [3] ^XZ (or whererever you put ^R LEDIT Zap to LISP) . In this case, functions copied to the temporary buffer will be read into your maclisp, and uuolinks unsnapped if necessary. " You may also want to put into your init file a line or two like: M.M^R LEDIT Zap DEFUN to LISPu..Z which will make meta-Z do ^R LEDIT Zap DEFUN to LISP instead of merely "saving" the DEFUN into the *LEDIT* buffer. You could even change some of the default settings, say by: M.M^R LEDIT Zap to LISPu:.X() !* make ctl-X ctl-Z do ^R LEDIT Zap to LISP, like ctl-X Z! 1uLEDIT Save All Files Query !* make Save All Files Query User in LEDIT! -- Loading up a system: TOPS-20 users will find a LISP.EXE already on the tape. TOPS-10 friends (and any adventurous TOPS-20 hackers) will have to LINK up the LISP.REL file, and START it up once to initialize it; then you can SAVE it. Many FASL files must be in a place that the lisp system can find them during AUTOLOADing; generally we have assumed that these will be accessible as either LISP:foo.FAS or LSP:foo.FAS on TOPS-10 systems, (that is, through a software device "LISP:" or an ersatz device "LSP:"), and as DSK:foo.FASL on the TOPS-20 systems. For TOPS-10 users, if you do not have either "soft" device, you may try responding to the post-initialization question, or if all else fails, you may put a PPN property on the symbol "LISP" after starting to run (see 1 and 3 below). Currently the TOPS-20 version requires these files to be on PS: even though there is a PPN translation for a "soft" LISP: device. Each system permits a measure of "soft" device definitions via the PPN property. A reminder: source file have the extensions MID for midas; LSP and INI for lisp; NOTE, DOC, NEWS, and etc. for text commentary; REL for output of midas (and loadable by TOPS-10/TOPS-20 linkers); FASL for output of the lisp compiler, and loadable by the lisp functions LOAD or FASLOAD. TOPS-10 world: 1) There are no SHR or LOW files on the tape, so you will have to LINK up the LISP.REL yourself; if you load with the "/D" switch (DDT), then you will have to do a command "/SET:.LOW.:005140" in order to insure that the low segment part of lisp begins on a correct part of a page boundary. After linking up the LISP.REL, you must start up the job once, to let it "initialize" itself; then it is ready for SSAVEing (or merely SAVEing). The initializer will ask you "What is the PPN of the area with the autoload files?" to which you should reply with a PPN to be used in lieu of a "LISP:" device (or, with the PPN of the area taken as the "LISP:" device). All autoload files mentioned above must be on this area. Also, you will have to run the lisp with the "lisp init" file CCLOAD.INI in order to make up a compiler, e.g. say RUN LISP;CCLOAD.INI or if the lisp save files are on another directory, RUN LISP[33151,264265];CCLOAD.INI Normally, all the compiler's files should be on one directory, the one to which you are connected. If for some reason, the "init file" facility does not work, you can simply get a lisp and allocate BPS (binary program space) to "14000.", and then do (LOAD '(CCLOAD INI)) The rest of the loading should be automatic, and it will as you to to SSAVE (or SAVE) the image. In a COMPLR, typing control-G at the command line parset (MAKLAP) should return you to LISP top level; typing control-E at any time should return to MAKLAP. 2) If you expect to "suspend", or dump out a lisp job which you obtained by the "RUN" command, and which you started up with a "lisp init" file, then be sure to use a command line like .run LISP[proj,prog];myfile.ini rather than something like .run LISP;myfile.ini since this latter format fails to declare the location of the hiseg to the running lisp. Without knowing where the hiseg came from, lisp cannot flush it before suspending. 3) If a symbol has a PPN property, then the NAMELIST routines accept it as an abbreviation for typing in the list of Device and Project-number/ Programmer number. Thus (DEFPROP MYNAME (DSK (33124 11272)) PPN) enables using newio forms like (OPEN '((DSK MYNAME) RUNIT FAS)), (MERGEF '((MYNAME) * FAS) DEFAULTF) rather than the more cumbersome use of the list of two numbers. TOPS-20 world: 1) The "LISP.INI" file facility is not generalized yet, in order to allow you to type in random file specifications. If you should want, for example, to make up a compiler, just load up a LISP with default allocations (since only the PDL allocations are important in a paged-implemntation) and do (LOAD '(CCLOAD INI)), or (LOAD '|CCLOAD.INI|) [or (LOAD '((PS MACLISP) CCLOAD INI)) if the files are not on your connected directory]. The rest of the loading is automatic, and when done, it will return to EXEC with a comment about dumping the file out by SAVEing it. For loading up LISP.REL, see the first part of the note directed to the TOPS-10 world. 2) In a COMPLR, typing control-G at anytime should return to LISP top level; typing control-E should return to the compiler's command line parser (variously called MAKLAP). The COMPLR normally starts out in (SSTATUS LINMODE 'T) mode, so if you type ^G to enter a LISP toplevel loop, or ^B for a break loop, you will still be in line mode. 3) File names are in general three components, the third being th generation number; but standard old file names will work in general. Try to stick to NEWIO format, e.g. (UREAD (PS MUMBLE) MY FILE) and (UREAD (PS MUMBLE) MY FILE /3) rather than (UREAD MY FILE . . .). Generation numbers may be either fixnums or symbols consisting only of digits; generally, file names with omitted generation numbers will supply the null symbol, ||, which specifies the highest generation number for that filename.ext. As with the TOPS-10 version, if a symbol has a PPN property, then the various NAMELIST routines accept it as if it were a software device, and from the retrieved property, they try the device-decoding loop again. For example, (DEFPROP NSYS (PS NEWSYS) PPN) and (DEFPROP PRIVATE (SS BAZ) PPN) enables using newio forms like (OPEN '((NSYS) RUNIT FAS)) (PROBEF '((PRIVATE) LOSSAGE *)) rather than the more cumbersome form (OPEN '((PS NEWSYS) RUNIT FAS)) (PROBEF '((SS BAZ) LOSSAGE *)) 4) There may be a bugs in the newio stuff. Have forebearance! 5) doesn't work!! This conflicts the X-on, X-off protocol for terminals. [so if you like to do UREAD followed by -Q, then either learn to use LOAD instead, or do UREAD followed by (SETQ ^Q 'T) - yes, that is ]. Furthermore, (SSTATUS TTYINT ...) doesn't really make any other characters as interrupts except the following ones, namely: Control-letter Action in initial LISP -A Sets "^A" to "T" -B Runs a "break" look -D Sets "^D" to "T" (for GC statistics) -E (unassigned) -F (unassigned) -G Quit -V Sets "^W" to null (i.e., restor TTY printing) -W Stop normal print output to TTY ("^W" switch) -X Generate a software error -Z Retrun to monitor (DDT, or EXEC) 6) You can put the file MACLISPBOOT.EXE on your SYS: device as MACLISP.EXE, and it will "bootstrap" load in the file LISP.EXE.0 Similarly, COMPLRBOOT can be used to bootstrap load in COMPLR.EXE.0 To smooth over the transition from one version of maclisp to the next, you should move the file OMACLISPBOOT.EXE to SYS:OMACLISP.EXE, and it will "bootstrap" load in the file LISP.EXE.-2 (generally the previous version). Similarly the file OCOMPLRBOOT.EXE loads in COMPLR.EXE.-2 Best wishes for happy hacking with MACLISP -- JonL White --