spongedsc / pathways

Pathways: multi-modal AI/ML models on discord
GNU Affero General Public License v3.0
3 stars 1 forks source link

[feat] File exclusion in structure loaders #97

Closed daniwasonline closed 3 weeks ago

daniwasonline commented 3 weeks ago

Description

This PR simply adds a flagger to the structure loader for file exclusion. In any file that utilises a structure loader predicate, simply export __loader_exclude with the boolean True to exclude it from the loading process.

Why is this useful?

In structures where multiple files may be used to store code for a single structure (i.e. callsystems), having a loader exclusion flag could be very important if the structure being exported potentially meets the conditions for the predicate.

i.e. Say that you have a callsystem, but you also call a second class that happens to also be a Callsystem subclass. Having the structure loader attempt to load it when it shouldn't could cause severe consequences, including glitches and a full crash.