A_Variable
A_Variable is an interface that specifies the behavior specific to Avail variables that an AvailObject must implement. It's a sub-interface of A_BasicObject, the interface that defines the behavior that all AvailObjects are required to support.
Author
Mark van Gulik
Types
Functions
Add the specified chunk to the receiver's set of dependent chunks.
Add a write reactor to the variable and associate it with the specified key (for subsequent removal).
Extract the map from this variable, add the key → value binding to it, and write it back into the variable.
Extract the map from this variable, remove the key if present, and write it back into the variable.
Turn the receiver into an indirection to the specified object.
Clear the variable. This causes the variable to have no value, and subsequent attempts to get the value of this variable will fail.
Utility method for decomposing this object in the debugger.
Retrieve the object's {@linkplain AbstractDescriptor descriptor}.
Answer whether the receiver and the argument, both A_BasicObjects, are equal in value.
{@inheritDoc}
Answer whether the receiver, an object, and the argument, a byte string, are equal in value.
Answer whether the receiver, an object, and the argument, a byte tuple, are equal in value.
Answer whether the arguments, an object and a compiled code, are equal.
Answer whether the receiver equals the argument.
Answer whether the receiver equals the argument.
Determine whether the receiver is an enumeration with the given set of instances.
Answer whether the receiver, an object, and the argument, a fiber type, are equal in value.
Answer whether the receiver, an object, and the argument, a function type, are equal.
Answer whether the receiver equals the argument.
Answer whether this value equals the given list phrase type.
Answer whether the receiver equals the argument.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
Answer whether the receiver equals the argument.
Read the variable's value, add the addend to it, and store it back into the variable. This sequence of operations is protected by a lock if the variable is potentially shared among multiple Avail fibers. Fail if the variable had no value, if the variable's content type is not a subtype of the extended integers, if the addend is not an extended integer, if the sum of the old value and the addend is undefined (e.g., ∞ plus -∞), or if the sum does not satisfy the variable's write type. Return the previous value.
Extract a field from an object.
Extract a field from an object, using a one-based index into the field slots. This requires knowledge of the ObjectLayoutVariant, since the same field is at different indices in different variants.
Extract a field from an object, or answer null if it's not present.
Add or replace a field of an object.
Extract a field type from an object type.
Extract a field type from an object type, using the given field index, which is specific to an ObjectLayoutVariant.
Extract a field type from an object type, or null if it's not present.
Read the variable's value and set it to the new value. Answer the old value. Fail if the new value is not suitable for the variable, or if the variable had no value. Ensure that the entire operation runs atomically with respect to other reads and writes of the variable. Use information about whether the variable is potentially shared between Avail fibers to determine whether locking operations are needed.
Extract the current value of the variable. Fail if the variable has no value.
Extract the current value of the variable. Fail if the variable has no value. Clear the variable afterward.
Read the current value of a variable without tripping any observerless mechanisms or checks. If the variable is unassigned, answer nil.
Only applicable to global variables. Answer the module in which it's defined.
Only applicable to global variables. Answer the name of this global variable or constant.
Dispatch to the descriptor.
Answer the number of integer slots. All variable integer slots occur following the last fixed integer slot.
Dispatch to the descriptor.
Dispatch to the descriptor.
Extract the variable's kind. This is always a variable type.
Dispatch to the descriptor.
The receiver is marked with an IMMUTABLE descriptor, but its subobjects have not yet been made immutable. Scan them now, and do any additional fix-ups necessary for the kind of object.
Dispatch to the descriptor.
The receiver is marked with a SHARED descriptor, but its subobjects have not yet been made shared. Scan them now, and do any additional fix-ups necessary for the kind of object.
Dispatch to the descriptor.
Dispatch to the descriptor.
Answer a name suitable for labeling a field containing this object.
Answer the number of object slots in this AvailObject. All variable object slots occur following the last fixed object slot.
Recursively print the receiver to the builder unless it is already present in the recursionMap. Printing will begin at the specified indent level, measured in horizontal tab characters.
Remove the specified chunk from the receiver's set of dependent chunks.
Remove the write reactor associated with the specified key from the variable.
Dispatch to the descriptor.
Answer whether the objects occupy the same memory addresses.
Dispatch to the descriptor.
Replace the object's {@linkplain AbstractDescriptor descriptor}.
Dispatch to the descriptor.
Replace my descriptor field with a FillerDescriptor. This blows up for most messages, catching incorrect (all, by definition) further accidental uses of this object.
Assign the given value to the variable. Fail if the value does not have a type suitable for the variable.
Assign the given value to the variable. The client should ensure that the value is acceptable for the variable.
Set whether this write-once variable was initialized from an expression which is stable – always produces the same value (modulo loading of modules) and has no side-effects.
Answer whether to show value-specific content in the file name for the debugger.
Follow indirections until a non-indirection is reached. Replace each indirection's target with the ultimate target.
Follow indirections until a non-indirection is reached. Replace each indirection's target with the ultimate target, even if it would cause the otherwise-forbidden immutable->mutable references. Only used during makeImmutable.
Follow indirections until a non-indirection is reached. Replace each indirection's target with the ultimate target, even if it would cause the otherwise-forbidden shared->unshared references. Only used during makeShared.
Answer the set of write reactorfunctions that have not previously activated.
Answer whether this variable is both a write-once variable and initialized from an expression which is stable – always produces the same value (modulo loading of modules) and has no side-effects.
Answer the number of variable integer slots in this object. This does not include the fixed integer slots.
Test whether the map in this variable has the specified key.
Answer the number of variable object slots in this AvailObject. This does not include the fixed object slots.
Properties
Is the receiver an Avail extended integer?
Is the receiver an Avail IntTupleDescriptor? This is conservative, in that some object tuples may only contain ints but not be reported as being int tuples.
Is the receiver an Avail LongTupleDescriptor? This is conservative, in that some object tuples may only contain longs but not be reported as being long tuples.
Is the receiver an Avail two-byte string?
Is the receiver an Avail unsigned byte?