Changeset 40079 in project


Ignore:
Timestamp:
05/06/21 12:15:38 (5 weeks ago)
Author:
felix winkelmann
Message:

mdh: add flush-globals, restricted types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/mdh

    r40076 r40079  
    3232be freed using `global-free` when it is no longer required. There may be multiple
    3333references to the same global variable at the same time in existance. NAME
    34 may be of any type and will be converted to a string.
     34may be a string, symbol or number and will be converted to a string.
    3535
    3636<procedure>(global-set! G VALUE INDEX ...)</procedure>
    3737
    3838Sets the value of the element of G represented by the given indices to VAL.
    39 VAL will be converted to a string before it is stored. INDEX may be any value
    40 and will also be converted to string. If the element doesn't exist yet for
    41 G, then it is created.
     39VAL will be converted to a string before it is stored. INDEX may be a string,
     40symbol or number and will also be converted to string. If the element doesn't exist
     41yet for G, then it is created.
    4242
    4343<procedure>(global-ref G INDEX ...)</procedure>
     
    116116with a temporarily allocated global reference.
    117117
     118<procedure>(flush-globals)</procedure>
     119
     120Flush any unwritten operations to the database and commits all pending operations.
     121
    118122<procedure>(close-globals)</procedure>
    119123
    120 Closes the database and commits all pending operations. This procedure is
     124Performs a {{flush-globals}} and closes all access to the database. This procedure is
    121125called automatically on normal exit of the process. Also see "Caveats", below.
    122126
    123127=== Caveats
    124128
    125 It is crucial to properly close the database on exit or the file holding the
     129It is crucial to properly flush or close the database on exit or the file holding the
    126130persistent data may be imcoplete or corrupted. For normal exit this is taken
    127131care of by setting {{[implicit-]exit-handler}} and handling the case when
    128132the process terminates with an error. When signals cause a process abort
    129133code wanting to properly close the database must invoke
    130 {{close-globals}} explicitly.
     134{{flush-globals}} or {{close-globals}} explicitly.
    131135
    132136Stored values and index strings can be at most 10000 bytes long.
Note: See TracChangeset for help on using the changeset viewer.