Coding 2021-11-07
I've written a bunch of the foundational code for the Fragment API. I did some rewrites as I copied things over that caused it to make a lot more sense, but there are still a few things missing:
- I haven't ported over the end-user code to actually create any of this. Part of the reason for that is, I've refined my ideas about what that should look like since I wrote the first prototype.
- I haven't written the code to convert all of this into a series of command invocations. This code is "obvious", which means I should make sure I'm in peak condition before I attempt to write it, because I'm going to run into some problem that'll be completely incomprehensible for over ten minutes if I'm lucky.
Here's what the changes I made look like:
- The majority of the Fragment and Option classes has been combined into a single implementation class. The Fragment and Option classes basically exist as wrappers that carry additional type information, and one extra field.
- There's now a single Builder class that could wrap anything, but only does anything vaguely useful if it's parameterized with a Fragment or an Option class. I turned some of the helper functions from the first prototype into methods.
Here's everything from the first prototype that's missing in the current prototype:
- The InstallRunner class, which I forget what I was trying to do with it, so I'll just wing it until I'm writing the code to go from a Fragment[Script, typing.Any] to a Requirements.
- Helpers to convert a non-parameterized bit of Fragment-y or Option-y data into a Builder.
- A helper to convert a Builder[Fragment[Script, typing.Any]] into a sequence of Fragment[Script, typing.Any].
Here's what I think I need to be looking into:
- Helpers to produce single parameterized Output segments.
- Helpers to produce larger parameterized non Output segment sequences.
I'm trying to figure out if there's anything else, and I'm not coming up with anything. We'll see if there's something later that I'm like "Oh, well, of course!", but I'm not going to think too hard about it right now.
(I also did some really obvious work on the poem.)
Anyway, I'd like to wrap up early, so I'm done for now.
Good night.