picrin-website/www/lang.html

392 lines
15 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Language &#8212; Picrin 0.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/classic.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Standard Libraries" href="libs.html" />
<link rel="prev" title="Installation" href="deploy.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="libs.html" title="Standard Libraries"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="deploy.html" title="Installation"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">Picrin 0.1 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Language</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="language">
<h1>Language<a class="headerlink" href="#language" title="Permalink to this heading"></a></h1>
<p>Picrins core language is the R7RS scheme with some powerful extensions. Please visit <a class="reference external" href="http://r7rs.org/">http://r7rs.org/</a> for the information of R7RSs design and underlying thoughts.</p>
<section id="the-repl">
<h2>The REPL<a class="headerlink" href="#the-repl" title="Permalink to this heading"></a></h2>
<p>At the REPL start-up time, some usuful built-in libraries listed below will be automatically imported.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">(scheme</span> <span class="pre">base)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">(scheme</span> <span class="pre">load)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">(scheme</span> <span class="pre">process-context)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">(scheme</span> <span class="pre">write)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">(scheme</span> <span class="pre">file)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">(scheme</span> <span class="pre">inexact)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">(scheme</span> <span class="pre">cxr)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">(scheme</span> <span class="pre">lazy)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">(scheme</span> <span class="pre">time)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">(scheme</span> <span class="pre">case-lambda)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">(scheme</span> <span class="pre">read)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">(scheme</span> <span class="pre">eval)</span></code></p></li>
</ul>
</section>
<section id="compliance-with-r7rs">
<h2>Compliance with R7RS<a class="headerlink" href="#compliance-with-r7rs" title="Permalink to this heading"></a></h2>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>section</p></th>
<th class="head"><p>status</p></th>
<th class="head"><p>comments</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>2.2 Whitespace and comments</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>2.3 Other notations</p></td>
<td><p>incomplete</p></td>
<td><p>#e #i #b #o #d #x</p></td>
</tr>
<tr class="row-even"><td><p>2.4 Datum labels</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>3.1 Variables, syntactic keywords, and regions</p></td>
<td></td>
<td></td>
</tr>
<tr class="row-even"><td><p>3.2 Disjointness of types</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>3.3 External representations</p></td>
<td></td>
<td></td>
</tr>
<tr class="row-even"><td><p>3.4 Storage model</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>3.5 Proper tail recursion</p></td>
<td><p>yes</p></td>
<td><p>As the report specifies, <code class="docutils literal notranslate"><span class="pre">apply</span></code>, <code class="docutils literal notranslate"><span class="pre">call/cc</span></code>, and <code class="docutils literal notranslate"><span class="pre">call-with-values</span></code> perform tail calls</p></td>
</tr>
<tr class="row-even"><td><p>4.1.1 Variable references</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>4.1.2 Literal expressions</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>4.1.3 Procedure calls</p></td>
<td><p>yes</p></td>
<td><p>In picrin <code class="docutils literal notranslate"><span class="pre">()</span></code> is self-evaluating</p></td>
</tr>
<tr class="row-odd"><td><p>4.1.4 Procedures</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>4.1.5 Conditionals</p></td>
<td><p>yes</p></td>
<td><p>In picrin <code class="docutils literal notranslate"><span class="pre">(if</span> <span class="pre">#f</span> <span class="pre">#f)</span></code> returns <code class="docutils literal notranslate"><span class="pre">#f</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>4.1.6 Assignments</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>4.1.7 Inclusion</p></td>
<td><p>incomplete</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">include-ci</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>4.2.1 Conditionals</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>4.2.2 Binding constructs</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>4.2.3 Sequencing</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>4.2.4 Iteration</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>4.2.5 Delayed evaluation</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>4.2.6 Dynamic bindings</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>4.2.7 Exception handling</p></td>
<td><p>yes</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">guard</span></code> syntax.</p></td>
</tr>
<tr class="row-even"><td><p>4.2.8 Quasiquotation</p></td>
<td><p>yes</p></td>
<td><p>can be safely nested. TODO: multiple argument for unquote</p></td>
</tr>
<tr class="row-odd"><td><p>4.2.9 Case-lambda</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>4.3.1 Bindings constructs for syntactic keywords</p></td>
<td><p>yes <a class="footnote-reference brackets" href="#id2" id="id1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a></p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>4.3.2 Pattern language</p></td>
<td><p>yes</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">syntax-rules</span></code></p></td>
</tr>
<tr class="row-even"><td><p>4.3.3 Signaling errors in macro transformers</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>5.1 Programs</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>5.2 Import declarations</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>5.3.1 Top level definitions</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>5.3.2 Internal definitions</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>5.3.3 Multiple-value definitions</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>5.4 Syntax definitions</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>5.5 Recored-type definitions</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>5.6.1 Library Syntax</p></td>
<td><p>yes</p></td>
<td><p>In picrin, libraries can be reopend and can be nested.</p></td>
</tr>
<tr class="row-odd"><td><p>5.6.2 Library example</p></td>
<td><p>N/A</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>5.7 The REPL</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>6.1 Equivalence predicates</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>6.2.1 Numerical types</p></td>
<td><p>yes</p></td>
<td><p>picrin has only two types of internal representation of numbers: fixnum and double float. It still comforms the R7RS spec.</p></td>
</tr>
<tr class="row-odd"><td><p>6.2.2 Exactness</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>6.2.3 Implementation restrictions</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>6.2.4 Implementation extensions</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>6.2.5 Syntax of numerical constants</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>6.2.6 Numerical operations</p></td>
<td><p>yes</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">denominator</span></code>, <code class="docutils literal notranslate"><span class="pre">numerator</span></code>, and <code class="docutils literal notranslate"><span class="pre">rationalize</span></code> are not supported for now. Also, picrin does not provide complex library procedures.</p></td>
</tr>
<tr class="row-even"><td><p>6.2.7 Numerical input and output</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>6.3 Booleans</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>6.4 Pairs and lists</p></td>
<td><p>yes</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">list?</span></code> is safe for using against circular list.</p></td>
</tr>
<tr class="row-odd"><td><p>6.5 Symbols</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>6.6 Characters</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>6.7 Strings</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>6.8 Vectors</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>6.9 Bytevectors</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>6.10 Control features</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>6.11 Exceptions</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>6.12 Environments and evaluation</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>6.13.1 Ports</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>6.13.2 Input</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>6.13.3 Output</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>6.14 System interface</p></td>
<td><p>yes</p></td>
<td></td>
</tr>
</tbody>
</table>
<aside class="footnote-list brackets">
<aside class="footnote brackets" id="id2" role="doc-footnote">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id1">1</a><span class="fn-bracket">]</span></span>
<p>Picrin provides hygienic macros in addition to so-called legacy macro (<code class="docutils literal notranslate"><span class="pre">define-macro</span></code>), such as syntactic closure, explicit renaming macro, and implicit renaming macro.</p>
</aside>
</aside>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div>
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Language</a><ul>
<li><a class="reference internal" href="#the-repl">The REPL</a></li>
<li><a class="reference internal" href="#compliance-with-r7rs">Compliance with R7RS</a></li>
</ul>
</li>
</ul>
</div>
<div>
<h4>Previous topic</h4>
<p class="topless"><a href="deploy.html"
title="previous chapter">Installation</a></p>
</div>
<div>
<h4>Next topic</h4>
<p class="topless"><a href="libs.html"
title="next chapter">Standard Libraries</a></p>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/lang.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="libs.html" title="Standard Libraries"
>next</a> |</li>
<li class="right" >
<a href="deploy.html" title="Installation"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">Picrin 0.1 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Language</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2014, Yuichi Nishiwaki and other picrin contributors.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 6.1.3.
</div>
</body>
</html>