Diary 2019-09-22

By Max Woerner Chase

I've got the guidelines for the various rules mostly boiled down. I just need to summarize the rules for The Adventure Crafter itself, and I should be set to turn all of this into a hardcopy reference.

Aside from that, I put together a prototype for multiple-definition functions. This code is... horrifying. I noticed that I'd somewhat reinvented the wheel elsewhere in Structured Data, insofar as the inspect module provides facilities to tell you how the arguments to a function would be dispatched, given some *args and **kwargs. With this, I was able to: Extract all non-variable-length arguments as a dictionary, convert it into a Matchable, match it against a sequence of structure, function pairs, and for the first match, extract all values from that into the variable-length arguments (erroring in the case of a collision), figure out how the target function would have just the keyword arguments dispatched, inject the variable positional arguments, if any, then actually generate the call. I can't see any reason why it wouldn't work, except that it's so complex that it'll take significant effort to actually define "working".

I just now worked out some functionality I want that is too complicated to put in the prototype, so I'll have to try to TDD it in.

I hoped I would come up with something else to say, but I didn't.

Good night.