<commit_before><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>B</title>
<link rel="stylesheet" href="doc.css" type="text/css">
</head>
<body>

<h1>B</h1>

<dl>

<dt><a name="*Blob"><code>*Blob</code></a>
<dd>A global variable holding the pathname of the database blob directory. See
also <code><a href="refB.html#blob">blob</a></code>.

<pre><code>
: *Blob
-> "blob/app/"
</code></pre>

<dt><a name="*Bye"><code>*Bye</code></a>
<dd>A global variable holding a (possibly empty) <code>prg</code> body, to be
executed just before the termination of the PicoLisp interpreter. See also
<code><a href="refB.html#bye">bye</a></code> and <code><a
href="refT.html#tmp">tmp</a></code>.

<pre><code>
: (push1 '*Bye '(call 'rm "myfile.tmp"))  # Remove a temporary file
-> (call 'rm "myfile.tmp")
</code></pre>

<dt><a name="+Bag"><code>+Bag</code></a>
<dd>Class for a list of arbitrary relations, a subclass of <code><a
href="refR.html#+relation">+relation</a></code>. Objects of that class maintain
a list of heterogeneous relations. Typically used in combination with the
<code><a href="refL.html#+List">+List</a></code> prefix class, to maintain small
two-dimensional tables within objects. See also <a
href="ref.html#dbase">Database</a>.

<pre><code>
(rel pos (+List +Bag)         # Positions
   ((+Ref +Link) NIL (+Item))    # Item
   ((+Number) 2)                 # Price
   ((+Number))                   # Quantity
   ((+String))                   # Memo text
   ((+Number) 2) )               # Total amount
</code></pre>

<dt><a name="+Blob"><code>+Blob</code></a>
<dd>Class for blob relations, a subclass of <code><a
href="refR.html#+relation">+relation</a></code>. Objects of that class maintain
blobs, as stubs in database objects pointing to actual files for arbitrary
(often binary) data. The files themselves reside below the path specified by the
<code><a href="refB.html#*Blob">*Blob</a></code> variable. See also <a
href="ref.html#dbase">Database</a>.

<pre><code>
(rel jpg (+Blob))  # Picture
</code></pre>

<dt><a name="+Bool">+Bool<code></code></a>
<dd>Class for boolean relations, a subclass of <code><a
href="refR.html#+relation">+relation</a></code>. Objects of that class expect
either <code>T</code> or <code>NIL</code> as value (though, as always, only
non-<code>NIL</code> will be physically stored in objects). See also <a
href="ref.html#dbase">Database</a>.

<pre><code>
(rel ok (+Ref +Bool))  # Indexed flag
</code></pre>

<dt><a name="balance"><code>(balance 'var 'lst ['flg])</code></a>
<dd>Builds a balanced binary <code><a href="refI.html#idx">idx</a></code> tree
in <code>var</code>, from the sorted list in <code>lst</code>. Normally (if
random or, in the worst case, ordered data) are inserted with <code>idx</code>,
the tree will not be balanced. But if <code>lst</code> is properly sorted, its
contents will be inserted in an optimally balanced way. If <code>flg</code> is
non-<code>NIL</code>, the index tree will be augmented instead of being
overwritten. See also <code><a href="ref.html#cmp">Comparing</a></code> and
<code><a href="refS.html#sort">sort</a></code>.

<pre><code>
# Normal idx insert
: (off I)
-> NIL
: (for X (1 4 2 5 3 6 7 9 8) (idx 'I X T))
-> NIL
: (depth I)
-> 7

# Balanced insert
: (balance 'I (sort (1 4 2 5 3 6 7 9 8)))
-> NIL
: (depth I)
-> 4

# Augment<commit_msg>Minor doc fix<commit_after><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>B</title>
<link rel="stylesheet" href="doc.css" type="text/css">
</head>
<body>

<h1>B</h1>

<dl>

<dt><a name="*Blob"><code>*Blob</code></a>
<dd>A global variable holding the pathname of the database blob directory. See
also <code><a href="refB.html#blob">blob</a></code>.

<pre><code>
: *Blob
-> "blob/app/"
</code></pre>

<dt><a name="*Bye"><code>*Bye</code></a>
<dd>A global variable holding a (possibly empty) <code>prg</code> body, to be
executed just before the termination of the PicoLisp interpreter. See also
<code><a href="refB.html#bye">bye</a></code> and <code><a
href="refT.html#tmp">tmp</a></code>.

<pre><code>
: (push1 '*Bye '(call 'rm "myfile.tmp"))  # Remove a temporary file
-> (call 'rm "myfile.tmp")
</code></pre>

<dt><a name="+Bag"><code>+Bag</code></a>
<dd>Class for a list of arbitrary relations, a subclass of <code><a
href="refR.html#+relation">+relation</a></code>. Objects of that class maintain
a list of heterogeneous relations. Typically used in combination with the
<code><a href="refL.html#+List">+List</a></code> prefix class, to maintain small
two-dimensional tables within objects. See also <a
href="ref.html#dbase">Database</a>.

<pre><code>
(rel pos (+List +Bag)         # Positions
   ((+Ref +Link) NIL (+Item))    # Item
   ((+Number) 2)                 # Price
   ((+Number))                   # Quantity
   ((+String))                   # Memo text
   ((+Number) 2) )               # Total amount
</code></pre>

<dt><a name="+Blob"><code>+Blob</code></a>
<dd>Class for blob relations, a subclass of <code><a
href="refR.html#+relation">+relation</a></code>. Objects of that class maintain
blobs, as stubs in database objects pointing to actual files for arbitrary
(often binary) data. The files themselves reside below the path specified by the
<code><a href="refB.html#*Blob">*Blob</a></code> variable. See also <a
href="ref.html#dbase">Database</a>.

<pre><code>
(rel jpg (+Blob))  # Picture
</code></pre>

<dt><a name="+Bool">+Bool<code></code></a>
<dd>Class for boolean relations, a subclass of <code><a
href="refR.html#+relation">+relation</a></code>. Objects of that class expect
either <code>T</code> or <code>NIL</code> as value (though, as always, only
non-<code>NIL</code> will be physically stored in objects). See also <a
href="ref.html#dbase">Database</a>.

<pre><code>
(rel ok (+Ref +Bool))  # Indexed flag
</code></pre>

<dt><a name="balance"><code>(balance 'var 'lst ['flg])</code></a>
<dd>Builds a balanced binary <code><a href="refI.html#idx">idx</a></code> tree
in <code>var</code>, from the sorted list in <code>lst</code>. Normally (if
random or, in the worst case, ordered data) are inserted with <code>idx</code>,
the tree will not be balanced. But if <code>lst</code> is properly sorted, its
contents will be inserted in an optimally balanced way. If <code>flg</code> is
non-<code>NIL</code>, the index tree will be augmented instead of being
overwritten. See also <code><a href="ref.html#cmp">Comparing</a></code> and
<code><a href="refS.html#sort">sort</a></code>.

<pre><code>
# Normal idx insert
: (off I)
-> NIL
: (for X (1 4 2 5 3 6 7 9 8) (idx 'I X T))
-> NIL
: (depth I)
-> (7 . 4)

# Balanced insert
: (balance 'I (sort (1 4 2 5 3 6 7 9 8)))
-> NIL
: (depth I)
-> 4

# Augment
{'fraction_non_alphanumeric': 0.19350686498855835, 'fraction_numerical': 0.01272883295194508, 'mean_word_length': 4.370967741935484, 'pattern_counts': {'":': 0, '<': 283, '<?xml version=': 0, '>': 297, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '450914', 'n_tokens_mistral': 2542, 'n_tokens_neox': 2429, 'n_words': 758}