4 ms·
The third option: an assertion of fact A language could reasonably use plain = to let the programmer state that two things are equal. In a debug build, this co
by tropo 9y ago
The third option: an assertion of fact
A language could reasonably use plain = to let the programmer state that two things are equal. In a debug build, this could be compiled into code that validates the condition. A debug build would abort if the condition is not met. For a performance-optimized build, the compiler could use the information for optimization. It could be like the __assume keyword that Microsoft supports.
- smadge 9y agoThis is essentially what ‘assert’ does in some C like languages except it allows more than just asserting equality. For example: assert(length < 10)