Documentation for special I6 invocations in phrase definitions?

There are several instances of special invocations (such as -strong-kind: and -weak-kind:) that can be found in the Standard Rules, but these are not mentioned in Writing with Inform or even the template files.

Is there any documentation anywhere on how those work and their intended purposes?

No.

There’s some documentation in the source. You can find the list of compiler invocations in Inform > building > 2. Blueprints > Tokenization and there’s some scant documentation for some in Inform > imperative > 5. Invocations > Compile Invocations Inline, but not for strong-kind and weak-kind. But you can see that the functions to satisfy them are in Inform > runtime > 5. Provision submodules > Kind IDs where we’re told:

IDs. Sometimes a kind has to be stored as an I6 integer value at run-time. I6 is typeless, so some of the routines and data structures in the I6 template need these integer values to tell them what they are looking at. For instance, the ActionData table records the kinds of the noun and second noun to which an action applies.

We have two forms of description: strong and weak. Strong IDs really do uniquely identify kinds, and thus distinguish “list of lists of texts” from “list of numbers”. Weak IDs are defined by:

Dogma. If a value v has kind K, and we want to use it as a value of kind W, then

  • (a) if K and W have different weak IDs then this is impossible;
  • (b) if they have equal weak IDs then run-time code can tell from v alone whether this is possible.

For instance, all objects have the same weak ID, but we can distinguish kinds like “vehicle” by a test like (v ofclass K27_vehicle); all lists have the same weak ID, but the block of data for a list on the heap contains the strong ID for the kind of list entries, so we can always find out dynamically what sort of list it is.

(Intermediate kinds do not conform to Dogma, but this does not matter, because they are made to order and are never assigned to storage objects like variables. That’s what makes them intermediate.)

3 Likes

And I think you’re familiar with the bits of the I6 Template Layer / Kits that touch on them: BlockValues, Flex, Lists, Combinations.

Strong IDs don’t completely uniquely identify kinds. I can’t remember exactly, but I think they don’t specify all the kinds of the arguments of a phrase?

Thank you, Zed. I appreciate the pointers.