Coding 2023-03-02
Taking things slow, thinking about MOTR. I worked out last night that the conditions under which a label is required to be a singleton are somewhat complicated, so there probably needs to be new fields to track the state.
However.
Rather than just throwing fields at it to try to approximate the correct behavior, let's try laying out the final semantics, starting in very general terms.
- The most obvious check to make at runtime is, are all of the necessary labels defined?
- The next most obvious check is, which of those labels must be singletons?
This second check is trickier. On the one hand, every label not iterated over by every output must be a singleton, so we effectively have an allow list. On the other hand, every label that is iterated over by an environment variable must be either iterated over at the top level, or a singleton. (Inclusive or.) On the gripping hand, every label that is only iterated over by implicit values must be a singleton.
Currently, I believe this last requirement is satisfied by not allowing those labels to exist. There are two "big things" that need to be done in this area. One is to allow all of these scenarios. The other is to give the metadata the ability to notice "hey, here are these selections being used, but forced to be singletons", and emit some kind of diagnostics.
Anyway, I got distracted and it's late, so I'm done for now.
Good night.