diff --git a/www/.buildinfo b/www/.buildinfo new file mode 100644 index 0000000..fdd1745 --- /dev/null +++ b/www/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: dffc4925ec7fe6979190280aa1a4ad8c +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/www/_sources/capi.rst.txt b/www/_sources/capi.rst.txt new file mode 100644 index 0000000..03b5cc5 --- /dev/null +++ b/www/_sources/capi.rst.txt @@ -0,0 +1,99 @@ +C API +===== + +You can write Picrin's extension by yourself from both sides of C and Scheme. This page describes the way to control the interpreter from the C world. + +Extension Library +----------------- + +If you want to create a contribution library with C, the only thing you need to do is make a directory under contrib/. Below is a sample code of extension library. + +* contrib/add/nitro.mk + +.. sourcecode:: cmake + + CONTRIB_INITS += add + CONTRIB_SRCS += contrib/add/add.c + +* contrib/add/add.c + +.. sourcecode:: c + + #include "picrin.h" + + static pic_value + pic_add(pic_state *pic) + { + double a, b; + + pic_get_args(pic, "ff", &a, &b); + + return pic_float_value(pic, a + b); + } + + void + pic_init_add(pic_state *pic) + { + pic_deflibrary (pic, "(picrin add)") { + pic_defun(pic, "add", pic_add); + } + } + +After recompiling the interpreter, the library "(picrin add)" is available in the REPL, which library provides a funciton "add". + +User-data vs GC +^^^^^^^^^^^^^^^ + +When you use dynamic memory allocation inside C APIs, you must be caseful about Picrin's GC. Fortunately, we provides a set of wrapper functions for complete abstraction of GC. In the case below, the memory (de)allocators *create_foo* and *finalize_foo* are wrapped in pic_data object, so that when an instance of foo losts all references from others to it picrin can automatically finalize the orphan object. + +.. sourcecode:: c + + /** foo.c **/ + #include + #include "picrin.h" + + /* + * C-side API + */ + + struct foo { + // blah blah blah + }; + + struct foo * + create_foo () + { + return malloc(sizeof(struct foo)); + } + + void + finalize_foo (void *foo) { + struct foo *f = foo; + free(f); + } + + + /* + * picrin-side FFI interface + */ + + static const pic_data_type foo_type = { "foo", finalize_foo }; + + static pic_value + pic_create_foo(pic_state *pic) + { + struct foo *f; + + pic_get_args(pic, ""); // no args here + + f = create_foo(); + + return pic_data_value(pic, md, &foo_type); + } + + void + pic_init_foo(pic_state *pic) + { + pic_defun(pic, "create-foo", pic_create_foo); // (create-foo) + } + diff --git a/www/_sources/deploy.rst.txt b/www/_sources/deploy.rst.txt new file mode 100644 index 0000000..7bb3613 --- /dev/null +++ b/www/_sources/deploy.rst.txt @@ -0,0 +1,37 @@ +Installation +============ + +Installation instructions below. + + +Build +----- + +Just type `make` in the project root directory. You will find an executable binary newly created at bin/ directory. + + $ make + +When you are building picrin on x86_64 system, PIC_NAN_BOXING flag is automatically turned on (see include/picrin/config.h for detail). + +Install +------- + +`make install` target is provided. By default it installs picrin binary into `/usr/local/bin/`. + + $ make install + +Since picrin does not use autoconf, if you want to specify the install directory, pass the custom path to `make` via command line argument. + + $ make install prefix=/path/to/dir + +Requirement +----------- + +To build Picrin Scheme from source code, some external libraries are required: + +- perl +- regex.h of POSIX.1 +- libedit (optional) + +Make command automatically turns on optional libraries if available. +Picrin is mainly developed on Mac OS X and only tested on OS X or Ubuntu 14.04+. When you tried to run picrin on other platforms and found something was wrong with it, please send us an issue. diff --git a/www/_sources/index.rst.txt b/www/_sources/index.rst.txt new file mode 100644 index 0000000..be1a32b --- /dev/null +++ b/www/_sources/index.rst.txt @@ -0,0 +1,27 @@ +.. Picrin documentation master file, created by + sphinx-quickstart on Sun May 18 06:06:12 2014. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Picrin's documentation! +================================== + +Contents: + +.. toctree:: + :maxdepth: 2 + + intro.rst + deploy.rst + lang.rst + libs.rst + contrib.rst + capi.rst + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/www/_sources/intro.rst.txt b/www/_sources/intro.rst.txt new file mode 100644 index 0000000..fa72e69 --- /dev/null +++ b/www/_sources/intro.rst.txt @@ -0,0 +1,54 @@ +Introduction +============ + +Picrin is a lightweight R7RS scheme implementation written in pure C89. It contains a reasonably fast VM, an improved hygienic macro system, usuful contribution libraries, and simple but powerful C interface. + +- R7RS compatible +- Reentrant design (all VM states are stored in single global state object) +- Bytecode interpreter +- Direct threaded VM +- Internal representation by nan-boxing (available only on x64) +- Conservative call/cc implementation (VM stack and native c stack can interleave) +- Exact GC (simple mark and sweep, partially reference count) +- String representation by rope +- Hygienic macro transformers (syntactic closures, explicit and implicit renaming macros) +- Extended library syntax + +Homepage +-------- + +Currently picrin is hosted on Github. You can freely send a bug report or pull-request, and fork the repository. + +https://github.com/picrin-scheme/picrin + +Documentation +------------- + +See http://picrin.readthedocs.org/ + +IRC +--- + +There is a chat room on chat.freenode.org, channel #picrin. IRC logs here: https://botbot.me/freenode/picrin/ + +LICENSE +------- + +Copyright (c) 2013-2014 Yuichi Nishiwaki and other picrin contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/www/_sources/lang.rst.txt b/www/_sources/lang.rst.txt new file mode 100644 index 0000000..b3f4c09 --- /dev/null +++ b/www/_sources/lang.rst.txt @@ -0,0 +1,91 @@ +Language +======== + +Picrin's core language is the R7RS scheme with some powerful extensions. Please visit http://r7rs.org/ for the information of R7RS's design and underlying thoughts. + +The REPL +-------- + +At the REPL start-up time, some usuful built-in libraries listed below will be automatically imported. + +- ``(scheme base)`` +- ``(scheme load)`` +- ``(scheme process-context)`` +- ``(scheme write)`` +- ``(scheme file)`` +- ``(scheme inexact)`` +- ``(scheme cxr)`` +- ``(scheme lazy)`` +- ``(scheme time)`` +- ``(scheme case-lambda)`` +- ``(scheme read)`` +- ``(scheme eval)`` + +Compliance with R7RS +--------------------- + +================================================ ========== ========================================================================================================================== +section status comments +================================================ ========== ========================================================================================================================== +2.2 Whitespace and comments yes +2.3 Other notations incomplete #e #i #b #o #d #x +2.4 Datum labels yes +3.1 Variables, syntactic keywords, and regions +3.2 Disjointness of types yes +3.3 External representations +3.4 Storage model yes +3.5 Proper tail recursion yes As the report specifies, ``apply``, ``call/cc``, and ``call-with-values`` perform tail calls +4.1.1 Variable references yes +4.1.2 Literal expressions yes +4.1.3 Procedure calls yes In picrin ``()`` is self-evaluating +4.1.4 Procedures yes +4.1.5 Conditionals yes In picrin ``(if #f #f)`` returns ``#f`` +4.1.6 Assignments yes +4.1.7 Inclusion incomplete ``include-ci`` +4.2.1 Conditionals yes +4.2.2 Binding constructs yes +4.2.3 Sequencing yes +4.2.4 Iteration yes +4.2.5 Delayed evaluation yes +4.2.6 Dynamic bindings yes +4.2.7 Exception handling yes ``guard`` syntax. +4.2.8 Quasiquotation yes can be safely nested. TODO: multiple argument for unquote +4.2.9 Case-lambda yes +4.3.1 Bindings constructs for syntactic keywords yes [#]_ +4.3.2 Pattern language yes ``syntax-rules`` +4.3.3 Signaling errors in macro transformers yes +5.1 Programs yes +5.2 Import declarations yes +5.3.1 Top level definitions yes +5.3.2 Internal definitions yes +5.3.3 Multiple-value definitions yes +5.4 Syntax definitions yes +5.5 Recored-type definitions yes +5.6.1 Library Syntax yes In picrin, libraries can be reopend and can be nested. +5.6.2 Library example N/A +5.7 The REPL yes +6.1 Equivalence predicates yes +6.2.1 Numerical types yes picrin has only two types of internal representation of numbers: fixnum and double float. It still comforms the R7RS spec. +6.2.2 Exactness yes +6.2.3 Implementation restrictions yes +6.2.4 Implementation extensions yes +6.2.5 Syntax of numerical constants yes +6.2.6 Numerical operations yes ``denominator``, ``numerator``, and ``rationalize`` are not supported for now. Also, picrin does not provide complex library procedures. +6.2.7 Numerical input and output yes +6.3 Booleans yes +6.4 Pairs and lists yes ``list?`` is safe for using against circular list. +6.5 Symbols yes +6.6 Characters yes +6.7 Strings yes +6.8 Vectors yes +6.9 Bytevectors yes +6.10 Control features yes +6.11 Exceptions yes +6.12 Environments and evaluation yes +6.13.1 Ports yes +6.13.2 Input yes +6.13.3 Output yes +6.14 System interface yes +================================================ ========== ========================================================================================================================== + +.. [#] Picrin provides hygienic macros in addition to so-called legacy macro (``define-macro``), such as syntactic closure, explicit renaming macro, and implicit renaming macro. diff --git a/www/_sources/libs.rst.txt b/www/_sources/libs.rst.txt new file mode 100644 index 0000000..a8b441a --- /dev/null +++ b/www/_sources/libs.rst.txt @@ -0,0 +1,152 @@ +Standard Libraries +================== + +Picrin's all built-in libraries are described below. + +(picrin macro) +-------------- + +Utility functions and syntaces for macro definition. + +- define-macro +- gensym +- ungensym +- macroexpand +- macroexpand-1 + +Old-fashioned macro. + +- identifier? +- identifier=? + +- make-syntactic-closure +- close-syntax +- capture-syntactic-environment + +- sc-macro-transformer +- rsc-macro-transformer + +Syntactic closures. + +- er-macro-transformer +- ir-macro-transformer +- strip-syntax + +Explicit renaming macro family. + +(picrin array) +-------------- + +Resizable random-access list. + +Technically, picrin's array is implemented as a ring-buffer, effective double-ended queue data structure (deque) that can operate pushing and poping from both of front and back in constant time. In addition to the deque interface, array provides standard sequence interface similar to functions specified by R7RS. + +- **(make-array [capacity])** + + Returns a newly allocated array object. If capacity is given, internal data chunk of the array object will be initialized by capacity size. + +- **(array . objs)** + + Returns an array initialized with objs. + +- **(array? . obj)** + + Returns #t if obj is an array. + +- **(array-length ary)** + + Returns the length of ary. + +- **(array-ref ary i)** + + Like ``list-ref``, return the object pointed by the index i. + +- **(array-set! ary i obj)** + + Like ``list-set!``, substitutes the object pointed by the index i with given obj. + +- **(array-push! ary obj)** + + Adds obj to the end of ary. + +- **(array-pop! ary)** + + Removes the last element of ary, and returns it. + +- **(array-unshift! ary obj)** + + Adds obj to the front of ary. + +- **(array-shift! ary)** + + Removes the first element of ary, and returns it. + +- **(array-map proc ary)** + + Performs mapping operation on ary. + +- **(array-for-each proc ary)** + + Performs mapping operation on ary, but discards the result. + +- **(array->list ary)** + + Converts ary into list. + +- **(list->array list)** + + Converts list into array. + + +(picrin dictionary) +------------------- + +Symbol-to-object hash table. + +- **(make-dictionary)** + + Returns a newly allocated empty dictionary. + +- **(dictionary . plist)** + + Returns a dictionary initialized with the content of plist. + +- **(dictionary? obj)** + + Returns #t if obj is a dictionary. + +- **(dictionary-ref dict key)** + + Look up dictionary dict for a value associated with key. If dict has a slot for key `key`, a pair containing the key object and the associated value is returned. Otherwise `#f` is returned. + +- **(dictionary-set! dict key obj)** + + If there is no value already associated with key, this function newly creates a binding of key with obj. Otherwise, updates the existing binding with given obj. + + If obj is `#undefined`, this procedure behaves like a deleter: it will remove the key/value slot with the name `key` from the dictionary. When no slot is associated with `key`, it will do nothing. + +- **(dictionary-size dict)** + + Returns the number of registered elements in dict. + +- **(dicitonary-map proc dict)** + + Perform mapping action onto dictionary object. ``proc`` is called by a sequence ``(proc key1 key2 ...)``. + +- **(dictionary-for-each proc dict)** + + Similar to ``dictionary-map``, but discards the result. + +- **(dictionary->plist dict)** +- **(plist->dictionary plist)** +- **(dictionary->alist dict)** +- **(alist->dictionary alist)** + + Conversion between dictionary and alist/plist. + + +(picrin user) +------------- + +When you start the REPL, you are dropped into here. + diff --git a/www/_static/basic.css b/www/_static/basic.css new file mode 100644 index 0000000..7577acb --- /dev/null +++ b/www/_static/basic.css @@ -0,0 +1,903 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +div.section::after { + display: block; + content: ''; + clear: left; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li p.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 360px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, figure.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, figure.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-default { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar, +aside.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px; + background-color: #ffe; + width: 40%; + float: right; + clear: right; + overflow-x: auto; +} + +p.sidebar-title { + font-weight: bold; +} + +nav.contents, +aside.topic, +div.admonition, div.topic, blockquote { + clear: left; +} + +/* -- topics ---------------------------------------------------------------- */ + +nav.contents, +aside.topic, +div.topic { + border: 1px solid #ccc; + padding: 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +nav.contents > :last-child, +aside.topic > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +nav.contents::after, +aside.topic::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + margin-top: 10px; + margin-bottom: 10px; + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure, figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption, figcaption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number, +figcaption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text, +figcaption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +aside.footnote > span, +div.citation > span { + float: left; +} +aside.footnote > span:last-of-type, +div.citation > span:last-of-type { + padding-right: 0.5em; +} +aside.footnote > p { + margin-left: 2em; +} +div.citation > p { + margin-left: 4em; +} +aside.footnote > p:last-of-type, +div.citation > p:last-of-type { + margin-bottom: 0em; +} +aside.footnote > p:last-of-type:after, +div.citation > p:last-of-type:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + +dl { + margin-bottom: 15px; +} + +dd > :first-child { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +.classifier:before { + font-style: normal; + margin: 0 0.5em; + content: ":"; + display: inline-block; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; + white-space: nowrap; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + +td.linenos pre { + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; +} + +table.highlighttable td { + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +table.highlighttable td.linenos, +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/www/_static/classic.css b/www/_static/classic.css new file mode 100644 index 0000000..d0ed326 --- /dev/null +++ b/www/_static/classic.css @@ -0,0 +1,269 @@ +/* + * classic.css_t + * ~~~~~~~~~~~~~ + * + * Sphinx stylesheet -- classic theme. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +html { + /* CSS hack for macOS's scrollbar (see #1125) */ + background-color: #FFFFFF; +} + +body { + font-family: sans-serif; + font-size: 100%; + background-color: #11303d; + color: #000; + margin: 0; + padding: 0; +} + +div.document { + display: flex; + background-color: #1c4e63; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 230px; +} + +div.body { + background-color: #ffffff; + color: #000000; + padding: 0 20px 30px 20px; +} + +div.footer { + color: #ffffff; + width: 100%; + padding: 9px 0 9px 0; + text-align: center; + font-size: 75%; +} + +div.footer a { + color: #ffffff; + text-decoration: underline; +} + +div.related { + background-color: #133f52; + line-height: 30px; + color: #ffffff; +} + +div.related a { + color: #ffffff; +} + +div.sphinxsidebar { +} + +div.sphinxsidebar h3 { + font-family: 'Trebuchet MS', sans-serif; + color: #ffffff; + font-size: 1.4em; + font-weight: normal; + margin: 0; + padding: 0; +} + +div.sphinxsidebar h3 a { + color: #ffffff; +} + +div.sphinxsidebar h4 { + font-family: 'Trebuchet MS', sans-serif; + color: #ffffff; + font-size: 1.3em; + font-weight: normal; + margin: 5px 0 0 0; + padding: 0; +} + +div.sphinxsidebar p { + color: #ffffff; +} + +div.sphinxsidebar p.topless { + margin: 5px 10px 10px 10px; +} + +div.sphinxsidebar ul { + margin: 10px; + padding: 0; + color: #ffffff; +} + +div.sphinxsidebar a { + color: #98dbcc; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + + + +/* -- hyperlink styles ------------------------------------------------------ */ + +a { + color: #355f7c; + text-decoration: none; +} + +a:visited { + color: #355f7c; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + + + +/* -- body styles ----------------------------------------------------------- */ + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: 'Trebuchet MS', sans-serif; + background-color: #f2f2f2; + font-weight: normal; + color: #20435c; + border-bottom: 1px solid #ccc; + margin: 20px -20px 10px -20px; + padding: 3px 0 3px 10px; +} + +div.body h1 { margin-top: 0; font-size: 200%; } +div.body h2 { font-size: 160%; } +div.body h3 { font-size: 140%; } +div.body h4 { font-size: 120%; } +div.body h5 { font-size: 110%; } +div.body h6 { font-size: 100%; } + +a.headerlink { + color: #c60f0f; + font-size: 0.8em; + padding: 0 4px 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + background-color: #c60f0f; + color: white; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + text-align: justify; + line-height: 130%; +} + +div.admonition p.admonition-title + p { + display: inline; +} + +div.admonition p { + margin-bottom: 5px; +} + +div.admonition pre { + margin-bottom: 5px; +} + +div.admonition ul, div.admonition ol { + margin-bottom: 5px; +} + +div.note { + background-color: #eee; + border: 1px solid #ccc; +} + +div.seealso { + background-color: #ffc; + border: 1px solid #ff6; +} + +nav.contents, +aside.topic, +div.topic { + background-color: #eee; +} + +div.warning { + background-color: #ffe4e4; + border: 1px solid #f66; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre { + padding: 5px; + background-color: unset; + color: unset; + line-height: 120%; + border: 1px solid #ac9; + border-left: none; + border-right: none; +} + +code { + background-color: #ecf0f3; + padding: 0 1px 0 1px; + font-size: 0.95em; +} + +th, dl.field-list > dt { + background-color: #ede; +} + +.warning code { + background: #efc2c2; +} + +.note code { + background: #d6d6d6; +} + +.viewcode-back { + font-family: sans-serif; +} + +div.viewcode-block:target { + background-color: #f4debf; + border-top: 1px solid #ac9; + border-bottom: 1px solid #ac9; +} + +div.code-block-caption { + color: #efefef; + background-color: #1c4e63; +} \ No newline at end of file diff --git a/www/_static/default.css b/www/_static/default.css new file mode 100644 index 0000000..81b9363 --- /dev/null +++ b/www/_static/default.css @@ -0,0 +1 @@ +@import url("classic.css"); diff --git a/www/_static/doctools.js b/www/_static/doctools.js new file mode 100644 index 0000000..d06a71d --- /dev/null +++ b/www/_static/doctools.js @@ -0,0 +1,156 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Base JavaScript utilities for all Sphinx HTML documentation. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); + +const _ready = (callback) => { + if (document.readyState !== "loading") { + callback(); + } else { + document.addEventListener("DOMContentLoaded", callback); + } +}; + +/** + * Small JavaScript module for the documentation. + */ +const Documentation = { + init: () => { + Documentation.initDomainIndexTable(); + Documentation.initOnKeyListeners(); + }, + + /** + * i18n support + */ + TRANSLATIONS: {}, + PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), + LOCALE: "unknown", + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext: (string) => { + const translated = Documentation.TRANSLATIONS[string]; + switch (typeof translated) { + case "undefined": + return string; // no translation + case "string": + return translated; // translation exists + default: + return translated[0]; // (singular, plural) translation tuple exists + } + }, + + ngettext: (singular, plural, n) => { + const translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated !== "undefined") + return translated[Documentation.PLURAL_EXPR(n)]; + return n === 1 ? singular : plural; + }, + + addTranslations: (catalog) => { + Object.assign(Documentation.TRANSLATIONS, catalog.messages); + Documentation.PLURAL_EXPR = new Function( + "n", + `return (${catalog.plural_expr})` + ); + Documentation.LOCALE = catalog.locale; + }, + + /** + * helper function to focus on search bar + */ + focusSearchBar: () => { + document.querySelectorAll("input[name=q]")[0]?.focus(); + }, + + /** + * Initialise the domain index toggle buttons + */ + initDomainIndexTable: () => { + const toggler = (el) => { + const idNumber = el.id.substr(7); + const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); + if (el.src.substr(-9) === "minus.png") { + el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; + toggledRows.forEach((el) => (el.style.display = "none")); + } else { + el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; + toggledRows.forEach((el) => (el.style.display = "")); + } + }; + + const togglerElements = document.querySelectorAll("img.toggler"); + togglerElements.forEach((el) => + el.addEventListener("click", (event) => toggler(event.currentTarget)) + ); + togglerElements.forEach((el) => (el.style.display = "")); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); + }, + + initOnKeyListeners: () => { + // only install a listener if it is really needed + if ( + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && + !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + ) + return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; + + if (!event.shiftKey) { + switch (event.key) { + case "ArrowLeft": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const prevLink = document.querySelector('link[rel="prev"]'); + if (prevLink && prevLink.href) { + window.location.href = prevLink.href; + event.preventDefault(); + } + break; + case "ArrowRight": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const nextLink = document.querySelector('link[rel="next"]'); + if (nextLink && nextLink.href) { + window.location.href = nextLink.href; + event.preventDefault(); + } + break; + } + } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case "/": + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; + Documentation.focusSearchBar(); + event.preventDefault(); + } + }); + }, +}; + +// quick alias for translations +const _ = Documentation.gettext; + +_ready(Documentation.init); diff --git a/www/_static/documentation_options.js b/www/_static/documentation_options.js new file mode 100644 index 0000000..cf359c0 --- /dev/null +++ b/www/_static/documentation_options.js @@ -0,0 +1,14 @@ +var DOCUMENTATION_OPTIONS = { + URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), + VERSION: '0.1', + LANGUAGE: 'en', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, +}; \ No newline at end of file diff --git a/www/_static/file.png b/www/_static/file.png new file mode 100644 index 0000000..a858a41 Binary files /dev/null and b/www/_static/file.png differ diff --git a/www/_static/language_data.js b/www/_static/language_data.js new file mode 100644 index 0000000..250f566 --- /dev/null +++ b/www/_static/language_data.js @@ -0,0 +1,199 @@ +/* + * language_data.js + * ~~~~~~~~~~~~~~~~ + * + * This script contains the language-specific data used by searchtools.js, + * namely the list of stopwords, stemmer, scorer and splitter. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; + + +/* Non-minified version is copied as a separate JS file, is available */ + +/** + * Porter Stemmer + */ +var Stemmer = function() { + + var step2list = { + ational: 'ate', + tional: 'tion', + enci: 'ence', + anci: 'ance', + izer: 'ize', + bli: 'ble', + alli: 'al', + entli: 'ent', + eli: 'e', + ousli: 'ous', + ization: 'ize', + ation: 'ate', + ator: 'ate', + alism: 'al', + iveness: 'ive', + fulness: 'ful', + ousness: 'ous', + aliti: 'al', + iviti: 'ive', + biliti: 'ble', + logi: 'log' + }; + + var step3list = { + icate: 'ic', + ative: '', + alize: 'al', + iciti: 'ic', + ical: 'ic', + ful: '', + ness: '' + }; + + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence + + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; + } +} + diff --git a/www/_static/minus.png b/www/_static/minus.png new file mode 100644 index 0000000..d96755f Binary files /dev/null and b/www/_static/minus.png differ diff --git a/www/_static/plus.png b/www/_static/plus.png new file mode 100644 index 0000000..7107cec Binary files /dev/null and b/www/_static/plus.png differ diff --git a/www/_static/pygments.css b/www/_static/pygments.css new file mode 100644 index 0000000..691aeb8 --- /dev/null +++ b/www/_static/pygments.css @@ -0,0 +1,74 @@ +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.highlight .hll { background-color: #ffffcc } +.highlight { background: #eeffcc; } +.highlight .c { color: #408090; font-style: italic } /* Comment */ +.highlight .err { border: 1px solid #FF0000 } /* Error */ +.highlight .k { color: #007020; font-weight: bold } /* Keyword */ +.highlight .o { color: #666666 } /* Operator */ +.highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ +.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #007020 } /* Comment.Preproc */ +.highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ +.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ +.highlight .gd { color: #A00000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #FF0000 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #333333 } /* Generic.Output */ +.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #0044DD } /* Generic.Traceback */ +.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #007020 } /* Keyword.Pseudo */ +.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #902000 } /* Keyword.Type */ +.highlight .m { color: #208050 } /* Literal.Number */ +.highlight .s { color: #4070a0 } /* Literal.String */ +.highlight .na { color: #4070a0 } /* Name.Attribute */ +.highlight .nb { color: #007020 } /* Name.Builtin */ +.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ +.highlight .no { color: #60add5 } /* Name.Constant */ +.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ +.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ +.highlight .ne { color: #007020 } /* Name.Exception */ +.highlight .nf { color: #06287e } /* Name.Function */ +.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ +.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #bb60d5 } /* Name.Variable */ +.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mb { color: #208050 } /* Literal.Number.Bin */ +.highlight .mf { color: #208050 } /* Literal.Number.Float */ +.highlight .mh { color: #208050 } /* Literal.Number.Hex */ +.highlight .mi { color: #208050 } /* Literal.Number.Integer */ +.highlight .mo { color: #208050 } /* Literal.Number.Oct */ +.highlight .sa { color: #4070a0 } /* Literal.String.Affix */ +.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ +.highlight .sc { color: #4070a0 } /* Literal.String.Char */ +.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ +.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ +.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ +.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ +.highlight .sx { color: #c65d09 } /* Literal.String.Other */ +.highlight .sr { color: #235388 } /* Literal.String.Regex */ +.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ +.highlight .ss { color: #517918 } /* Literal.String.Symbol */ +.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ +.highlight .fm { color: #06287e } /* Name.Function.Magic */ +.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ +.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ +.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ +.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ +.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/www/_static/searchtools.js b/www/_static/searchtools.js new file mode 100644 index 0000000..97d56a7 --- /dev/null +++ b/www/_static/searchtools.js @@ -0,0 +1,566 @@ +/* + * searchtools.js + * ~~~~~~~~~~~~~~~~ + * + * Sphinx JavaScript utilities for the full-text search. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +/** + * Simple result scoring code. + */ +if (typeof Scorer === "undefined") { + var Scorer = { + // Implement the following function to further tweak the score for each result + // The function takes a result array [docname, title, anchor, descr, score, filename] + // and returns the new score. + /* + score: result => { + const [docname, title, anchor, descr, score, filename] = result + return score + }, + */ + + // query matches the full name of an object + objNameMatch: 11, + // or matches in the last dotted part of the object name + objPartialMatch: 6, + // Additive scores depending on the priority of the object + objPrio: { + 0: 15, // used to be importantResults + 1: 5, // used to be objectResults + 2: -5, // used to be unimportantResults + }, + // Used when the priority is not in the mapping. + objPrioDefault: 0, + + // query found in title + title: 15, + partialTitle: 7, + // query found in terms + term: 5, + partialTerm: 2, + }; +} + +const _removeChildren = (element) => { + while (element && element.lastChild) element.removeChild(element.lastChild); +}; + +/** + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping + */ +const _escapeRegExp = (string) => + string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string + +const _displayItem = (item, searchTerms) => { + const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; + const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT; + const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; + const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX; + const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY; + + const [docName, title, anchor, descr, score, _filename] = item; + + let listItem = document.createElement("li"); + let requestUrl; + let linkUrl; + if (docBuilder === "dirhtml") { + // dirhtml builder + let dirname = docName + "/"; + if (dirname.match(/\/index\/$/)) + dirname = dirname.substring(0, dirname.length - 6); + else if (dirname === "index/") dirname = ""; + requestUrl = docUrlRoot + dirname; + linkUrl = requestUrl; + } else { + // normal html builders + requestUrl = docUrlRoot + docName + docFileSuffix; + linkUrl = docName + docLinkSuffix; + } + let linkEl = listItem.appendChild(document.createElement("a")); + linkEl.href = linkUrl + anchor; + linkEl.dataset.score = score; + linkEl.innerHTML = title; + if (descr) + listItem.appendChild(document.createElement("span")).innerHTML = + " (" + descr + ")"; + else if (showSearchSummary) + fetch(requestUrl) + .then((responseData) => responseData.text()) + .then((data) => { + if (data) + listItem.appendChild( + Search.makeSearchSummary(data, searchTerms) + ); + }); + Search.output.appendChild(listItem); +}; +const _finishSearch = (resultCount) => { + Search.stopPulse(); + Search.title.innerText = _("Search Results"); + if (!resultCount) + Search.status.innerText = Documentation.gettext( + "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories." + ); + else + Search.status.innerText = _( + `Search finished, found ${resultCount} page(s) matching the search query.` + ); +}; +const _displayNextItem = ( + results, + resultCount, + searchTerms +) => { + // results left, load the summary and display it + // this is intended to be dynamic (don't sub resultsCount) + if (results.length) { + _displayItem(results.pop(), searchTerms); + setTimeout( + () => _displayNextItem(results, resultCount, searchTerms), + 5 + ); + } + // search finished, update title and status message + else _finishSearch(resultCount); +}; + +/** + * Default splitQuery function. Can be overridden in ``sphinx.search`` with a + * custom function per language. + * + * The regular expression works by splitting the string on consecutive characters + * that are not Unicode letters, numbers, underscores, or emoji characters. + * This is the same as ``\W+`` in Python, preserving the surrogate pair area. + */ +if (typeof splitQuery === "undefined") { + var splitQuery = (query) => query + .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu) + .filter(term => term) // remove remaining empty strings +} + +/** + * Search Module + */ +const Search = { + _index: null, + _queued_query: null, + _pulse_status: -1, + + htmlToText: (htmlString) => { + const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); + htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() }); + const docContent = htmlElement.querySelector('[role="main"]'); + if (docContent !== undefined) return docContent.textContent; + console.warn( + "Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template." + ); + return ""; + }, + + init: () => { + const query = new URLSearchParams(window.location.search).get("q"); + document + .querySelectorAll('input[name="q"]') + .forEach((el) => (el.value = query)); + if (query) Search.performSearch(query); + }, + + loadIndex: (url) => + (document.body.appendChild(document.createElement("script")).src = url), + + setIndex: (index) => { + Search._index = index; + if (Search._queued_query !== null) { + const query = Search._queued_query; + Search._queued_query = null; + Search.query(query); + } + }, + + hasIndex: () => Search._index !== null, + + deferQuery: (query) => (Search._queued_query = query), + + stopPulse: () => (Search._pulse_status = -1), + + startPulse: () => { + if (Search._pulse_status >= 0) return; + + const pulse = () => { + Search._pulse_status = (Search._pulse_status + 1) % 4; + Search.dots.innerText = ".".repeat(Search._pulse_status); + if (Search._pulse_status >= 0) window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something (or wait until index is loaded) + */ + performSearch: (query) => { + // create the required interface elements + const searchText = document.createElement("h2"); + searchText.textContent = _("Searching"); + const searchSummary = document.createElement("p"); + searchSummary.classList.add("search-summary"); + searchSummary.innerText = ""; + const searchList = document.createElement("ul"); + searchList.classList.add("search"); + + const out = document.getElementById("search-results"); + Search.title = out.appendChild(searchText); + Search.dots = Search.title.appendChild(document.createElement("span")); + Search.status = out.appendChild(searchSummary); + Search.output = out.appendChild(searchList); + + const searchProgress = document.getElementById("search-progress"); + // Some themes don't use the search progress node + if (searchProgress) { + searchProgress.innerText = _("Preparing search..."); + } + Search.startPulse(); + + // index already loaded, the browser was quick! + if (Search.hasIndex()) Search.query(query); + else Search.deferQuery(query); + }, + + /** + * execute search (requires search index to be loaded) + */ + query: (query) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + + // stem the search terms and add them to the correct list + const stemmer = new Stemmer(); + const searchTerms = new Set(); + const excludedTerms = new Set(); + const highlightTerms = new Set(); + const objectTerms = new Set(splitQuery(query.toLowerCase().trim())); + splitQuery(query.trim()).forEach((queryTerm) => { + const queryTermLower = queryTerm.toLowerCase(); + + // maybe skip this "word" + // stopwords array is from language_data.js + if ( + stopwords.indexOf(queryTermLower) !== -1 || + queryTerm.match(/^\d+$/) + ) + return; + + // stem the word + let word = stemmer.stemWord(queryTermLower); + // select the correct list + if (word[0] === "-") excludedTerms.add(word.substr(1)); + else { + searchTerms.add(word); + highlightTerms.add(queryTermLower); + } + }); + + if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js + localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" ")) + } + + // console.debug("SEARCH: searching for:"); + // console.info("required: ", [...searchTerms]); + // console.info("excluded: ", [...excludedTerms]); + + // array of [docname, title, anchor, descr, score, filename] + let results = []; + _removeChildren(document.getElementById("search-progress")); + + const queryLower = query.toLowerCase(); + for (const [title, foundTitles] of Object.entries(allTitles)) { + if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) { + for (const [file, id] of foundTitles) { + let score = Math.round(100 * queryLower.length / title.length) + results.push([ + docNames[file], + titles[file] !== title ? `${titles[file]} > ${title}` : title, + id !== null ? "#" + id : "", + null, + score, + filenames[file], + ]); + } + } + } + + // search for explicit entries in index directives + for (const [entry, foundEntries] of Object.entries(indexEntries)) { + if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { + for (const [file, id] of foundEntries) { + let score = Math.round(100 * queryLower.length / entry.length) + results.push([ + docNames[file], + titles[file], + id ? "#" + id : "", + null, + score, + filenames[file], + ]); + } + } + } + + // lookup as object + objectTerms.forEach((term) => + results.push(...Search.performObjectSearch(term, objectTerms)) + ); + + // lookup as search terms in fulltext + results.push(...Search.performTermsSearch(searchTerms, excludedTerms)); + + // let the scorer override scores with a custom scoring function + if (Scorer.score) results.forEach((item) => (item[4] = Scorer.score(item))); + + // now sort the results by score (in opposite order of appearance, since the + // display function below uses pop() to retrieve items) and then + // alphabetically + results.sort((a, b) => { + const leftScore = a[4]; + const rightScore = b[4]; + if (leftScore === rightScore) { + // same score: sort alphabetically + const leftTitle = a[1].toLowerCase(); + const rightTitle = b[1].toLowerCase(); + if (leftTitle === rightTitle) return 0; + return leftTitle > rightTitle ? -1 : 1; // inverted is intentional + } + return leftScore > rightScore ? 1 : -1; + }); + + // remove duplicate search results + // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept + let seen = new Set(); + results = results.reverse().reduce((acc, result) => { + let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(','); + if (!seen.has(resultStr)) { + acc.push(result); + seen.add(resultStr); + } + return acc; + }, []); + + results = results.reverse(); + + // for debugging + //Search.lastresults = results.slice(); // a copy + // console.info("search results:", Search.lastresults); + + // print the results + _displayNextItem(results, results.length, searchTerms); + }, + + /** + * search for object names + */ + performObjectSearch: (object, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const objects = Search._index.objects; + const objNames = Search._index.objnames; + const titles = Search._index.titles; + + const results = []; + + const objectSearchCallback = (prefix, match) => { + const name = match[4] + const fullname = (prefix ? prefix + "." : "") + name; + const fullnameLower = fullname.toLowerCase(); + if (fullnameLower.indexOf(object) < 0) return; + + let score = 0; + const parts = fullnameLower.split("."); + + // check for different match types: exact matches of full name or + // "last name" (i.e. last dotted part) + if (fullnameLower === object || parts.slice(-1)[0] === object) + score += Scorer.objNameMatch; + else if (parts.slice(-1)[0].indexOf(object) > -1) + score += Scorer.objPartialMatch; // matches in last name + + const objName = objNames[match[1]][2]; + const title = titles[match[0]]; + + // If more than one term searched for, we require other words to be + // found in the name/title/description + const otherTerms = new Set(objectTerms); + otherTerms.delete(object); + if (otherTerms.size > 0) { + const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase(); + if ( + [...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0) + ) + return; + } + + let anchor = match[3]; + if (anchor === "") anchor = fullname; + else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname; + + const descr = objName + _(", in ") + title; + + // add custom score for some objects according to scorer + if (Scorer.objPrio.hasOwnProperty(match[2])) + score += Scorer.objPrio[match[2]]; + else score += Scorer.objPrioDefault; + + results.push([ + docNames[match[0]], + fullname, + "#" + anchor, + descr, + score, + filenames[match[0]], + ]); + }; + Object.keys(objects).forEach((prefix) => + objects[prefix].forEach((array) => + objectSearchCallback(prefix, array) + ) + ); + return results; + }, + + /** + * search for full-text terms in the index + */ + performTermsSearch: (searchTerms, excludedTerms) => { + // prepare search + const terms = Search._index.terms; + const titleTerms = Search._index.titleterms; + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + + const scoreMap = new Map(); + const fileMap = new Map(); + + // perform the search on the required terms + searchTerms.forEach((word) => { + const files = []; + const arr = [ + { files: terms[word], score: Scorer.term }, + { files: titleTerms[word], score: Scorer.title }, + ]; + // add support for partial matches + if (word.length > 2) { + const escapedWord = _escapeRegExp(word); + Object.keys(terms).forEach((term) => { + if (term.match(escapedWord) && !terms[word]) + arr.push({ files: terms[term], score: Scorer.partialTerm }); + }); + Object.keys(titleTerms).forEach((term) => { + if (term.match(escapedWord) && !titleTerms[word]) + arr.push({ files: titleTerms[word], score: Scorer.partialTitle }); + }); + } + + // no match but word was a required one + if (arr.every((record) => record.files === undefined)) return; + + // found search word in contents + arr.forEach((record) => { + if (record.files === undefined) return; + + let recordFiles = record.files; + if (recordFiles.length === undefined) recordFiles = [recordFiles]; + files.push(...recordFiles); + + // set score for the word in each file + recordFiles.forEach((file) => { + if (!scoreMap.has(file)) scoreMap.set(file, {}); + scoreMap.get(file)[word] = record.score; + }); + }); + + // create the mapping + files.forEach((file) => { + if (fileMap.has(file) && fileMap.get(file).indexOf(word) === -1) + fileMap.get(file).push(word); + else fileMap.set(file, [word]); + }); + }); + + // now check if the files don't contain excluded terms + const results = []; + for (const [file, wordList] of fileMap) { + // check if all requirements are matched + + // as search terms with length < 3 are discarded + const filteredTermCount = [...searchTerms].filter( + (term) => term.length > 2 + ).length; + if ( + wordList.length !== searchTerms.size && + wordList.length !== filteredTermCount + ) + continue; + + // ensure that none of the excluded terms is in the search result + if ( + [...excludedTerms].some( + (term) => + terms[term] === file || + titleTerms[term] === file || + (terms[term] || []).includes(file) || + (titleTerms[term] || []).includes(file) + ) + ) + break; + + // select one (max) score for the file. + const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w])); + // add result to the result list + results.push([ + docNames[file], + titles[file], + "", + null, + score, + filenames[file], + ]); + } + return results; + }, + + /** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words. + */ + makeSearchSummary: (htmlText, keywords) => { + const text = Search.htmlToText(htmlText); + if (text === "") return null; + + const textLower = text.toLowerCase(); + const actualStartPosition = [...keywords] + .map((k) => textLower.indexOf(k.toLowerCase())) + .filter((i) => i > -1) + .slice(-1)[0]; + const startWithContext = Math.max(actualStartPosition - 120, 0); + + const top = startWithContext === 0 ? "" : "..."; + const tail = startWithContext + 240 < text.length ? "..." : ""; + + let summary = document.createElement("p"); + summary.classList.add("context"); + summary.textContent = top + text.substr(startWithContext, 240).trim() + tail; + + return summary; + }, +}; + +_ready(Search.init); diff --git a/www/_static/sidebar.js b/www/_static/sidebar.js new file mode 100644 index 0000000..c5e2692 --- /dev/null +++ b/www/_static/sidebar.js @@ -0,0 +1,70 @@ +/* + * sidebar.js + * ~~~~~~~~~~ + * + * This script makes the Sphinx sidebar collapsible. + * + * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds + * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton + * used to collapse and expand the sidebar. + * + * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden + * and the width of the sidebar and the margin-left of the document + * are decreased. When the sidebar is expanded the opposite happens. + * This script saves a per-browser/per-session cookie used to + * remember the position of the sidebar among the pages. + * Once the browser is closed the cookie is deleted and the position + * reset to the default (expanded). + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +const initialiseSidebar = () => { + + + + + // global elements used by the functions. + const bodyWrapper = document.getElementsByClassName("bodywrapper")[0] + const sidebar = document.getElementsByClassName("sphinxsidebar")[0] + const sidebarWrapper = document.getElementsByClassName('sphinxsidebarwrapper')[0] + const sidebarButton = document.getElementById("sidebarbutton") + const sidebarArrow = sidebarButton.querySelector('span') + + // for some reason, the document has no sidebar; do not run into errors + if (typeof sidebar === "undefined") return; + + const flipArrow = element => element.innerText = (element.innerText === "»") ? "«" : "»" + + const collapse_sidebar = () => { + bodyWrapper.style.marginLeft = ".8em"; + sidebar.style.width = ".8em" + sidebarWrapper.style.display = "none" + flipArrow(sidebarArrow) + sidebarButton.title = _('Expand sidebar') + window.localStorage.setItem("sidebar", "collapsed") + } + + const expand_sidebar = () => { + bodyWrapper.style.marginLeft = "" + sidebar.style.removeProperty("width") + sidebarWrapper.style.display = "" + flipArrow(sidebarArrow) + sidebarButton.title = _('Collapse sidebar') + window.localStorage.setItem("sidebar", "expanded") + } + + sidebarButton.addEventListener("click", () => { + (sidebarWrapper.style.display === "none") ? expand_sidebar() : collapse_sidebar() + }) + + if (!window.localStorage.getItem("sidebar")) return + const value = window.localStorage.getItem("sidebar") + if (value === "collapsed") collapse_sidebar(); + else if (value === "expanded") expand_sidebar(); +} + +if (document.readyState !== "loading") initialiseSidebar() +else document.addEventListener("DOMContentLoaded", initialiseSidebar) \ No newline at end of file diff --git a/www/_static/sphinx_highlight.js b/www/_static/sphinx_highlight.js new file mode 100644 index 0000000..aae669d --- /dev/null +++ b/www/_static/sphinx_highlight.js @@ -0,0 +1,144 @@ +/* Highlighting utilities for Sphinx HTML documentation. */ +"use strict"; + +const SPHINX_HIGHLIGHT_ENABLED = true + +/** + * highlight a given string on a node by wrapping it in + * span elements with the given class name. + */ +const _highlight = (node, addItems, text, className) => { + if (node.nodeType === Node.TEXT_NODE) { + const val = node.nodeValue; + const parent = node.parentNode; + const pos = val.toLowerCase().indexOf(text); + if ( + pos >= 0 && + !parent.classList.contains(className) && + !parent.classList.contains("nohighlight") + ) { + let span; + + const closestNode = parent.closest("body, svg, foreignObject"); + const isInSVG = closestNode && closestNode.matches("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.classList.add(className); + } + + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + parent.insertBefore( + span, + parent.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling + ) + ); + node.nodeValue = val.substr(0, pos); + + if (isInSVG) { + const rect = document.createElementNS( + "http://www.w3.org/2000/svg", + "rect" + ); + const bbox = parent.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute("class", className); + addItems.push({ parent: parent, target: rect }); + } + } + } else if (node.matches && !node.matches("button, select, textarea")) { + node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); + } +}; +const _highlightText = (thisNode, text, className) => { + let addItems = []; + _highlight(thisNode, addItems, text, className); + addItems.forEach((obj) => + obj.parent.insertAdjacentElement("beforebegin", obj.target) + ); +}; + +/** + * Small JavaScript module for the documentation. + */ +const SphinxHighlight = { + + /** + * highlight the search words provided in localstorage in the text + */ + highlightSearchWords: () => { + if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight + + // get and clear terms from localstorage + const url = new URL(window.location); + const highlight = + localStorage.getItem("sphinx_highlight_terms") + || url.searchParams.get("highlight") + || ""; + localStorage.removeItem("sphinx_highlight_terms") + url.searchParams.delete("highlight"); + window.history.replaceState({}, "", url); + + // get individual terms from highlight string + const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); + if (terms.length === 0) return; // nothing to do + + // There should never be more than one element matching "div.body" + const divBody = document.querySelectorAll("div.body"); + const body = divBody.length ? divBody[0] : document.querySelector("body"); + window.setTimeout(() => { + terms.forEach((term) => _highlightText(body, term, "highlighted")); + }, 10); + + const searchBox = document.getElementById("searchbox"); + if (searchBox === null) return; + searchBox.appendChild( + document + .createRange() + .createContextualFragment( + '" + ) + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms") + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; + if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(SphinxHighlight.highlightSearchWords); +_ready(SphinxHighlight.initEscapeListener); diff --git a/www/capi.html b/www/capi.html new file mode 100644 index 0000000..5e56b98 --- /dev/null +++ b/www/capi.html @@ -0,0 +1,199 @@ + + + + + + + + + C API — Picrin 0.1 documentation + + + + + + + + + + + + + +
+
+
+
+ +
+

C API

+

You can write Picrin’s extension by yourself from both sides of C and Scheme. This page describes the way to control the interpreter from the C world.

+
+

Extension Library

+

If you want to create a contribution library with C, the only thing you need to do is make a directory under contrib/. Below is a sample code of extension library.

+
    +
  • contrib/add/nitro.mk

  • +
+
CONTRIB_INITS += add
+CONTRIB_SRCS  += contrib/add/add.c
+
+
+
    +
  • contrib/add/add.c

  • +
+
#include "picrin.h"
+
+static pic_value
+pic_add(pic_state *pic)
+{
+  double a, b;
+
+  pic_get_args(pic, "ff", &a, &b);
+
+  return pic_float_value(pic, a + b);
+}
+
+void
+pic_init_add(pic_state *pic)
+{
+  pic_deflibrary (pic, "(picrin add)") {
+    pic_defun(pic, "add", pic_add);
+  }
+}
+
+
+

After recompiling the interpreter, the library “(picrin add)” is available in the REPL, which library provides a funciton “add”.

+
+

User-data vs GC

+

When you use dynamic memory allocation inside C APIs, you must be caseful about Picrin’s GC. Fortunately, we provides a set of wrapper functions for complete abstraction of GC. In the case below, the memory (de)allocators create_foo and finalize_foo are wrapped in pic_data object, so that when an instance of foo losts all references from others to it picrin can automatically finalize the orphan object.

+
/** foo.c **/
+#include <stdlib.h>
+#include "picrin.h"
+
+/*
+ * C-side API
+ */
+
+struct foo {
+  // blah blah blah
+};
+
+struct foo *
+create_foo ()
+{
+  return malloc(sizeof(struct foo));
+}
+
+void
+finalize_foo (void *foo) {
+  struct foo *f = foo;
+  free(f);
+}
+
+
+/*
+ * picrin-side FFI interface
+ */
+
+static const pic_data_type foo_type = { "foo", finalize_foo };
+
+static pic_value
+pic_create_foo(pic_state *pic)
+{
+  struct foo *f;
+
+  pic_get_args(pic, ""); // no args here
+
+  f = create_foo();
+
+  return pic_data_value(pic, md, &foo_type);
+}
+
+void
+pic_init_foo(pic_state *pic)
+{
+  pic_defun(pic, "create-foo", pic_create_foo); // (create-foo)
+}
+
+
+
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/www/deploy.html b/www/deploy.html new file mode 100644 index 0000000..6fd382d --- /dev/null +++ b/www/deploy.html @@ -0,0 +1,150 @@ + + + + + + + + + Installation — Picrin 0.1 documentation + + + + + + + + + + + + + + +
+
+
+
+ +
+

Installation

+

Installation instructions below.

+
+

Build

+

Just type make in the project root directory. You will find an executable binary newly created at bin/ directory.

+
+

$ make

+
+

When you are building picrin on x86_64 system, PIC_NAN_BOXING flag is automatically turned on (see include/picrin/config.h for detail).

+
+
+

Install

+

make install target is provided. By default it installs picrin binary into /usr/local/bin/.

+
+

$ make install

+
+

Since picrin does not use autoconf, if you want to specify the install directory, pass the custom path to make via command line argument.

+
+

$ make install prefix=/path/to/dir

+
+
+
+

Requirement

+

To build Picrin Scheme from source code, some external libraries are required:

+
    +
  • perl

  • +
  • regex.h of POSIX.1

  • +
  • libedit (optional)

  • +
+

Make command automatically turns on optional libraries if available. +Picrin is mainly developed on Mac OS X and only tested on OS X or Ubuntu 14.04+. When you tried to run picrin on other platforms and found something was wrong with it, please send us an issue.

+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/www/genindex.html b/www/genindex.html new file mode 100644 index 0000000..204c05e --- /dev/null +++ b/www/genindex.html @@ -0,0 +1,78 @@ + + + + + + + + Index — Picrin 0.1 documentation + + + + + + + + + + + + +
+
+
+
+ + +

Index

+ +
+ +
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/www/index.html b/www/index.html new file mode 100644 index 0000000..c7094ae --- /dev/null +++ b/www/index.html @@ -0,0 +1,145 @@ + + + + + + + + + Welcome to Picrin’s documentation! — Picrin 0.1 documentation + + + + + + + + + + + + + +
+
+
+
+ +
+

Welcome to Picrin’s documentation!

+

Contents:

+ +
+
+

Indices and tables

+ +
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/www/intro.html b/www/intro.html new file mode 100644 index 0000000..0e89c74 --- /dev/null +++ b/www/intro.html @@ -0,0 +1,164 @@ + + + + + + + + + Introduction — Picrin 0.1 documentation + + + + + + + + + + + + + + +
+
+
+
+ +
+

Introduction

+

Picrin is a lightweight R7RS scheme implementation written in pure C89. It contains a reasonably fast VM, an improved hygienic macro system, usuful contribution libraries, and simple but powerful C interface.

+
    +
  • R7RS compatible

  • +
  • Reentrant design (all VM states are stored in single global state object)

  • +
  • Bytecode interpreter

  • +
  • Direct threaded VM

  • +
  • Internal representation by nan-boxing (available only on x64)

  • +
  • Conservative call/cc implementation (VM stack and native c stack can interleave)

  • +
  • Exact GC (simple mark and sweep, partially reference count)

  • +
  • String representation by rope

  • +
  • Hygienic macro transformers (syntactic closures, explicit and implicit renaming macros)

  • +
  • Extended library syntax

  • +
+
+

Homepage

+

Currently picrin is hosted on Github. You can freely send a bug report or pull-request, and fork the repository.

+

https://github.com/picrin-scheme/picrin

+
+
+

Documentation

+

See http://picrin.readthedocs.org/

+
+
+

IRC

+

There is a chat room on chat.freenode.org, channel #picrin. IRC logs here: https://botbot.me/freenode/picrin/

+
+
+

LICENSE

+

Copyright (c) 2013-2014 Yuichi Nishiwaki and other picrin contributors

+

Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions:

+

The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software.

+

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/www/lang.html b/www/lang.html new file mode 100644 index 0000000..5de35b8 --- /dev/null +++ b/www/lang.html @@ -0,0 +1,392 @@ + + + + + + + + + Language — Picrin 0.1 documentation + + + + + + + + + + + + + + +
+
+
+
+ +
+

Language

+

Picrin’s core language is the R7RS scheme with some powerful extensions. Please visit http://r7rs.org/ for the information of R7RS’s design and underlying thoughts.

+
+

The REPL

+

At the REPL start-up time, some usuful built-in libraries listed below will be automatically imported.

+
    +
  • (scheme base)

  • +
  • (scheme load)

  • +
  • (scheme process-context)

  • +
  • (scheme write)

  • +
  • (scheme file)

  • +
  • (scheme inexact)

  • +
  • (scheme cxr)

  • +
  • (scheme lazy)

  • +
  • (scheme time)

  • +
  • (scheme case-lambda)

  • +
  • (scheme read)

  • +
  • (scheme eval)

  • +
+
+
+

Compliance with R7RS

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

section

status

comments

2.2 Whitespace and comments

yes

2.3 Other notations

incomplete

#e #i #b #o #d #x

2.4 Datum labels

yes

3.1 Variables, syntactic keywords, and regions

3.2 Disjointness of types

yes

3.3 External representations

3.4 Storage model

yes

3.5 Proper tail recursion

yes

As the report specifies, apply, call/cc, and call-with-values perform tail calls

4.1.1 Variable references

yes

4.1.2 Literal expressions

yes

4.1.3 Procedure calls

yes

In picrin () is self-evaluating

4.1.4 Procedures

yes

4.1.5 Conditionals

yes

In picrin (if #f #f) returns #f

4.1.6 Assignments

yes

4.1.7 Inclusion

incomplete

include-ci

4.2.1 Conditionals

yes

4.2.2 Binding constructs

yes

4.2.3 Sequencing

yes

4.2.4 Iteration

yes

4.2.5 Delayed evaluation

yes

4.2.6 Dynamic bindings

yes

4.2.7 Exception handling

yes

guard syntax.

4.2.8 Quasiquotation

yes

can be safely nested. TODO: multiple argument for unquote

4.2.9 Case-lambda

yes

4.3.1 Bindings constructs for syntactic keywords

yes [1]

4.3.2 Pattern language

yes

syntax-rules

4.3.3 Signaling errors in macro transformers

yes

5.1 Programs

yes

5.2 Import declarations

yes

5.3.1 Top level definitions

yes

5.3.2 Internal definitions

yes

5.3.3 Multiple-value definitions

yes

5.4 Syntax definitions

yes

5.5 Recored-type definitions

yes

5.6.1 Library Syntax

yes

In picrin, libraries can be reopend and can be nested.

5.6.2 Library example

N/A

5.7 The REPL

yes

6.1 Equivalence predicates

yes

6.2.1 Numerical types

yes

picrin has only two types of internal representation of numbers: fixnum and double float. It still comforms the R7RS spec.

6.2.2 Exactness

yes

6.2.3 Implementation restrictions

yes

6.2.4 Implementation extensions

yes

6.2.5 Syntax of numerical constants

yes

6.2.6 Numerical operations

yes

denominator, numerator, and rationalize are not supported for now. Also, picrin does not provide complex library procedures.

6.2.7 Numerical input and output

yes

6.3 Booleans

yes

6.4 Pairs and lists

yes

list? is safe for using against circular list.

6.5 Symbols

yes

6.6 Characters

yes

6.7 Strings

yes

6.8 Vectors

yes

6.9 Bytevectors

yes

6.10 Control features

yes

6.11 Exceptions

yes

6.12 Environments and evaluation

yes

6.13.1 Ports

yes

6.13.2 Input

yes

6.13.3 Output

yes

6.14 System interface

yes

+ +
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/www/libs.html b/www/libs.html new file mode 100644 index 0000000..2e1d091 --- /dev/null +++ b/www/libs.html @@ -0,0 +1,239 @@ + + + + + + + + + Standard Libraries — Picrin 0.1 documentation + + + + + + + + + + + + + + +
+
+
+
+ +
+

Standard Libraries

+

Picrin’s all built-in libraries are described below.

+
+

(picrin macro)

+

Utility functions and syntaces for macro definition.

+
    +
  • define-macro

  • +
  • gensym

  • +
  • ungensym

  • +
  • macroexpand

  • +
  • macroexpand-1

  • +
+

Old-fashioned macro.

+
    +
  • identifier?

  • +
  • identifier=?

  • +
  • make-syntactic-closure

  • +
  • close-syntax

  • +
  • capture-syntactic-environment

  • +
  • sc-macro-transformer

  • +
  • rsc-macro-transformer

  • +
+

Syntactic closures.

+
    +
  • er-macro-transformer

  • +
  • ir-macro-transformer

  • +
  • strip-syntax

  • +
+

Explicit renaming macro family.

+
+
+

(picrin array)

+

Resizable random-access list.

+

Technically, picrin’s array is implemented as a ring-buffer, effective double-ended queue data structure (deque) that can operate pushing and poping from both of front and back in constant time. In addition to the deque interface, array provides standard sequence interface similar to functions specified by R7RS.

+
    +
  • (make-array [capacity])

    +

    Returns a newly allocated array object. If capacity is given, internal data chunk of the array object will be initialized by capacity size.

    +
  • +
  • (array . objs)

    +

    Returns an array initialized with objs.

    +
  • +
  • (array? . obj)

    +

    Returns #t if obj is an array.

    +
  • +
  • (array-length ary)

    +

    Returns the length of ary.

    +
  • +
  • (array-ref ary i)

    +

    Like list-ref, return the object pointed by the index i.

    +
  • +
  • (array-set! ary i obj)

    +

    Like list-set!, substitutes the object pointed by the index i with given obj.

    +
  • +
  • (array-push! ary obj)

    +

    Adds obj to the end of ary.

    +
  • +
  • (array-pop! ary)

    +

    Removes the last element of ary, and returns it.

    +
  • +
  • (array-unshift! ary obj)

    +

    Adds obj to the front of ary.

    +
  • +
  • (array-shift! ary)

    +

    Removes the first element of ary, and returns it.

    +
  • +
  • (array-map proc ary)

    +

    Performs mapping operation on ary.

    +
  • +
  • (array-for-each proc ary)

    +

    Performs mapping operation on ary, but discards the result.

    +
  • +
  • (array->list ary)

    +

    Converts ary into list.

    +
  • +
  • (list->array list)

    +

    Converts list into array.

    +
  • +
+
+
+

(picrin dictionary)

+

Symbol-to-object hash table.

+
    +
  • (make-dictionary)

    +

    Returns a newly allocated empty dictionary.

    +
  • +
  • (dictionary . plist)

    +

    Returns a dictionary initialized with the content of plist.

    +
  • +
  • (dictionary? obj)

    +

    Returns #t if obj is a dictionary.

    +
  • +
  • (dictionary-ref dict key)

    +

    Look up dictionary dict for a value associated with key. If dict has a slot for key key, a pair containing the key object and the associated value is returned. Otherwise #f is returned.

    +
  • +
  • (dictionary-set! dict key obj)

    +

    If there is no value already associated with key, this function newly creates a binding of key with obj. Otherwise, updates the existing binding with given obj.

    +

    If obj is #undefined, this procedure behaves like a deleter: it will remove the key/value slot with the name key from the dictionary. When no slot is associated with key, it will do nothing.

    +
  • +
  • (dictionary-size dict)

    +

    Returns the number of registered elements in dict.

    +
  • +
  • (dicitonary-map proc dict)

    +

    Perform mapping action onto dictionary object. proc is called by a sequence (proc key1 key2 ...).

    +
  • +
  • (dictionary-for-each proc dict)

    +

    Similar to dictionary-map, but discards the result.

    +
  • +
  • (dictionary->plist dict)

  • +
  • (plist->dictionary plist)

  • +
  • (dictionary->alist dict)

  • +
  • (alist->dictionary alist)

    +

    Conversion between dictionary and alist/plist.

    +
  • +
+
+
+

(picrin user)

+

When you start the REPL, you are dropped into here.

+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/www/objects.inv b/www/objects.inv new file mode 100644 index 0000000..cb21f91 --- /dev/null +++ b/www/objects.inv @@ -0,0 +1,8 @@ +# Sphinx inventory version 2 +# Project: Picrin +# Version: 0.1 +# The remainder of this file is compressed using zlib. +xڅMj0 >z)t]j` +.Vl9 +LvFדT@;hx  \]|$REfԘu$QW%^]V_ly >}4A}Ui uӃ МLWX&(ݑ[ݬ#DZ-'+Jی9RqC +8Ηݨ7;ikf퓜Ӆ0vd0ģT \ No newline at end of file diff --git a/www/search.html b/www/search.html new file mode 100644 index 0000000..9cbc30e --- /dev/null +++ b/www/search.html @@ -0,0 +1,97 @@ + + + + + + + + Search — Picrin 0.1 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Search

+ + + + +

+ Searching for multiple words only shows matches that contain + all words. +

+ + +
+ + + +
+ + + +
+ +
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/www/searchindex.js b/www/searchindex.js new file mode 100644 index 0000000..654ab68 --- /dev/null +++ b/www/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({"docnames": ["capi", "deploy", "index", "intro", "lang", "libs"], "filenames": ["capi.rst", "deploy.rst", "index.rst", "intro.rst", "lang.rst", "libs.rst"], "titles": ["C API", "Installation", "Welcome to Picrin\u2019s documentation!", "Introduction", "Language", "Standard Libraries"], "terms": {"you": [0, 1, 3, 5], "can": [0, 3, 4, 5], "write": [0, 4], "picrin": [0, 1, 3, 4], "": [0, 4, 5], "yourself": 0, "from": [0, 1, 3, 5], "both": [0, 5], "side": 0, "scheme": [0, 1, 3, 4], "thi": [0, 3, 5], "page": [0, 2], "describ": [0, 5], "wai": 0, "control": [0, 4], "interpret": [0, 3], "world": 0, "If": [0, 5], "want": [0, 1], "creat": [0, 1, 5], "contribut": [0, 3], "onli": [0, 1, 3, 4], "thing": 0, "need": 0, "do": [0, 3, 5], "i": [0, 1, 3, 4, 5], "make": [0, 1, 5], "directori": [0, 1], "under": 0, "contrib": 0, "below": [0, 1, 4, 5], "sampl": 0, "code": [0, 1], "add": [0, 5], "nitro": 0, "mk": 0, "contrib_init": 0, "contrib_src": 0, "includ": [0, 1, 3, 4], "h": [0, 1], "static": 0, "pic_valu": 0, "pic_add": 0, "pic_stat": 0, "pic": 0, "doubl": [0, 4, 5], "b": [0, 4], "pic_get_arg": 0, "ff": 0, "return": [0, 4, 5], "pic_float_valu": 0, "void": 0, "pic_init_add": 0, "pic_deflibrari": 0, "pic_defun": 0, "after": 0, "recompil": 0, "avail": [0, 1, 3], "repl": [0, 2, 5], "which": 0, "provid": [0, 1, 3, 4, 5], "funciton": 0, "when": [0, 1, 5], "us": [0, 1, 3, 4], "dynam": [0, 4], "memori": 0, "alloc": [0, 5], "insid": 0, "must": 0, "case": [0, 4], "about": 0, "fortun": 0, "we": 0, "set": [0, 5], "wrapper": 0, "function": [0, 5], "complet": 0, "abstract": 0, "In": [0, 4, 5], "de": 0, "create_foo": 0, "finalize_foo": 0, "ar": [0, 1, 3, 4, 5], "wrap": 0, "pic_data": 0, "object": [0, 3, 5], "so": [0, 3, 4], "an": [0, 1, 3, 5], "instanc": 0, "foo": 0, "lost": 0, "all": [0, 3, 5], "refer": [0, 3, 4], "other": [0, 1, 3, 4], "automat": [0, 1, 4], "final": 0, "orphan": 0, "stdlib": 0, "struct": 0, "blah": 0, "malloc": 0, "sizeof": 0, "f": [0, 4, 5], "free": [0, 3], "ffi": 0, "interfac": [0, 3, 4, 5], "const": 0, "pic_data_typ": 0, "foo_typ": 0, "pic_create_foo": 0, "arg": 0, "here": [0, 3, 5], "pic_data_valu": 0, "md": 0, "pic_init_foo": 0, "instruct": 1, "just": 1, "type": [1, 4], "project": 1, "root": 1, "find": 1, "execut": 1, "binari": 1, "newli": [1, 5], "bin": 1, "x86_64": 1, "system": [1, 3, 4], "pic_nan_box": 1, "flag": 1, "turn": 1, "see": [1, 3], "config": 1, "detail": 1, "target": 1, "By": 1, "default": 1, "usr": 1, "local": 1, "sinc": 1, "doe": [1, 4], "autoconf": 1, "specifi": [1, 4, 5], "pass": 1, "custom": 1, "path": 1, "via": 1, "command": 1, "line": 1, "argument": [1, 4], "prefix": 1, "dir": 1, "To": 1, "sourc": 1, "some": [1, 4], "extern": [1, 4], "librari": [1, 2, 3, 4], "perl": 1, "regex": 1, "posix": 1, "1": [1, 4, 5], "libedit": 1, "option": 1, "mainli": 1, "develop": 1, "mac": 1, "o": [1, 4], "x": [1, 4], "test": 1, "ubuntu": 1, "14": [1, 4], "04": 1, "tri": 1, "run": 1, "platform": 1, "found": 1, "someth": 1, "wa": 1, "wrong": 1, "pleas": [1, 4], "send": [1, 3], "u": 1, "issu": 1, "content": [2, 5], "introduct": 2, "homepag": 2, "irc": 2, "licens": 2, "instal": 2, "build": 2, "requir": 2, "languag": 2, "The": [2, 3], "complianc": 2, "r7r": [2, 3, 5], "standard": 2, "macro": [2, 3, 4], "arrai": 2, "dictionari": 2, "user": 2, "c": [2, 3], "api": 2, "extens": [2, 4], "index": [2, 5], "modul": 2, "search": 2, "lightweight": 3, "implement": [3, 4, 5], "written": 3, "pure": 3, "c89": 3, "It": [3, 4], "contain": [3, 5], "reason": 3, "fast": 3, "vm": 3, "improv": 3, "hygien": [3, 4], "usu": [3, 4], "simpl": 3, "power": [3, 4], "compat": 3, "reentrant": 3, "design": [3, 4], "state": 3, "store": 3, "singl": 3, "global": 3, "bytecod": 3, "direct": 3, "thread": 3, "intern": [3, 4, 5], "represent": [3, 4], "nan": 3, "box": 3, "x64": 3, "conserv": 3, "call": [3, 4, 5], "cc": [3, 4], "stack": 3, "nativ": 3, "interleav": 3, "exact": [3, 4], "gc": 3, "mark": 3, "sweep": 3, "partial": 3, "count": 3, "string": [3, 4], "rope": 3, "transform": [3, 4, 5], "syntact": [3, 4, 5], "closur": [3, 4, 5], "explicit": [3, 4, 5], "implicit": [3, 4], "renam": [3, 4, 5], "extend": 3, "syntax": [3, 4, 5], "current": 3, "host": 3, "github": 3, "freeli": 3, "bug": 3, "report": [3, 4], "pull": 3, "request": 3, "fork": 3, "repositori": 3, "http": [3, 4], "com": 3, "readthedoc": 3, "org": [3, 4], "There": 3, "chat": 3, "room": 3, "freenod": 3, "channel": 3, "log": 3, "botbot": 3, "me": 3, "copyright": 3, "2013": 3, "2014": 3, "yuichi": 3, "nishiwaki": 3, "contributor": 3, "permiss": 3, "herebi": 3, "grant": 3, "charg": 3, "ani": 3, "person": 3, "obtain": 3, "copi": 3, "softwar": 3, "associ": [3, 5], "file": [3, 4], "deal": 3, "without": 3, "restrict": [3, 4], "limit": 3, "right": 3, "modifi": 3, "merg": 3, "publish": 3, "distribut": 3, "sublicens": 3, "sell": 3, "permit": 3, "whom": 3, "furnish": 3, "subject": 3, "follow": 3, "condit": [3, 4], "abov": 3, "notic": 3, "shall": 3, "substanti": 3, "portion": 3, "THE": 3, "AS": 3, "warranti": 3, "OF": 3, "kind": 3, "express": [3, 4], "OR": 3, "impli": 3, "BUT": 3, "NOT": 3, "TO": 3, "merchant": 3, "fit": 3, "FOR": 3, "A": [3, 4], "particular": 3, "purpos": 3, "AND": 3, "noninfring": 3, "IN": 3, "NO": 3, "event": 3, "author": 3, "holder": 3, "BE": 3, "liabl": 3, "claim": 3, "damag": 3, "liabil": 3, "whether": 3, "action": [3, 5], "contract": 3, "tort": 3, "otherwis": [3, 5], "aris": 3, "out": 3, "connect": 3, "WITH": 3, "core": 4, "visit": 4, "inform": 4, "underli": 4, "thought": 4, "At": 4, "start": [4, 5], "up": [4, 5], "time": [4, 5], "built": [4, 5], "list": [4, 5], "import": 4, "base": 4, "load": 4, "process": 4, "context": 4, "inexact": 4, "cxr": 4, "lazi": 4, "lambda": 4, "read": 4, "eval": 4, "section": 4, "statu": 4, "comment": 4, "2": 4, "whitespac": 4, "ye": 4, "3": 4, "notat": 4, "incomplet": 4, "e": 4, "d": 4, "4": 4, "datum": 4, "label": 4, "variabl": 4, "keyword": 4, "region": 4, "disjoint": 4, "storag": 4, "model": 4, "5": 4, "proper": 4, "tail": 4, "recurs": 4, "As": 4, "appli": 4, "valu": [4, 5], "perform": [4, 5], "liter": 4, "procedur": [4, 5], "self": 4, "evalu": 4, "6": 4, "assign": 4, "7": 4, "inclus": 4, "ci": 4, "bind": [4, 5], "construct": 4, "sequenc": [4, 5], "iter": 4, "delai": 4, "except": 4, "handl": 4, "guard": 4, "8": 4, "quasiquot": 4, "safe": 4, "nest": 4, "todo": 4, "multipl": 4, "unquot": 4, "9": 4, "pattern": 4, "rule": 4, "signal": 4, "error": 4, "program": 4, "declar": 4, "top": 4, "level": 4, "definit": [4, 5], "recor": 4, "reopend": 4, "exampl": 4, "n": 4, "equival": 4, "predic": 4, "numer": 4, "ha": [4, 5], "two": 4, "number": [4, 5], "fixnum": 4, "float": 4, "still": 4, "comform": 4, "spec": 4, "constant": [4, 5], "oper": [4, 5], "denomin": 4, "ration": 4, "support": 4, "now": 4, "also": 4, "complex": 4, "input": 4, "output": 4, "boolean": 4, "pair": [4, 5], "against": 4, "circular": 4, "symbol": [4, 5], "charact": 4, "vector": 4, "bytevector": 4, "10": 4, "featur": 4, "11": 4, "12": 4, "environ": [4, 5], "13": 4, "port": 4, "addit": [4, 5], "legaci": 4, "defin": [4, 5], "util": 5, "syntac": 5, "gensym": 5, "ungensym": 5, "macroexpand": 5, "old": 5, "fashion": 5, "identifi": 5, "close": 5, "captur": 5, "sc": 5, "rsc": 5, "er": 5, "ir": 5, "strip": 5, "famili": 5, "resiz": 5, "random": 5, "access": 5, "technic": 5, "ring": 5, "buffer": 5, "effect": 5, "end": 5, "queue": 5, "data": 5, "structur": 5, "dequ": 5, "push": 5, "pope": 5, "front": 5, "back": 5, "similar": 5, "capac": 5, "given": 5, "chunk": 5, "initi": 5, "size": 5, "obj": 5, "t": 5, "length": 5, "ari": 5, "ref": 5, "like": 5, "point": 5, "substitut": 5, "pop": 5, "remov": 5, "last": 5, "element": 5, "unshift": 5, "shift": 5, "first": 5, "map": 5, "proc": 5, "each": 5, "discard": 5, "result": 5, "convert": 5, "hash": 5, "tabl": 5, "empti": 5, "plist": 5, "dict": 5, "kei": 5, "look": 5, "slot": 5, "alreadi": 5, "updat": 5, "exist": 5, "undefin": 5, "behav": 5, "delet": 5, "name": 5, "noth": 5, "regist": 5, "dicitonari": 5, "onto": 5, "key1": 5, "key2": 5, "alist": 5, "convers": 5, "between": 5, "drop": 5}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"c": 0, "api": 0, "extens": 0, "librari": [0, 5], "user": [0, 5], "data": 0, "v": 0, "gc": 0, "instal": 1, "build": 1, "requir": 1, "welcom": 2, "picrin": [2, 5], "": 2, "document": [2, 3], "indic": 2, "tabl": 2, "introduct": 3, "homepag": 3, "irc": 3, "licens": 3, "languag": 4, "The": 4, "repl": 4, "complianc": 4, "r7r": 4, "standard": 5, "macro": 5, "arrai": 5, "dictionari": 5}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 57}, "alltitles": {"C API": [[0, "c-api"]], "Extension Library": [[0, "extension-library"]], "User-data vs GC": [[0, "user-data-vs-gc"]], "Installation": [[1, "installation"]], "Build": [[1, "build"]], "Install": [[1, "install"]], "Requirement": [[1, "requirement"]], "Welcome to Picrin\u2019s documentation!": [[2, "welcome-to-picrin-s-documentation"]], "Indices and tables": [[2, "indices-and-tables"]], "Introduction": [[3, "introduction"]], "Homepage": [[3, "homepage"]], "Documentation": [[3, "documentation"]], "IRC": [[3, "irc"]], "LICENSE": [[3, "license"]], "Language": [[4, "language"]], "The REPL": [[4, "the-repl"]], "Compliance with R7RS": [[4, "compliance-with-r7rs"]], "Standard Libraries": [[5, "standard-libraries"]], "(picrin macro)": [[5, "picrin-macro"]], "(picrin array)": [[5, "picrin-array"]], "(picrin dictionary)": [[5, "picrin-dictionary"]], "(picrin user)": [[5, "picrin-user"]]}, "indexentries": {}}) \ No newline at end of file