@Draconis Thank you for the help getting those pushed to the repository. I thought I should also alert those of you who helpfully chimed in on my initial inquiry, @Zed, @zarf, @vaporware, and @Dannii in particular, in case you’d care to have a look.
I’ve been using the extensions myself (with a 10.2 build of Inform from the end of March) without problem so far in some development I’ve been working on, though there are a couple of issues worth mentioning (also noted in the documentation), in case anyone has thoughts on the subject …
(1) Between the early releases of those extensions and now, “indexed text” as a type is gone, and all text has the ability to be dynamic. Which is great, of course, but for Dynamic Objects, it also means that almost any kind of object we might care to clone now has “block” properties. So the “fix the cloned property …” calls that would previously have been rarely required, are now nearly universally applicable to just about any object we might try to clone.
This is straightforward enough to do, but it would be lovely if there were a way to iterate over the properties of an object and do the fixup automatically from within the extension.
I had been hoping for a straightforward solution for that, and I found a few earlier threads that touched on the idea, but from what I was able to glean, it looks as though there weren’t ever any solutions. Overall, it sounds like the consensus was that, due to the way Inform “bakes in” kind and property information at compile-time, a generalized runtime solution for iterating over kinds and/or properties might be out of reach. Is that an accurate assessment?
(2) I didn’t go back to check the behavior in 9.2 or 10.1 yet, but in the latest version, counting the number of objects of a given kind can produce incorrect results. For example, if a “widget” is a kind of thing, and the story has five statically defined widgets, then the following:
say "There are currently [the number of widgets] widgets.";
correctly reports that there are 5 widgets. But if we dynamically create five more (by cloning one or more of the originals), the above expression STILL only reports that there are five.
This only happens with counting the number of object of a kind, with no other criteria applied. If any other definition is used, such as, say …
A widget can be large or small. A widget is usually small.
To take story-wide inventory of widgets:
say "There are presently [number of small widgets] small widgets and [number of large widgets] large widgets scattered throughout the story.";
this accurately includes any dynamically created objects in the count. I am guessing that under the covers, Inform takes a shortcut when there are no conditions to check, and returns what is probably a compiler-generated constant for the number of objects of a given kind? Wheras the presence of any additional condition causes the “number of …” logic to walk through the objects (which Dynamic Objects takes pains to ensure continues to work correctly), testing the condition for each one.
A workaround for the basic object kind situation (also noted in the documentation) is to write something like:
Definition: a thing is total: decide yes.
To print the inventory of total widgets:
say "A total of [number of total widgets] widgets are currently scattered throughout the story.";
But if anyone knows off the top of their heads whether it would be simple enough to either override Inform’s behavior for these special cases, or update whatever counter Inform makes use of when responding to these requests – or can even save me a bit of time by pointing out where to look to try to find out – that would be appreciated.
Neither is a show-stopper, so nothing critical here.
(3) Finally, on a separate note, I have a couple of other extensions in mind that are ready to submit to the library. One is an improved update to an old extension (Print Stage Detection) I submitted a good way back to workaround a quirk in “printing the name” rules that evidently still exists, as I’m finding I still needed the same sort of fix in current development. The other is a “Nested Text Capture” extension, essentially a reentrant-safe version of text capture, layered atop Eric Eve’s extension.
Daniel mentioned that it might be possible to get write access to the repository? If so, that might be helpful in the days ahead, as I’m hoping to be able to contribute a good bit more as time goes on. If you’d prefer a different process, that’s fine too. Either way, I’d expect to continue to run things past folks here ahead of merging anything at all significant… unless there’s a better place for such discussion? Let me know …
Thanks!