Great alternative, thanks! I see your point about additional work in the module to verify (and if necessary protect) correct operation, yet this seems to be a nice hybrid between giving a caller the ability to prepare a partially configured template and the flexibility to instantiate usable objects out of the templates. This is an excellent extension of the design options I originally proposed.
This also has the benefit of being subclass-friendly, which choroba noted earlier as a flaw in package-scoped lexicals.
In reply to Re^2: OO APIs and FP interfaces (storage scope)
by Apero
in thread OO APIs and FP interfaces
by Apero
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |