[I6/I7] "number of" at compile time?

Is there a compile-time equivalent of “number of (description of values)”? I would like to create an Inform 6 constant for the initial number of foobars (a kind of thing), so that I can make an array of that size. Relations.i6t has the line

Constant NUM_ROOMS = {-value:Data::Instances::count(K_room)};

That is basically what I want, except it is undocumented and doesn’t work for foobars.

Alternatively, is there a way to change the size of an Inform 6 array at run-time?

No, there’s nothing (documented) that does that.

What I usually do in these situations is to define a constant, expose it in I7, and then say

When play begins:
if the number of foobars is greater than NUM_WHATEVER:
say “(BUG) NUM_WHATEVER is too small, increase to [number of foobars].”

It’s cheesy but it works.