|
|
|
|
|
by wgd
1382 days ago
|
|
Jokes aside the compiler-checked acknowledgements are kind of clever. The example in the docs is deliberately confrontational, but there's a kernel of a neat idea there. Imagine needing to write: // I acknowledge that the internal structure of this data is subject to change without notice
x = foo.state
Or perhaps: // I acknowledge that this data is a complicated graph of pointers and is easy to break in subtle ways
foo.xyz[0].bar[1] = &foo.asdf[3]
Or perhaps: // I acknowledge that this data is heavily cached and I need to call rebuild() before changes take effect
x.something = "Hello"
x.rebuild()
|
|
Not sure quite why we decided to allow it at all there, but I suspect I just had too much fun with it. Not sure why it ended up spelled “can not” instead of “cannot”, either.
(If you’re wondering about ${…} on If/Else/EndIf, that’s because NSIS is basically an assembly language and has only jumps for control flow; LogicLib.nsh provides nice control flow constructs via defines and macros, abstracting the automatic creation of labels and the right jumps so that that `${If} $1 S== "…"` compiles to `StrCmpS $1 "…" 0 ‹auto-else-label›`, `${Else}` to `Goto ‹auto-endif-label›; ‹auto-else-label›:`, and ${EndIf} to `‹auto-endif-label›:`.)