Coding 2022-02-25
I had a miserable day at work today, all inflicted by technology, so to wind down, I hacked a bit on MOTR, which I can at least reliably understand.
The specific thing I worked on today was a helper class for writing validators for use on attrs classes. This was inspired by noticing that some of the flex functions have validation logic, that I haven't replicated on the Flex classes yet. Some of the stuff I thought of didn't exist in the code before, but basically makes sense.
One unfortunate thing that occurred to me as I worked on this is that there's some functionality that I'm not quite sure how to support. In light of that, I'm going to pare it back until I have a need for it.
The feature in question was dynamically naming the output produced by a FlexOut. Thinking about this, I came up with a plan for supporting this, but it's so fiddly that I'm not going to try without a reason. Basically, instead of storing the names directly as a Dynamic...
- Add a type variable to InputAccumulator and ValueAdaptor, so I can control the type produced by the Dynamic
- If that works, give FlexOut an InputAccumulator[Sequence[str]]; if that doesn't work out, give it a sequence of InputAccumulator
- In either case, also give it a sequence of ValueAdaptor
- When implementing a method from the Flex interface, filter out any ValueAdaptor instances that don't correspond to what was passed in, and then perform the accumulation.
This sounds like a solid idea, but I don't really want to try it until I've determined that there's a need.
Anyway, I'm done for tonight, and I'm going to get ready for bed.
Good night.