picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

refJ.html (2577B)


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