On Friday, 17 January 2020 at 07:57:16 UTC, mark wrote:
On Thursday, 16 January 2020 at 17:11:11 UTC, Adam D. Ruppe
wrote:
[...]
The string thing probably shouldn't be used anymore. I suggest
you always use the => form instead.
The string thing is a legacy version that was before the
languag
On Thursday, 16 January 2020 at 17:11:11 UTC, Adam D. Ruppe wrote:
[...]
The string thing probably shouldn't be used anymore. I suggest
you always use the => form instead.
The string thing is a legacy version that was before the
language had =>.
[...]
Thanks for that very clear explanation.
On Thu, Jan 16, 2020 at 05:03:33PM +, mark via Digitalmars-d-learn wrote:
[...]
> auto wordCharCounts4 = words // I added this and it won't compile
> .map!(a => a.count); // Error: no property count for type string
> writeln(wordCharCounts4);
You need to import std.algorithm to g
On Thursday, 16 January 2020 at 17:03:33 UTC, mark wrote:
auto wordCharCounts = words // I added this and it works
fine
.map!"a.length";
writeln(wordCharCounts);
The string thing probably shouldn't be used anymore. I suggest
you always use the => form instead.
The string thi
I'm looking at
https://tour.dlang.org/tour/en/gems/range-algorithms
(IMO the example code is far too long and complicated.)
But here's the thing:
auto wordCharCounts = words // I added this and it works fine
.map!"a.length";
writeln(wordCharCounts);
auto wordCharCounts2 = wo