what is D's idiom of Python's list.extend(another_list)?

Mike Parker aldacron at gmail.com
Mon Jun 21 15:24:41 UTC 2021


On Monday, 21 June 2021 at 08:40:47 UTC, ag0aep6g wrote:
>
>
> `~` works just fine with single elements:
>
>     void main()
>     {
>         import std.stdio;
>         int[] a = [2, 3, 4];
>         writeln(1 ~ a ~ 5); /* [1, 2, 3, 4, 5] */
>     }

Cool. I've had it in my head for many years now that this was not 
a thing.


More information about the Digitalmars-d-learn mailing list