Signature

A Signature describes the protocol of another object.

This type is proposed to replace TypeDesc, MessageDesc, and ParamDesc; the motivation for doing so is that while TypeDesc allows for message parameters' guards to be presented, it is difficult to define the means for doing so as a miranda method; Signature is defined so as to simplify this. Furthermore, it is arguably "fewer moving parts" in that rather than having the TD/MD/PD structure imitating a subset of what Kernel-E can express, we use Kernel-E directly.

(REVIEW: Should we adopt Signature in place of TypeDesc?)

(REVIEW: What should the expansion of the nonkernel "interface" expression be, given that we eliminate MessageDesc and ParamDesc which it uses? -- MarkM suggests expanding to an ObjectExpr which is asked for its alleged type, and then twiddling it further.)

(XXX Define the Miranda __getAllegedType/0 behavior under this system precisely.)

(XXX User:Kevin Reid needs to review the experimental code and add other design decision questions to this page.)

State

 * :ObjectExpr
 * :Env
 * :List [ Signature]
 * :Signature

The most important fields of a signature are the object expr and env.

The object expr is the expression of the object which this is the signature of (or the closest approximation, if the object is not written in E), except redacted: the method and matcher bodies have been replaced with UnspecifiedExpr, a new EExpr introduced for this purpose, and the auditors ( (if under GBA) and   clauses) have been eliminated.

The environment field contains an Env with bindings for every free noun in the redacted version of the object expr. (These will mostly be guards.)

(REVIEW: This proposal therefore exposes every object mentioned in a parameter list. Is this too hazardous? (MarkM feels that the simple rule of "everything between the braces is public" (i.e. from the { of the object to the { of a method) helps.) Are there practical ways to reduce the potential harm from mentioning authority-bearing objects? (User:Kevin Reid,User:Markm,User:dtribble have discussed this 2008-08-14 and decided that nothing need be done.))

The supers field lists additional signatures of protocols which this object also implements, such as by, or explicit protocols, or multiple inheritance in objects implemented in languages providing such. The significance of the ordering of the list is left to the generator of the signature.

The miranda signature field holds a signature containing the miranda protocol in use by the E implementation hosting the object whose signature this is. This is the means provided for E programs to see the miranda protocol, and it replaces TypeDesc's approach of including the miranda MessageDescs in every __getAllegedType TypeDesc. It also might be used to detect un-translated mismatches between E system versions.

(NOTE: A planned extension is to allow type-parameterized protocols. This will be done by allowing nouns not bound in the env, but bound by a parameter list instead. Such a signature responds to get/N returning a concrete protocol.)

Maker protocol
(XXX there is no way to specify the mirandaSignature.)

asType/0
As run/3 but with the supers field being.

Protocol
Accessor; see state description.

Accessor; see state description.

Accessor; see state description.

Accessor; see state description.

Returns the fully-qualified name constructed from the environment's FQN prefix and the object expr's pattern.

(XXX Define the method of construction.)