Adding conditional imports/parts with macros. #3916
Labels
augmentation-libraries
request
Requests to resolve a particular developer problem
static-metaprogramming
Issues related to static metaprogramming
Macros can add imports, and possibly also conditional imports (or they can import a library which has conditional exports).
If it's also possible to have conditional parts, which it should be because it's very useful for have your platform-specific code to have access to privates, then it becomes a question whether macros can add conditional part files (or sub-part-files at all).
The current model seems to be that macros are combined into a single augmentation file, really only because that makes the augmentations more easily readable while debugging.
It would also be possible for each macro to generate one new part file per phase, all appended at the end of the part-directive list, instead of just one file. That should give the same augmentation application order.
If a macro generated file can add a sub-part-file, at least one with no
imports
, then that can be flattened into a single macro generated file too, by just appending it at the end of the file. If the sub-part-file has imports, that flattening won't work, and if the sub-part-file declaration is conditional, then it definitely won't work.In short:
The text was updated successfully, but these errors were encountered: