Why is D unpopular?
deadalnix
deadalnix at gmail.com
Fri May 20 13:02:46 UTC 2022
On Friday, 20 May 2022 at 12:45:07 UTC, Siarhei Siamashka wrote:
> D unittest (save as "main_test.d" and run as "rdmd -unittest
> main_test.d"):
> ```D
> unittest {
> // Create an associative array
> auto a = ["Alice": true, "Bob": true, "Charlie": true];
>
> // Iterate over the associative array and save keys
> string[] s;
> foreach (k, _ ; a)
> s ~= k;
>
> // If the order is preserved, then the first retrieved name
> will be "Alice"
> assert(s[0] == "Alice");
> }
>
> void main() {
> }
> ```
>
The problem quickly shows when you dig slightly deeper. Import
another module. It fails. Add -i, it work, but now run the
unittests of the module you import. Bonus point: dependencies are
not tracked properly so you might be running stale code.
More information about the Digitalmars-d
mailing list