1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
<!--
# VIP @lib/vip/html.l
# 26oct23 Software Lab. Alexander Burger
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>J</title>
<link rel="stylesheet" href="doc.css" type="text/css">
</head>
<body>
<h1>J</h1>
<dl>
<dt><a id="+Joint"><code>+Joint</code></a></dt>
<dd>Class for bidirectional object relations, a subclass of <code><a
href="refL.html#+Link">+Link</a></code>. Expects a (symbolic) attribute, a list
of classes as <code><a href="refT.html#type">type</a></code> of the referred
database object (of class <code><a href="refE.html#+Entity">+Entity</a></code>),
and two optional functions called when 'put'ting and/or 'get'ting a value. A
<code>+Joint</code> corresponds to two <code>+Link</code>s, where the attribute
argument is the relation of the back-link in the referred object. See also <a
href="ref.html#dbase">Database</a>.
<pre>
(class +Ord +Entity) # Order class
(rel pos (+List +Joint) ord (+Pos)) # List of positions in that order
...
(class +Pos +Entity) # Position class
(rel ord (+Joint) pos (+Ord)) # Back-link to the parent order
</pre></dd>
<dt><a id="job"><code>(job 'lst . prg) -> any</code></a></dt>
<dd>Executes a job within its own environment (as specified by symbol-value
pairs in <code>lst</code>). The current values of all symbols are saved, the
symbols are bound to the values in <code>lst</code>, <code>prg</code> is
executed, then the (possibly modified) symbol values are (destructively) stored
in the environment list, and the symbols are restored to their original values.
The return value is the result of <code>prg</code>. Typically used in <code><a
href="refC.html#curry">curried</a></code> functions and <code><a
href="refR.html#*Run">*Run</a></code> tasks. See also <code><a
href="refE.html#env">env</a></code>, <code><a
href="refB.html#bind">bind</a></code>, <code><a
href="refL.html#let">let</a></code>, <code><a
href="refU.html#use">use</a></code> and <code><a
href="refS.html#state">state</a></code>.
<pre>
: (de tst ()
(job '((A . 0) (B . 0))
(println (inc 'A) (inc 'B 2)) ) )
-> tst
: (tst)
1 2
-> 2
: (tst)
2 4
-> 4
: (tst)
3 6
-> 6
: (pp 'tst)
(de tst NIL
(job '((A . 3) (B . 6))
(println (inc 'A) (inc 'B 2)) ) )
-> tst
</pre></dd>
<dt><a id="journal"><code>(journal ['T] 'any ..) -> T</code></a></dt>
<dd>Reads journal data from the files with the names <code>any</code>, and
writes all changes to the database. If the first argument is <code>T</code>, the
replication journal and transaction logs are disabled. See also <code><a
href="refP.html#pool">pool</a></code>.
<pre>
: (journal "db.log")
-> T
</pre></dd>
</dl>
</body>
</html>
|