A directive #let = <true | false> for use in the #if <expression_using_name> #else #endif.
A directive #iflet <expression_using_name> #else #endif that emits an error on an undefined .
The scope of the #let directive could be file-scoped or global. And, if defined as file-scoped then must allow for import source files containing the necessary #let directives.
The #iflet is proposed because the #if currently handles undefined as false (SWIFT_ACTIVE_COMPILATION_CONDITIONS). Having a #iflet can innately validate the build environment for correctness and guard against false-falses.
Swift 4 is not friendly to one of our methodology of code instrumentation. Swift seems to lack necessary support for #if usage modes. Currently, we can modify the Xcode build environment variables to force in -D for the #if direction using SWIFT_ACTIVE_COMPILATION_CONDITIONS in the build. However, the means is unacceptable due it cumbersome nature and risks obfuscating build issues. Implementing it proposes an explosion of schemas and targets. Instrumenting code with run-time conditions is also unacceptable and it induces bogus compiler warning, code instrumentation cannot be done without #if.
Our development methodologies involves using #if (or #ifdef in Obj-C, C++ languages) to instrument code for testing and for developing new design approaches. We need a means to flip on and off code configurations locally(per person or scheme) for the different builds, different tests, and especially for verifying new architectural changes and identifying in the code the changes involved. #if allows for injecting code snippets for testing modes of corner case conditions and debug unobservable by other means. It is best if the configurations flags are placed in at least one or more global files or in the source file of the code it affects. Our methodology for code instrumentation using the Xcode SWIFT_ACTIVE_COMPILATION_CONDITIONS build variable is not reasonable.