diff options
Diffstat (limited to '')
-rw-r--r-- | doc/ref/general.texi | 27 | ||||
-rw-r--r-- | doc/ref/general/base64.texi (renamed from doc/ref/guile/base64.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/bst.texi | 37 | ||||
-rw-r--r-- | doc/ref/general/crypto.texi (renamed from doc/ref/guile/crypto.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/datetime.texi (renamed from doc/ref/guile/datetime.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/glob.texi (renamed from doc/ref/guile/glob.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/graphviz.texi (renamed from doc/ref/guile/graphviz.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/io.texi | 31 | ||||
-rw-r--r-- | doc/ref/general/srfi-41.texi (renamed from doc/ref/guile/srfi-41.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/util-config.texi (renamed from doc/ref/guile/util-config.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/util-exceptions.texi (renamed from doc/ref/guile/util-exceptions.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/util-path.texi (renamed from doc/ref/guile/util-path.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/util.texi (renamed from doc/ref/guile/util.texi) | 88 | ||||
-rw-r--r-- | doc/ref/general/uuid.texi | 17 | ||||
-rw-r--r-- | doc/ref/general/xdg-basedir.texi (renamed from doc/ref/guile/xdg-basedir.texi) | 0 | ||||
-rw-r--r-- | doc/ref/general/zic.texi (renamed from doc/ref/guile/zic.texi) | 0 |
16 files changed, 100 insertions, 100 deletions
diff --git a/doc/ref/general.texi b/doc/ref/general.texi index 0b54205a..be68fca6 100644 --- a/doc/ref/general.texi +++ b/doc/ref/general.texi @@ -1,15 +1,18 @@ @node Generally Useful Utilities @chapter Generally Useful Utilities -@include guile/datetime.texi -@include guile/zic.texi -@include guile/srfi-41.texi -@include guile/util.texi -@include guile/util-path.texi -@include guile/util-config.texi -@include guile/util-exceptions.texi -@include guile/base64.texi -@include guile/xdg-basedir.texi -@include guile/glob.texi -@include guile/graphviz.texi -@include guile/crypto.texi +@include general/datetime.texi +@include general/zic.texi +@include general/srfi-41.texi +@include general/util.texi +@include general/uuid.texi +@include general/io.texi +@include general/bst.texi +@include general/util-path.texi +@include general/util-config.texi +@include general/util-exceptions.texi +@include general/base64.texi +@include general/xdg-basedir.texi +@include general/glob.texi +@include general/graphviz.texi +@include general/crypto.texi diff --git a/doc/ref/guile/base64.texi b/doc/ref/general/base64.texi index ab6bba81..ab6bba81 100644 --- a/doc/ref/guile/base64.texi +++ b/doc/ref/general/base64.texi diff --git a/doc/ref/general/bst.texi b/doc/ref/general/bst.texi new file mode 100644 index 00000000..d2bba0ff --- /dev/null +++ b/doc/ref/general/bst.texi @@ -0,0 +1,37 @@ +@node Binary Search Tree +@section Binary Search Tree + +A simple ``read only'' binary search tree. + +@defun make-tree pred? lst +Constructs a new tree. @var{pred?} should be a procedure taking the +first element of @var{lst}, along with each element, and should return +a boolean value indicating if the specific element should go in the +left or right subtree. (left subtree is ``truthy'' values). + +This operation is done recursively. +@end defun + +@defun tree-node tree +Return the value of a tree node. +@end defun + +@defun left-subtree tree +Return all ``truthy'' children of tree node. +@end defun + +@defun right-subtree tree +Return all ``falsy children of tree node. +@end defun + +@defun length-of-longest-branch tree +Get the depth of a tree. +@end defun + +@defun tree-map proc tree +Apply proc onto the value of every node in tree, keeping the structure +of the tree. + +@b{Note:} this can cause the tree to no longer be a binary search +tree, but simply a ``formless'' binary tree. +@end defun diff --git a/doc/ref/guile/crypto.texi b/doc/ref/general/crypto.texi index b9e362d3..b9e362d3 100644 --- a/doc/ref/guile/crypto.texi +++ b/doc/ref/general/crypto.texi diff --git a/doc/ref/guile/datetime.texi b/doc/ref/general/datetime.texi index 037ac8d5..037ac8d5 100644 --- a/doc/ref/guile/datetime.texi +++ b/doc/ref/general/datetime.texi diff --git a/doc/ref/guile/glob.texi b/doc/ref/general/glob.texi index 400eb1f7..400eb1f7 100644 --- a/doc/ref/guile/glob.texi +++ b/doc/ref/general/glob.texi diff --git a/doc/ref/guile/graphviz.texi b/doc/ref/general/graphviz.texi index 72817ea8..72817ea8 100644 --- a/doc/ref/guile/graphviz.texi +++ b/doc/ref/general/graphviz.texi diff --git a/doc/ref/general/io.texi b/doc/ref/general/io.texi new file mode 100644 index 00000000..8c83ddcf --- /dev/null +++ b/doc/ref/general/io.texi @@ -0,0 +1,31 @@ +@node IO operations +@section IO + +Provided by module @code{(hnh util io)}. + +@defun open-input-port path +@defunx open-output-port path +Like @code{open-*-file}, but ``-'' gives @code{standard-@{input,output@}}. +@end defun + +@defun read-lines port +Return a list of all lines read from port. +@end defun + +@defun with-atomic-output-to-file filename thunk +Same functionality as the regular @var{with-output-to-file}, but +with the difference that either everything is written, or nothing +is written, and if anything is written it's all written atomicaly at +once (the original file will never contain an intermidiate state). +Does NOT handle race conditions between threads. + +propagates the return value of @var{thunk} upon successfully writing +the file, and @code{#f} otherwise. +@end defun + +@defun call-with-tmpfile proc [#:tmpl ``/tmp/file-XXXXXXX''] +@end defun + +@defun read-file path +Open file at path, and return its content as a string. +@end defun diff --git a/doc/ref/guile/srfi-41.texi b/doc/ref/general/srfi-41.texi index d8020ecc..d8020ecc 100644 --- a/doc/ref/guile/srfi-41.texi +++ b/doc/ref/general/srfi-41.texi diff --git a/doc/ref/guile/util-config.texi b/doc/ref/general/util-config.texi index 2e197bcc..2e197bcc 100644 --- a/doc/ref/guile/util-config.texi +++ b/doc/ref/general/util-config.texi diff --git a/doc/ref/guile/util-exceptions.texi b/doc/ref/general/util-exceptions.texi index 34ba33f9..34ba33f9 100644 --- a/doc/ref/guile/util-exceptions.texi +++ b/doc/ref/general/util-exceptions.texi diff --git a/doc/ref/guile/util-path.texi b/doc/ref/general/util-path.texi index 384915ef..384915ef 100644 --- a/doc/ref/guile/util-path.texi +++ b/doc/ref/general/util-path.texi diff --git a/doc/ref/guile/util.texi b/doc/ref/general/util.texi index d4dce3a6..bae19987 100644 --- a/doc/ref/guile/util.texi +++ b/doc/ref/general/util.texi @@ -357,91 +357,3 @@ Port of Common Lisp's @code{begin1} form. Like @code{begin} runs each form in its body in order, but returns the first result instead of the last. @end defmac - -@node UUIDs -@section UUID generation - -Provided by module @code{(hnh util uuid)}. - -@defun uuid-v4 -Generates a UUID-v4 string. -@end defun - -@defun uuid -Generates an implementation defined (but guaranteed valid) UUID. -@end defun - -@deftp {parameter} seed -Guile parameter containing the seed used when generating UUID's in -this module. Only set this when you want non-random randomness. -@end deftp - -@node IO operations -@section IO - -Provided by module @code{(hnh util io)}. - -@defun open-input-port path -@defunx open-output-port path -Like @code{open-*-file}, but ``-'' gives @code{standard-@{input,output@}}. -@end defun - -@defun read-lines port -Return a list of all lines read from port. -@end defun - -@defun with-atomic-output-to-file filename thunk -Same functionality as the regular @var{with-output-to-file}, but -with the difference that either everything is written, or nothing -is written, and if anything is written it's all written atomicaly at -once (the original file will never contain an intermidiate state). -Does NOT handle race conditions between threads. - -propagates the return value of @var{thunk} upon successfully writing -the file, and @code{#f} otherwise. -@end defun - -@defun call-with-tmpfile proc [#:tmpl ``/tmp/file-XXXXXXX''] -@end defun - -@defun read-file path -Open file at path, and return its content as a string. -@end defun - -@node Binary Search Tree -@section Binary Search Tree - -A simple ``read only'' binary search tree. - -@defun make-tree pred? lst -Constructs a new tree. @var{pred?} should be a procedure taking the -first element of @var{lst}, along with each element, and should return -a boolean value indicating if the specific element should go in the -left or right subtree. (left subtree is ``truthy'' values). - -This operation is done recursively. -@end defun - -@defun tree-node tree -Return the value of a tree node. -@end defun - -@defun left-subtree tree -Return all ``truthy'' children of tree node. -@end defun - -@defun right-subtree tree -Return all ``falsy children of tree node. -@end defun - -@defun length-of-longest-branch tree -Get the depth of a tree. -@end defun - -@defun tree-map proc tree -Apply proc onto the value of every node in tree, keeping the structure -of the tree. - -@b{Note:} this can cause the tree to no longer be a binary search -tree, but simply a ``formless'' binary tree. -@end defun diff --git a/doc/ref/general/uuid.texi b/doc/ref/general/uuid.texi new file mode 100644 index 00000000..78674763 --- /dev/null +++ b/doc/ref/general/uuid.texi @@ -0,0 +1,17 @@ +@node UUIDs +@section UUID generation + +Provided by module @code{(hnh util uuid)}. + +@defun uuid-v4 +Generates a UUID-v4 string. +@end defun + +@defun uuid +Generates an implementation defined (but guaranteed valid) UUID. +@end defun + +@deftp {parameter} seed +Guile parameter containing the seed used when generating UUID's in +this module. Only set this when you want non-random randomness. +@end deftp diff --git a/doc/ref/guile/xdg-basedir.texi b/doc/ref/general/xdg-basedir.texi index 2d3b2972..2d3b2972 100644 --- a/doc/ref/guile/xdg-basedir.texi +++ b/doc/ref/general/xdg-basedir.texi diff --git a/doc/ref/guile/zic.texi b/doc/ref/general/zic.texi index 5af36fd3..5af36fd3 100644 --- a/doc/ref/guile/zic.texi +++ b/doc/ref/general/zic.texi |