Objects vs. Values

All data in Refal Plus are represented by ground expressions and objects.

In the broad sense, object is usually understood to mean an entity that exists in time and may vary, but, nevertheless, does not lose its identity.

A good example of objects is a human, who gets born, grows up, develops, and dies, but, nevertheless, remains, in a sense, the same person.

Another classic example is due to Heraclitus (the prime of whose creative forces falls approximately on the years 504-501 BC). Heraclitus taught that one cannot enter twice the same river, since, "even if you enter the same river, the water running against you is always new". Thus, the river may also serve as a good example of objects.

In the broad sense, value is usually understood to mean an entity that is unable to vary, does not develop, and, in a sense, exists out of time.

It is unknown whether values exist in real life, but they are the favorite subject of mathematicians. For example, the number 25 is a typical value of that kind.

A value may, certainly, be regarded as a special, degenerate, case of object (i.e. as a rigid object unable to develop). Nevertheless, the term "object" will be usually applied only to "proper" objects, which are not values.

Since objects may vary, they are more difficult to deal with than values are. Thus objects are often provided with names. The basic property of names is that a name is unambiguously associated with an object (i.e. a name unambiguously identifies the object). In contrast to objects, their names are typical values, there being no changes in the names in spite of there being changes in the objects. For example, the state of the River Thames is continuously changing, but, nevertheless, it has no effect on the word "Thames". One more example is given by the particulars of a person: the family name, the first name, the date and place of birth, etc.

Within the scope of Refal Plus, the terms "object" and "value" have a more narrow sense.

A Refal Plus value is a ground expression.

A Refal Plus object is a "container", in which there can be kept ground expressions and other information.

Refal Plus objects may be created at compile time as well as at run time. Each object is created simultaneously with a reference symbol, which is said to reference to, and to be the name of, the object. The basic property of the name of an object is that it must be different from all other reference symbols existing at the moment the object is being created. Owing to this property, each reference symbol corresponds to a unique object, and equal reference symbols correspond to one and the same object.

The interrelation between the name of an object, the object, and the object's contents can be represented by the following picture:
    R --> [ ... ]