Introduction
This will be integrated with the material at (formative,design).
This introduces an old idea originally described in (formative,ood) which will play a role in the implementation of the .design. This section constitutes a bottom-up design effort for the .design.
We introduce here the terms "value", "value key" and "value object".
Another key to the same object may not have this relationship with the object. A factory requestor's key and the factory form a value-key, value-object pair. But a factory builder's key and the factory do not form such a pair because a use of the builder's key influences subsequent uses of that key.
Two factories with the same domain creator, components, ordinals etc. represent the same value but are different objects. There are two objects but just one value.
The value object has been called an "immutable object" elsewhere.
Build value objects as they are required,
Provide access to value objects,
Keep track of requirements for a particular value object,
Delete value objects when they are not currently required and when space is needed,
Delete value objects when their values are obsolete (as an indirect consequence of a change in the definition of a value),
Register and enforce commitments to continue supporting values.
Provide an "ownership" relation that will serve to account for space and for negotiating ownership of and responsibility for a value.
Ensure that all sources are available for the software. Some sort of "escrow" is thus provided.
There are these types of object which together provide the producer function: the SP, the SPD, the SS and the MO. These objects are referred to collectively as "SO"s.
An SP knows when there is a value object currently in existence representing its value. When there is none, the SP creates the value object on demand. The SP will provide a copy of the value key to the value object.
The value for an SP may change when that SP or one of the supporting SP's are modified.
SP scripts:
These scripts are pure data. That is to say that they have no authority in them. They can only invoke the authority that is passed to them by the SP. They are thus copyable.
A key to the SP allows one to: ask for a value key to the value object, lock or unlock the value object.
While the object is locked the SP won't delete it. {N.B. The object lock won't protect from value changes which "obsolete" the value and its object})
When an SP decides to build its value object, it calls v(c[0]) {(v-def)} passing a key, Vref. This call yields the value key to the new value object. Vref provides access to v(c[i]) for specified i and to v(c) where c is any of the comps accessible thru this SP's MO.
The value objects that are called for via Vref are value locked. Upon the return from the function those comps that aren't lasting are unlocked. Those that are lasting are unlocked only when this SP's object is deleted.
Calls on an SP can lock and unlock the value. The value will not change while it is locked. Calls that would change an SP's value will be refused if its value is locked or if the SP indirectly supports a value-locked SP.
There is an SPD called rootspd.
If sx is an SO then for some n >= 0 there is a {unique} sequence (s(0), s(1), ... s(n)) such that s(0) = rootspd and s(n) = sx and for each i < n, there is a name m such that N(s(i),m) = s(i+1).
If N(s,n) = N(t,m) then s=t and n=m. {The tree has no "joins".}
{Each SO has just one tree path name.}
a list of MO keys {which serve as directory extensions}.
Reason for MO
A design is a representation of a program that may wish to use the local supernode {or whatever}. This is necessary if the design is carried to another Gnosis. In this case it is not meaningful to bring your keys with you. The MO provides the space in which to find the local supernode factory. He who holds keys to the design has the code, not merely the service of the code. There is no way of preventing him from changing it. The MO provides the convenient way to symbolically bind these values.
SS's are created in SPD's and thus enjoy the durability attributes found there.
The position of the SS in the scheme of things
Another consideration arises when a copy of a value-locked SP is made. The copy will contain a reference to a virtual copy of any SS that the original contained a reference to. Simple minded editing of such a segment results in changing most of the pages, thus losing the design advantage of the VCSK. An editor and OS reader that believes a threaded text representation solves this dilemma.
Producer Example
Our first task is to define a value to correspond to the text deck. Note that this is a bit of detail that the normal developer would hopefully not need to cope with. We hope that after we have coped here with this detail we can hide it within a higher function, and all within the scope of the producer.
Assume a comp {perhaps primitive} that takes a segment key and a bank and returns a segment built of that bank containing the text deck for the source in the supplied segment.
From this comp we build an SP that takes a smart segment as a parameter(?).
The idea is to have a palpable object {such as the smart producer} that can produce some other object that embodies some fixed base value. Having an SP may be better than having the base object itself for reasons such as:
The SP might be transportable to other Gnosis systems.
If the base value is immutable then the SP might at times lend access to an object for that value which it keeps.
To an SP there are a variety of keys providing authority such as:
Read access to all internals including keys to SP components (which are keys).
The above idea immediately suggests a variable SP that represents a changing value. Such changes may be either fewer bugs or new features. This would be especially useful while debugging code that either directly or indirectly supports the value. Such SP's would seem not to be transportable!
Is the difference between these two ideas the same as the difference between "REAL" and "REF REAL"?