beowulf.io
Non-standard extensions to Lisp 1.5 to read and write to the filesystem.
Lisp 1.5 had only READ
, which read one S-Expression at a time, and various forms of PRIN*
functions, which printed to the line printer. There was also PUNCH
, which wrote to a card punch. It does not seem that there was any concept of an interactive terminal.
See Appendix E, OVERLORD - THE MONITOR
, and Appendix F, LISP INPUT AND OUTPUT
.
For our purposes, to save the current state of the Lisp system it should be sufficient to print the current contents of the oblist to file; and to restore a previous state from file, to overwrite the contents of the oblist with data from that file.
Hence functions SYSOUT and SYSIN, which do just that.
resolve-subr
(resolve-subr entry)
(resolve-subr entry prop)
If this oblist entry
references a subroutine, attempt to fix up that reference.
SYSIN
(SYSIN)
(SYSIN filename)
Read the contents of the file at this filename
into the object list.
If the file is not a valid Beowulf sysout file, this will probably corrupt the system, you have been warned. File paths will be considered relative to the filepath set when starting Lisp.
It is intended that sysout files can be read both from resources within the jar file, and from the file system. If a named file exists in both the file system and the resources, the file system will be preferred.
NOTE THAT if the provided filename
does not end with .lsp
(which, if you’re writing it from the Lisp REPL, it won’t), the extension .lsp
will be appended.
NOTE THAT this is an extension function, not available in strct mode.
SYSOUT
(SYSOUT)
(SYSOUT filepath)
Dump the current content of the object list to file. If no filepath
is specified, a file name will be constructed of the symbol Sysout
and the current date. File paths will be considered relative to the filepath set when starting Lisp.
NOTE THAT this is an extension function, not available in strct mode.