On Thursday, 9 December 2021 at 18:00:42 UTC, kdevel wrote:
PRO:
- saves two lines of boilerplate code
CONS:
- raw loop
- postinc ++ is only permitted in ++C
- inconsistent spacing around "="
- mixing tabs and spaces for indentation
- arrow code
more PROs:
- You become less dependent on someone else's library.
- You learn how to do some things yourself.
;-)
of course, I would prefer a less verbose, and safer version,
which D enables, such as:
foreach(val; a)
{
writeln(val);
if (val != ';')
{
b ~= val;
}
}