8 Patterns and Variables

In this section, we get a bit more formal with the BETA way of expressing object-oriented concepts. This section treats topics from chapter 3 of the BETA Book but with a slightly different approach.

Often object-oriented concepts are summarized as follows:

Actually, in this section, we will only talk about points 2 and 3. Point 1 is included for completeness and point 4 is not covered in this tutorial (see the BETA language introduction [MIA 94-26] or the BETA book [MMN 93]). Point 5 will be covered later.

In BETA, objects are described by a syntactic construct called an object-descriptor (or descriptor for short). This has the form:

(# ... #)

and is used to specify the local attributes and actions of an object (or class of objects).

An unusual feature of the BETA object-descriptor (compared to other object-oriented languages) is that, with enter and exit lists, it introduces the notion of value for objects. The different facets of an object are defined by the various (optional) parts of the object description:

(# <declarations>
enter <input list>
do    <imperatives>
exit  <output list>

This single concept of descriptor has been used to replace many diverse concepts that we are familiar with from traditional languages. In particular, it is used for procedures, functions, types, classes, macros and local blocks. These different roles are achieved by using the descriptor in different contexts, by combining it with other operators or by selective use of the internal parts.

Libraries Tutorial
© 1994-2002 Mjølner Informatics
[Modified: Thursday October 19th 2000 at 14:10]