Coding 2023-01-13

Tags:
By Max Woerner Chase

Instead of touching any code today, I'm going to try to fully lay out my thoughts on the general area I was talking about last time.

For context, I'm trying to rework the structure of the class that will be call artifact.Output once I've renamed everything. The various classes in the artifact module are (okay, fine, will be) implementations of the Artifact protocol, which defines a method that takes a callback which converts some value to a Parametric[command.Metadata] (or something along those lines. artifact.Output currently has provisions to inject other values in specific circumstances, which end up making it hard for me to determine which intermediate values are "supposed to" be used at various stages.

Now, I was thinking of putting together something really elaborate to replace this system, but I think the specific really elaborate thing I had in mind had its own problems. So, let's take it slow...

So, going from there... I don't think there's a sensible definition of "parent" for these "Token" objects, but unless I can formalize the types in question, I need the code to do something when this overlap happens, and I'd rather not stick isinstance checks in there.

So, I want to change this code both from a usage perspective, and from an implementation perspective. From a usage perspective, I want the "final" accumulated value to be what is passed to the command if possible (so, ideally not Extra/Implicit), and I want the other values to be Extra/Implicit.

This actually really helps, because it gets me that these extra values are only expected when the produced value is known to be pathlike. So, if there are update methods that restrict their validity based on the type parameter, then those methods are allowed to use the fact that the data is pathlike. I don't know if I should exercise that option, but it's there.

Anyway, a few other notes:

These involve maps like PathLike -> T_co and T_co -> Datum, but the latter is only expected with T_co == PathLike.

Something else I need to keep in mind is that I believe I want to add these capabilities to the OutputFromInput class, which... hm... Basically, all of this logic "should" be neatly encapsulated somewhere, and the question of how to do that feels like maybe it should wait for after I've done the previous rounds of rewrites.

So, the plan for the coming days: take my existing plans, convert them into TODO comments in the code, then grind through them and take notes on what to do differently.

For now, though, I really need to sleep.

Good night.