Coding 2024-12-16
Well, I was focused on other things today, so I'm going to try and get some stuff written quickly, then wind down.
The last few days, I've been toying with the concept of foregrounding the interpretation of high-level command abstractions as an inhomogeneous linked list. These linkages are formed via two methods on the command head/cap class, which attach the instance to a method-specific type of tail, and the result, depending on whether the methods are called on a head or a cap, is a tail or a completed list, respectively.
And as I type that up, I suddenly recognize one of the problems with the current abstraction. I was thinking yesterday about writing a new tail class, but if the way to attach a tail is to call a method on the head/cap, then every new tail class needs a new method on the head/cap class. This method should instead be part of the command tail interface.
To help preserve the order of data in the code, there could perhaps be a convenience method on the head/cap class, although the typing may be somewhat confusing... The problem with that idea is that the different kinds of tail have different effects on the typing of the head/cap when it's prepended, and I don't yet see a way to address that.
Given that it looks like I won't be able to change the shape of the interface as much as I hoped, it's best to focus on the names for now. The shared prefix for the methods to attach to a tail is with_, and my current feeling is that prepend_to_ is a lot better. The names can then be something like prepend_to_script_environment and prepend_to_module_call.
I'll have to sleep on that, and come back to it in a few days.
For now, winding down.
Good night.