2.6 Betaenv

Betaenv is a fragment defining a pattern that currently encloses all BETA code being compiled and executed by the Mjølner System. This means that each program execution creates a new betaenv object. Patterns described in different programs will thus never be identical, since they will always directly or indirectly be attributes of the betaenv instance created by the program execution. Cf. the above discussion.

To overcome this problem, the persistentstore treats all betaenv instances as if they were actually the same object, although in practice a new instance is created in each program execution. For example, consider the following library fragment:


ORIGIN 'betaenv'
  A: (# ... #);
  B: (# ... #);

If mylib.bet is included by two or more different programs, then the pattern A will logically be the same pattern in both programs, since it is an attribute of the same betaenv object in all the corresponding program executions. The same is of course true for B and any other pattern declared in mylib.bet

Patterns used for generating persistent objects should normally be defined in the lib:attributes library slot as in mylib above.

However, by using the support for special objects as described in a later section, it is possible to obtain the same treatment of other patterns as just described for betaenv, i.e. treating instances of the pattern in different program executions as logically the same object. This also allows patterns used for generating persistent objects to be declared in attribute slots different from lib:attributes.

Persistence in BETA - Reference Manual
© 1991-2002 Mjølner Informatics
[Modified: Monday October 23rd 2000 at 10:43]