Succesfully tested at Jun 5 04:15:51 2020

Curry Package global-variables

global-variables: Handling global variables in PAKCS

This package contains a library for handling global variables in PAKCS. A global variable has a name declared in the program. Its value (a data term possibly containing free variables) can be accessed and modified by IO actions.

In contast to global entities (as defined in the library Global), global variables can contain logic variables shared with computations running in the same computation space. As a consequence, global variables cannot be persistent, their values are not kept across different program executions.

Currently, it is still experimental so that its interface might be slightly changed in the future.

A global variable g with an initial value v of type t must be declared by:

g :: GVar t
g = gvar v

Here, the type t must not contain type variables. v is the initial value for every program run.

Note: the implementation in PAKCS is based on threading a state through the execution. Thus, it might be the case that some updates of global variables are lost if fancy features like unsafe operations or debugging support are used.



Download

Checkout with CPM:
cypm checkout global-variables 1.0.0
Package source:
global-variables-1.0.0.tar.gz [browse]
Source repository:
https://git.ps.informatik.uni-kiel.de/curry-packages/global-variables.git