17.10 Static Information
space | |
definition | |||
|
See Annotations and Static Information for an example.
Returns a syntax object for an expression equivalent to expr_stx, but with the static information statinfo_stx attached. The statinfo_stx information must be in unpacked form (i.e., statinfo_meta.pack is applied automatically).
See Annotations and Static Information for an example.
Converts static information described by statinfo_stx into an opaque internal format. The given statinfo_stx must match the form
((key_id, val), ...)
Keys for static information are compared based on binding, not merely the key’s symbolic form. Key identifiers should be defined with statinfo.key.
See Annotations and Static Information for an example.
The inverse of statinfo_meta.pack. This function is potentially useful to parse a result from statinfo_meta.lookup for a key whose value is packed static information.
function | ||
| ||
| ||
function | ||
|
Analogous to statinfo_meta.pack and statinfo_meta.unpack, but for a sequence of static information sets, such as one set of static information per value produced by a multiple-value expression (see statinfo_meta.values_key).
An unpacked sequence is represented as a group syntax object, where each term in the group is unpacked static information in the sense of statinfo_meta.pack.
function | ||||
Takes packed arity information associated with
statinfo_meta.function_arity_key, the number of non-keyword
arguments in a function call, and a list of keywords for keyword
arguments in a function call, and reports whether the arguments are
consist with the packed arity information—
function | ||||
| ||||
| ||||
function | ||||
|
Analogous to statinfo_meta.pack and statinfo_meta.unpack, but for information that represents function-call results, where a result may be specific to different numbers of arguments. Information of this shape is used with statinfo_meta.call_result_key.
Each arity_mask has a bit set for each number of arguments where the associated statinfo_stx describes the function result. For example, a property or context parameter function may have a result that depends on the number of argument it receives. A mask of -1 indicates a result that applies for any number of arguments. Each statinfo_stx represents static information for the result in unpacked form.
function | |||
|
Finds static information for expr_stx, which might be a name with static information associated to its binding, or it might be an expression with static information associated directly. The result is a syntax object for the value associated to key in that static information, or #false if no information or value for key is available.
Keys for static information are compared based on binding, not merely the key’s symbolic form. Key identifiers should be defined with statinfo.key.
function | |||
|
function | |
| |
| |
function | |
|
definition | ||||||||
| ||||||||
| ||||||||
|
Typically, a definition statinfo.key id should be paired with a definition meta def id_key = 'id' so that id_key can be used directly as a key, instead of 'id'.
When a static information key is not an identifier bound via statinfo.key, then default union and intersection operations are used for the key’s values. The default functions use the same merge operations as statinfo_meta.call_result_key, which means that they merge nested static information.
value | |
| |
value | |
| |
value | |
| |
value | |
| |
value | |
| |
value | |
| |
value | |
| |
value | |
| |
value | |
| |
value | |
| |
value | |
| |
value | |
| |
value | |
Values that can be used to associate static information with an expression:
statinfo_meta.function_arity_key: Packed information about the number of arguments and keywords that are accepted if the result value if the expression is called as a function; see statinfo_meta.check_function_arity.
statinfo_meta.call_result_key: Packed, per-arity static information for the result value if the expression is used as a function to call; see statinfo_meta.unpack_call_result.
statinfo_meta.index_result_key: Packed static information for the result value if the expression is used with [] to access an element.
statinfo_meta.index_get_key: An identifier bound to a function to call (instead of falling back to a generic dynamic dispatch) when the expression is used with [] to access an element.
statinfo_meta.index_set_key: An identifier bound to a function to call (instead of falling back to a generic dynamic dispatch) when the expression is used with [] to update an element.
statinfo_meta.append_key: An identifier or a boxed identifier bound to a function to call (instead of falling back to a generic dynamic dispatch) when the expression is used with ++ to append the result of another expression. For a boxed identifier, the application will be guarded by a check to ensure that both arguments share the same append implementation.
statinfo_meta.dot_provider_key: An identifier bound by dot.macro dot.macro_more_static to implement the expression’s behavior as a dot provider, a packed sequence of such identifiers, or a packed sequence mixing identifiers and packed sequences of identifiers. In the case of an overall sequence, the first element is used to find a dot provider, and if that element is itself a sequence, the dot providers are tried in order. The rest of an overall sequence records progressively less-specific dot providers, such as the dot providers for superclasses of a class or superinterfaces of an interface. Intersection of overall sequences finds a shared tail, while union of overall sequences combines elements pairwise.
statinfo_meta.sequence_constructor_key: An identifier bound as a variable or a macro that is wrapped around an expression to create or specialize a sequence for for, or #true to indicate that no wrapper is needed.
statinfo_meta.sequence_element_key: Packed static information for the elements of the expression as a sequence used with each. For a sequence with multiple values in each element, the static information can map statinfo_meta.values_key to a group of per-value static information. The number of static information must be consistent with the bindings, otherwise no static information will be propageted at all. When statinfo_meta.sequence_element_key is not specified, each uses statinfo_meta.index_result_key.
statinfo_meta.list_bounds_key: A group containing two elements, indicating a list with a minimum size given by the first element, and a maximum size for the second element or #false if no maximum size is known.
statinfo_meta.pairlist_bounds_key: Like statinfo_meta.list_bounds_key, but for a pair list.
statinfo_meta.maybe_key: Packed static information that applies to a non-#false value. This information is exposed by definitely, for example. See also statinfo_meta.unpack_call_result.
statinfo_meta.flonum_key: A boolean indicating whether the value is a flonum. Normally, this key is only present if it has a #true value.
statinfo_meta.fixnum_key: A boolean indicating whether the value is a fixnum. Normally, this key is only present if it has a #true value.
statinfo_meta.values_key: A packed group of static information (see statinfo_meta.pack_group), one for each value produced by a multiple-value expression.
statinfo_meta.indirect_key: An identifier whose static information is lazily spliced in place of this key and identifier.
See Annotations and Static Information for examples using some of these keys.
class clause | |
| |
| |
interface clause | |
| |
| |
veneer clause | |
|