beowulf/docs/codox/beowulf.io.html

13 lines
9.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>beowulf.io documentation</title><link rel="icon" type="image/x-icon" href="../img/beowulf_logo_favicon.png" /><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Beowulf</span> <span class="project-version">0.3.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="further_reading.html"><div class="inner"><span>Further Reading</span></div></a></li><li class="depth-1 "><a href="intro.html"><div class="inner"><span>beowulf</span></div></a></li><li class="depth-1 "><a href="mexpr.html"><div class="inner"><span>Interpreting M-Expressions</span></div></a></li><li class="depth-1 "><a href="values.html"><div class="inner"><span>The properties of the system, and their values</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>beowulf</span></div></div></li><li class="depth-2 branch"><a href="beowulf.bootstrap.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bootstrap</span></div></a></li><li class="depth-2 branch"><a href="beowulf.cons-cell.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cons-cell</span></div></a></li><li class="depth-2 branch"><a href="beowulf.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="beowulf.gendoc.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>gendoc</span></div></a></li><li class="depth-2 branch"><a href="beowulf.host.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>host</span></div></a></li><li class="depth-2 branch"><a href="beowulf.interop.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>interop</span></div></a></li><li class="depth-2 branch current"><a href="beowulf.io.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>io</span></div></a></li><li class="depth-2 branch"><a href="beowulf.manual.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>manual</span></div></a></li><li class="depth-2 branch"><a href="beowulf.oblist.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>oblist</span></div></a></li><li class="depth-2 branch"><a href="beowulf.read.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>read</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>reader</span></div></div></li><li class="depth-3 branch"><a href="beowulf.reader.char-reader.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>char-reader</span></div></a></li><li class="depth-3 branch"><a href="beowulf.reader.generate.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>generate</span></div></a></li><li class="depth-3 branch"><a href="beowulf.reader.macros.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>macros</span></div></a></li><li class="depth-3 branch"><a href="beowulf.reader.parser.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>parser</span></div></a></li><li class="depth-3"><a href="beowulf.reader.simplify.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>simplify</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="beowulf.io.html#var-default-sysout"><div class="inner"><span>default-sysout</span></div></a></li><li class="depth-1"><a href="beowulf.io.html#var-resolve-subr"><div class="inner"><span>resolve-subr</span></div></a></li><li class="depth-1"><a href="beowulf.io.html#var-safely-wrap-subr"><div class="inner"><span>safely-wrap-subr</span></div></a></li><li class="depth-1"><a href="beowulf.io.html#var-safely-wrap-subrs"><div class="inner"><span>safely-wrap-subrs</span></div></a></li><li class="depth-1"><a href="beowulf.io.html#var-SYSIN"><div class="inner"><span>SYSIN</span></div></a></li><li class="depth-1"><a href="beowulf.io.html#var-SYSOUT"><div class="inner"><span>SYSOUT</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">beowulf.io</h1><div class="doc"><div class="markdown"><p>Non-standard extensions to Lisp 1.5 to read and write to the filesystem.</p>
<p>Lisp 1.5 had only <code>READ</code>, which read one S-Expression at a time, and various forms of <code>PRIN*</code> functions, which printed to the line printer. There was also <code>PUNCH</code>, which wrote to a card punch. It does not seem that there was any concept of an interactive terminal.</p>
<p>See Appendix E, <code>OVERLORD - THE MONITOR</code>, and Appendix F, <code>LISP INPUT
AND OUTPUT</code>.</p>
<p>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.</p>
<p>Hence functions SYSOUT and SYSIN, which do just that.</p></div></div><div class="public anchor" id="var-default-sysout"><h3>default-sysout</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/io.clj#L49">view source</a></div></div><div class="public anchor" id="var-resolve-subr"><h3>resolve-subr</h3><div class="usage"><code>(resolve-subr entry)</code></div><div class="doc"><div class="markdown"><p>If this oblist <code>entry</code> references a subroutine, attempt to fix up that reference.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/io.clj#L108">view source</a></div></div><div class="public anchor" id="var-safely-wrap-subr"><h3>safely-wrap-subr</h3><div class="usage"><code>(safely-wrap-subr entry)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/io.clj#L69">view source</a></div></div><div class="public anchor" id="var-safely-wrap-subrs"><h3>safely-wrap-subrs</h3><div class="usage"><code>(safely-wrap-subrs objects)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/io.clj#L80">view source</a></div></div><div class="public anchor" id="var-SYSIN"><h3>SYSIN</h3><div class="usage"><code>(SYSIN)</code><code>(SYSIN filename)</code></div><div class="doc"><div class="markdown"><p>Read the contents of the file at this <code>filename</code> into the object list. </p>
<p>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.</p>
<p>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.</p>
<p><strong>NOTE THAT</strong> if the provided <code>filename</code> does not end with <code>.lsp</code> (which, if youre writing it from the Lisp REPL, it wont), the extension <code>.lsp</code> will be appended.</p>
<p><strong>NOTE THAT</strong> this is an extension function, not available in strct mode.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/io.clj#L137">view source</a></div></div><div class="public anchor" id="var-SYSOUT"><h3>SYSOUT</h3><div class="usage"><code>(SYSOUT)</code><code>(SYSOUT filepath)</code></div><div class="doc"><div class="markdown"><p>Dump the current content of the object list to file. If no <code>filepath</code> is specified, a file name will be constructed of the symbol <code>Sysout</code> and the current date. File paths will be considered relative to the filepath set when starting Lisp.</p>
<p><strong>NOTE THAT</strong> this is an extension function, not available in strct mode.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/io.clj#L84">view source</a></div></div></div></body></html>