Coding 2024-07-14

By Max Woerner Chase

I poked some more at the code today. One improvement I made was to change the type signature for advanced destructuring to one that doesn't require me to do elaborate mental gymnastics to verify it. This will remove some of the stranger lines present in the previous version, so that's a win.

Now it's time to think about how I might implement handling advanced destructuring. The "obvious" solution is to recursively match the substructures and then perform a merge operation on the outputs. A possible refinement to such an idea is to try to transform that recursion to iteration. The logical(?) endpoint(?) of this is the system I had in the previous version, in which advanced matches produce some amount of "additional work" that is put on a stack. (I seem to recall coming up with some very convincing theoretical reason why a stack is preferable to a queue, and it has nothing to do with "efficient stacks are slightly easier to create in Python than efficient queues".)

I think at some point I'm just going to "cheat" and skip to implementing most of this logic, and screw whatever this means for TDD purity. I should at least sketch it out and see if I run into any awkward areas first, though.

Anyway, I would very much like to get to bed now.

Good night.