Only want to say

kdevel kdevel at vogtner.de
Mon Jan 11 19:33:26 UTC 2021


On Monday, 11 January 2021 at 10:14:36 UTC, ddcovery wrote:

[...]

> void zipTo(string srcFolder, string zipFile)
> in
> {
>   assert(srcFolder.exists());
> }
> out
> {
>   assert(zipPath.exists());
> }
> body
> {
>   scope (failure)
>     "Problems generating 7z file".writeln();
>
>   ...
> }

Just my 2 ¢: This is not DbC as I understand it. The conditions
do not reflect a program state one "can reason about". Furthermore
there is at least one race condition [1] which would be absent if
the file system operations just fail and throw an exception.

[1] https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use




More information about the Digitalmars-d mailing list