17 lines
9.4 KiB
HTML
17 lines
9.4 KiB
HTML
<!DOCTYPE html PUBLIC ""
|
||
"">
|
||
<html><head><meta charset="UTF-8" /><title>beowulf.interop documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><link rel="icon" type="image/x-icon" href="../img/beowulf_logo_favicon.png" /></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.1-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 current"><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"><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><li class="depth-2"><a href="beowulf.scratch.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>scratch</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.interop.html#var-INTEROP"><div class="inner"><span>INTEROP</span></div></a></li><li class="depth-1"><a href="beowulf.interop.html#var-interpret-qualified-name"><div class="inner"><span>interpret-qualified-name</span></div></a></li><li class="depth-1"><a href="beowulf.interop.html#var-listify-qualified-name"><div class="inner"><span>listify-qualified-name</span></div></a></li><li class="depth-1"><a href="beowulf.interop.html#var-to-beowulf"><div class="inner"><span>to-beowulf</span></div></a></li><li class="depth-1"><a href="beowulf.interop.html#var-to-clojure"><div class="inner"><span>to-clojure</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">beowulf.interop</h1><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||
</div></div><div class="public anchor" id="var-INTEROP"><h3>INTEROP</h3><div class="usage"><code>(INTEROP fn-symbol args)</code></div><div class="doc"><div class="markdown"><p>Clojure (or other host environment) interoperation API. <code>fn-symbol</code> is expected to be either</p>
|
||
<ol>
|
||
<li>a symbol bound in the host environment to a function; or</li>
|
||
<li>a sequence (list) of symbols forming a qualified path name bound to a function.</li>
|
||
</ol>
|
||
<p>Lower case characters cannot normally be represented in Lisp 1.5, so both the upper case and lower case variants of <code>fn-symbol</code> will be tried. If the function you’re looking for has a mixed case name, that is not currently accessible.</p>
|
||
<p><code>args</code> is expected to be a Lisp 1.5 list of arguments to be passed to that function. Return value must be something acceptable to Lisp 1.5, so either a symbol, a number, or a Lisp 1.5 list.</p>
|
||
<p>If <code>fn-symbol</code> is not found (even when cast to lower case), or is not a function, or the value returned cannot be represented in Lisp 1.5, an exception is thrown with <code>:cause</code> bound to <code>:interop</code> and <code>:detail</code> set to a value representing the actual problem.</p>
|
||
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/interop.clj#L65">view source</a></div></div><div class="public anchor" id="var-interpret-qualified-name"><h3>interpret-qualified-name</h3><div class="usage"><code>(interpret-qualified-name l)</code></div><div class="doc"><div class="markdown"><p>For interoperation with Clojure, it will often be necessary to pass qualified names that are not representable in Lisp 1.5. This function takes a sequence in the form <code>(PART PART PART... NAME)</code> and returns a symbol in the form <code>part.part.part/NAME</code>. This symbol will then be tried in both that form and lower-cased. Names with hyphens or underscores cannot be represented with this scheme.</p>
|
||
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/interop.clj#L26">view source</a></div></div><div class="public anchor" id="var-listify-qualified-name"><h3>listify-qualified-name</h3><div class="usage"><code>(listify-qualified-name subr)</code></div><div class="doc"><div class="markdown"><p>We need to be able to print something we can link to the particular Clojure function <code>subr</code> in a form in which Lisp 1.5 is able to read it back in and relink it.</p>
|
||
<p>This assumes <code>subr</code> is either 1. a string in the format <code>#'beowulf.io/SYSIN</code> or <code>beowulf.io/SYSIN</code>; or 2. something which, when coerced to a string with <code>str</code>, will have such a format.</p>
|
||
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/interop.clj#L10">view source</a></div></div><div class="public anchor" id="var-to-beowulf"><h3>to-beowulf</h3><div class="usage"><code>(to-beowulf o)</code></div><div class="doc"><div class="markdown"><p>Return a beowulf-native representation of the Clojure object <code>o</code>. Numbers and symbols are unaffected. Collections have to be converted; strings must be converted to symbols.</p>
|
||
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/interop.clj#L43">view source</a></div></div><div class="public anchor" id="var-to-clojure"><h3>to-clojure</h3><div class="usage"><code>(to-clojure l)</code></div><div class="doc"><div class="markdown"><p>If l is a <code>beowulf.cons_cell.ConsCell</code>, return a Clojure list having the same members in the same order.</p>
|
||
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/interop.clj#L53">view source</a></div></div></div></body></html> |