Helper class for Structure creation in the kernel: Kernel::StructureFactory.
This will soon be used by the Schur decomposition function, which will serve as example on how to use the factory.
Basically, the idea is that a global instance of Kernel::StructureFactory is created for each structure signature. To create an instance of that structure, use the <set> method to modify the fields held in the factory, and when all fields are set, use the <build> method to create an instance. This is very non-functional, but pretty convenient. The danger is that one must not forget to set any fields before calling <build>, or values from the last <build> will be used without warning. Means to prevent this, such as clearing values after every <build>, and checking for unset values upon <build>, seems overly protective and costly.
At least, the factory ensures that only declared fields are assigned, and it takes care of the not-so-obvious details of how to set up a new instance of Lang::Structure.