add libs.rst
This commit is contained in:
parent
2c97e14295
commit
94e2bc295b
|
@ -13,6 +13,7 @@ Contents:
|
||||||
|
|
||||||
intro.rst
|
intro.rst
|
||||||
lang.rst
|
lang.rst
|
||||||
|
libs.rst
|
||||||
|
|
||||||
Indices and tables
|
Indices and tables
|
||||||
==================
|
==================
|
||||||
|
|
101
docs/lang.rst
101
docs/lang.rst
|
@ -1,106 +1,7 @@
|
||||||
Language
|
Language
|
||||||
========
|
========
|
||||||
|
|
||||||
The language provided by picrin.
|
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.
|
||||||
|
|
||||||
Libraries
|
|
||||||
---------
|
|
||||||
|
|
||||||
- ``(scheme base)``
|
|
||||||
- ``(scheme write)``
|
|
||||||
- ``(scheme cxr)``
|
|
||||||
- ``(scheme file)``
|
|
||||||
- ``(scheme inexact)``
|
|
||||||
- ``(scheme time)``
|
|
||||||
- ``(scheme process-context)``
|
|
||||||
- ``(scheme load)``
|
|
||||||
- ``(scheme lazy)``
|
|
||||||
- ``(picrin macro)``
|
|
||||||
|
|
||||||
- ``define-macro``
|
|
||||||
- ``gensym``
|
|
||||||
- ``macroexpand``
|
|
||||||
|
|
||||||
Old-fashioned macro.
|
|
||||||
|
|
||||||
- ``make-syntactic-closure``
|
|
||||||
- ``identifier?``
|
|
||||||
- ``identifier=?``
|
|
||||||
|
|
||||||
Syntactic closures.
|
|
||||||
|
|
||||||
- ``er-macro-transformer``
|
|
||||||
- ``ir-macro-transformer``
|
|
||||||
|
|
||||||
Explicit renaming macro family.
|
|
||||||
|
|
||||||
- ``(picrin regexp)``
|
|
||||||
|
|
||||||
- ``(regexp? obj)``
|
|
||||||
- ``(regexp ptrn [flags])``
|
|
||||||
|
|
||||||
Compiles pattern string into a regexp object. A string ``flags`` may contain any of #\g, #\i, #\m.
|
|
||||||
|
|
||||||
- ``(regexp-match re input)``
|
|
||||||
|
|
||||||
Returns two values: a list of match strings, and a list of match indeces.
|
|
||||||
|
|
||||||
- ``(regexp-replace re input txt)``
|
|
||||||
- ``(regexp-split re input)``
|
|
||||||
|
|
||||||
- ``(picrin control)``
|
|
||||||
|
|
||||||
- ``(reset h)``
|
|
||||||
- ``(shift k)``
|
|
||||||
|
|
||||||
Delimited control operators.
|
|
||||||
|
|
||||||
- ``(picrin dictionary)``
|
|
||||||
|
|
||||||
Symbol to Object table. Internally it is implemented on hash-table.
|
|
||||||
|
|
||||||
Note that dictionary is not a weak map; if you are going to make a highly memory-consuming program with dictionaries, you should know that dictionaries keep their bound objects and never let them free until you explicitly deletes bindings.
|
|
||||||
|
|
||||||
- ``(dictionary)``
|
|
||||||
|
|
||||||
Returns a newly allocated empty dictionary. In the future, it is planned to extend this function to take optional arguments for initial key/values.
|
|
||||||
|
|
||||||
- ``(dictionary? obj)``
|
|
||||||
|
|
||||||
Returns ``#t`` if obj is a dictionary.
|
|
||||||
|
|
||||||
- ``(dictionary-ref dict key)``
|
|
||||||
|
|
||||||
Look up dictionary dict for a value associated with symbol key. If no object is associated with key, it will raise an error.
|
|
||||||
|
|
||||||
- ``(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.
|
|
||||||
|
|
||||||
- ``(dictionary-delete dict key)``
|
|
||||||
|
|
||||||
Deletes the binding associated with key from dict. If no binding on dict is associated with key, an error will be raised.
|
|
||||||
|
|
||||||
|
|
||||||
- ``(dictionary-size dict)``
|
|
||||||
|
|
||||||
Returns the number of registered elements in dict.
|
|
||||||
|
|
||||||
- ``(picrin user)``
|
|
||||||
|
|
||||||
When you start the REPL, you are dropped into here.
|
|
||||||
|
|
||||||
- ``(srfi 1)``
|
|
||||||
|
|
||||||
List manipulation library.
|
|
||||||
|
|
||||||
- ``(srfi 26)``
|
|
||||||
|
|
||||||
Cut/cute macros.
|
|
||||||
|
|
||||||
- ``(srfi 95)``
|
|
||||||
|
|
||||||
Sorting and Marging.
|
|
||||||
|
|
||||||
The REPL
|
The REPL
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -0,0 +1,116 @@
|
||||||
|
Libraries
|
||||||
|
=========
|
||||||
|
|
||||||
|
Picrin's all built-in libraries are described below.
|
||||||
|
|
||||||
|
Scheme standard libraries
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
- (scheme write)
|
||||||
|
- (scheme cxr)
|
||||||
|
- (scheme file)
|
||||||
|
- (scheme inexact)
|
||||||
|
- (scheme time)
|
||||||
|
- (scheme process-context)
|
||||||
|
- (scheme load)
|
||||||
|
- (scheme lazy)
|
||||||
|
|
||||||
|
SRFI libraries
|
||||||
|
--------------
|
||||||
|
|
||||||
|
- (srfi 1)
|
||||||
|
|
||||||
|
List manipulation library.
|
||||||
|
|
||||||
|
- (srfi 26)
|
||||||
|
|
||||||
|
Cut/cute macros.
|
||||||
|
|
||||||
|
- (srfi 95)
|
||||||
|
|
||||||
|
Sorting and Marging.
|
||||||
|
|
||||||
|
|
||||||
|
Macros
|
||||||
|
------
|
||||||
|
|
||||||
|
(picrin macro)
|
||||||
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
- define-macro
|
||||||
|
- gensym
|
||||||
|
- macroexpand
|
||||||
|
|
||||||
|
Old-fashioned macro.
|
||||||
|
|
||||||
|
- make-syntactic-closure
|
||||||
|
- identifier?
|
||||||
|
- identifier=?
|
||||||
|
|
||||||
|
Syntactic closures.
|
||||||
|
|
||||||
|
- er-macro-transformer
|
||||||
|
- ir-macro-transformer
|
||||||
|
|
||||||
|
Explicit renaming macro family.
|
||||||
|
|
||||||
|
(picrin regexp)
|
||||||
|
^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
- (regexp? obj)
|
||||||
|
- (regexp ptrn [flags])
|
||||||
|
|
||||||
|
Compiles pattern string into a regexp object. A string flags may contain any of #\g, #\i, #\m.
|
||||||
|
|
||||||
|
- (regexp-match re input)
|
||||||
|
|
||||||
|
Returns two values: a list of match strings, and a list of match indeces.
|
||||||
|
|
||||||
|
- (regexp-replace re input txt)
|
||||||
|
- (regexp-split re input)
|
||||||
|
|
||||||
|
(picrin control)
|
||||||
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
- (reset h)
|
||||||
|
- (shift k)
|
||||||
|
|
||||||
|
Delimited control operators.
|
||||||
|
|
||||||
|
(picrin dictionary)
|
||||||
|
^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Symbol to Object table. Internally it is implemented on hash-table.
|
||||||
|
|
||||||
|
Note that dictionary is not a weak map; if you are going to make a highly memory-consuming program with dictionaries, you should know that dictionaries keep their bound objects and never let them free until you explicitly deletes bindings.
|
||||||
|
|
||||||
|
- (dictionary)
|
||||||
|
|
||||||
|
Returns a newly allocated empty dictionary. In the future, it is planned to extend this function to take optional arguments for initial key/values.
|
||||||
|
|
||||||
|
- (dictionary? obj)
|
||||||
|
|
||||||
|
Returns #t if obj is a dictionary.
|
||||||
|
|
||||||
|
- (dictionary-ref dict key)
|
||||||
|
|
||||||
|
Look up dictionary dict for a value associated with symbol key. If no object is associated with key, it will raise an error.
|
||||||
|
|
||||||
|
- (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.
|
||||||
|
|
||||||
|
- (dictionary-delete dict key)
|
||||||
|
|
||||||
|
Deletes the binding associated with key from dict. If no binding on dict is associated with key, an error will be raised.
|
||||||
|
|
||||||
|
|
||||||
|
- (dictionary-size dict)
|
||||||
|
|
||||||
|
Returns the number of registered elements in dict.
|
||||||
|
|
||||||
|
(picrin user)
|
||||||
|
^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
When you start the REPL, you are dropped into here.
|
||||||
|
|
Loading…
Reference in New Issue