The last approach seems to me the most elegant, but ... I would need 3 files).
You might look into AutoSplit and AutoLoader.
Not used much these days, but they seem ideally placed to address your "one file -- only compile the bits I need" requirement.
In reply to Re: Writing portable code
by BrowserUk
in thread Writing portable code
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |