Miranda optUncall

From Erights

Jump to: navigation, search

__optUncall/0 is a Miranda message which may return a portrayal of the object receiving it.

__optUncall/0

Signature: __optUncall() :Portrayal

The miranda method for this message always returns null.

For Selfless objects, __optUncall is guaranteed to return a portrayal which exactly represents the object; if a is selfless, then a == E.call(E, "call", a.__optUncall()).

__optUncall is typically used by serialization systems for the default portrayal in the absence of other knowledge about the object.

Original Javadoc

Note: The terminology and taxonomy of this text may be outdated. XXX Update this text and integrate it into the wiki

This should return either null or a triple describing a call that, if performed, will create an object resembling this one.

Scalars (ints, float64s, chars, boolean, null) and bare Strings are atomic. __optUncall on an atomic objects return null, but atomic objects are still considered transparent. Objects which return non-null are non-atomic and transparent. Non-atomic objects that return null are opaque. Opaque objects may be selectively transparent to certain clients by implementing __optSealedDispatch as described there.

When a transparent non-atomic object is Selfless, then the result of __optUncall is guaranteed to be accurate: It describes a call that, when performed, must result in this very same object, according to E's "==" operation. The Selfless auditor ensures that all Selfless objects are accurately self-describing in this way.

The uncall of a Selfless object is canonical, so if x and y are both Selfless, then

   x == y iff x.__optUncall() == y.__optUncall()

Performing the call described by the uncall of a non-Selfless object generally creates whatever that object wished to create as its representative, but because it had to provide the ingredients, its representative could only be something it could have created. Therefore, the representative cannot convey any more authority than the original object itself has.

Personal tools
more tools