picolisp

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

db (3531B)


      1    Max DB-Size: 7 digits -> 2**42 (4 Tera) Blocks
      2       Blocksize 64 -> (2**48 Bytes (256 TB))
      3 
      4    Tree
      5       NIL               -> (val *DB)
      6       {x}               -> (val '{x})
      7       (var . {x})       -> (get '{x} 'var)
      8       (var . +Cls)      -> (get *DB '+Cls 'var)
      9       (var +Cls . {x})  -> (get '{x} '+Cls 'var)
     10 
     11    B-Tree root:
     12       (cnt . node)
     13 
     14    B-Tree node:
     15       (less (key more . value) (key more . value) ..)
     16 
     17    Per node
     18       <Link> BEG EXTERN <6> .. NIX
     19       6+1+1+6+1 = 15
     20 
     21    Per key
     22       BEG TRANSIENT <key> EXTERN <7> DOT EXTERN <7>
     23       1+1+<key>+1+6+1+1+7 = 18 + <key>
     24 
     25 
     26    Key Arguments for DB- and Pilog-functions:
     27 
     28       123, {abc}        -> (123) (123 . T)
     29       T                 -> All
     30       "abc"             -> ("abc") ("abcT" . T)
     31 
     32       (a b)             -> (a b) (a b . T)
     33       ((a 1) b 2)       -> (a 1) (b 2 . T)
     34       ((1 . 3) (4 . 7)) -> (33 . 61)
     35 
     36       (a . b)           -> (a) (b . T)
     37       (b . a)           -> (b . T) (a)
     38 
     39 
     40    loaded/dirty/deleted
     41 
     42             |                 |                 |                 |
     43             |       (1)       |       (2)       |       (3)       |
     44             |                 |                 |                 |
     45    ---------+-----------------+-----------------+-----------------+
     46             |  load           |  load           |  empty          |
     47     NIL     |  -> loaded      |  -> dirty       |  -> deleted     |
     48             |                 |                 |                 |
     49    ---------+-----------------+-----------------+-----------------+
     50             |                 |                 |  empty          |
     51     loaded  |                 |  -> dirty       |  -> deleted     |
     52             |                 |                 |                 |
     53    ---------+-----------------+-----------------+-----------------+
     54             |                 |                 |  empty          |
     55     dirty   |                 |                 |  -> deleted     |
     56             |                 |                 |                 |
     57    ---------+-----------------+-----------------+-----------------+
     58             |                 |                 |                 |
     59     deleted |                 |                 |                 |
     60             |                 |                 |                 |
     61 
     62 
     63                 |                 |                 |
     64                 |     commit      |    rollback     |
     65                 |                 |                 |
     66    -------------+-----------------+-----------------+
     67                 |                 |                 |
     68         NIL     |                 |                 |
     69                 |                 |                 |
     70    -------------+-----------------+-----------------+
     71                 |                 |  empty          |
     72     (1) loaded  |                 |  -> NIL         |
     73                 |                 |                 |
     74    -------------+-----------------+-----------------+
     75                 |  save           |  empty          |
     76     (2) dirty   |  -> loaded      |  -> NIL         |
     77                 |                 |                 |
     78    -------------+-----------------+-----------------+
     79                 |  empty          |  empty          |
     80     (3) deleted |  -> NIL         |  -> NIL         |
     81                 |                 |                 |
     82 
     83 
     84 
     85    +-----+-----+
     86    | V1  |  |  |
     87    +-----+--+--+
     88             |
     89             V
     90          +-----+-----+     +-----+-----+
     91          | P1  |  ---+---> |  N  |  ---+---> @@
     92          +-----+-----+     +-----+-----+