On Tuesday, 3 October 2023 at 20:22:30 UTC, Andrey Zherikov wrote:
On Tuesday, 3 October 2023 at 19:57:06 UTC, christian.koestlin
wrote:
On Tuesday, 3 October 2023 at 01:55:43 UTC, Andrey Zherikov
wrote:
On Monday, 2 October 2023 at 18:46:14 UTC, christian.koestlin
wrote:
[...]
Slightly
On Tuesday, 3 October 2023 at 19:57:06 UTC, christian.koestlin
wrote:
On Tuesday, 3 October 2023 at 01:55:43 UTC, Andrey Zherikov
wrote:
On Monday, 2 October 2023 at 18:46:14 UTC, christian.koestlin
wrote:
[...]
Slightly improved:
```d
import std;
[...]
Thanks .. the thing with ref result
On Tuesday, 3 October 2023 at 01:55:43 UTC, Andrey Zherikov wrote:
On Monday, 2 October 2023 at 18:46:14 UTC, christian.koestlin
wrote:
[...]
Slightly improved:
```d
import std;
[...]
Thanks .. the thing with ref result is very clever!
Should `ref result` be `return result`?
Kind regards,
On Monday, 2 October 2023 at 02:47:37 UTC, Joel wrote:
```d
import std;
auto data=“I went for a walk, and fell down a hole.”;
```
[snip]
How can I improve this code? Like avoiding using foreach.
This works for me:
```d
import std;
auto data="I went for a walk, and fell down a hole.";
On Monday, 2 October 2023 at 18:46:14 UTC, christian.koestlin
wrote:
On Monday, 2 October 2023 at 02:47:37 UTC, Joel wrote:
How can I improve this code? Like avoiding using foreach.
You could fold into a hash that counts the occurrences like
that:
```d
import std.uni : toLower;
import
On Monday, 2 October 2023 at 20:20:44 UTC, Joel wrote:
I want the output sorted by value.
Look:
https://forum.dlang.org/post/qjlmiohaoeolmoavw...@forum.dlang.org
```d
struct SIRALA(T) { }
```
You can use SIRALA(T). Okay, his language is Turkish but our
common language is D. His feature
On Monday, 2 October 2023 at 02:47:37 UTC, Joel wrote:
```d
import std;
auto data=“I went for a walk, and fell down a hole.”;
void main(string[] args) {
int[string] dic;
struct WordCnt {
string word;
ulong count;
string toString() const {
return
On Monday, 2 October 2023 at 06:19:29 UTC, Imperatorn wrote:
On Monday, 2 October 2023 at 02:47:37 UTC, Joel wrote:
```d
import std;
auto data=“I went for a walk, and fell down a hole.”;
You can improve it further by inlining
```d
import std;
auto data = "I went for a walk, and fell down a
On Monday, 2 October 2023 at 02:47:37 UTC, Joel wrote:
How can I improve this code? Like avoiding using foreach.
You could fold into a hash that counts the occurrences like that:
```d
import std.uni : toLower;
import std.array : split, array;
import std.stdio : writeln;
import std.algorithm :
On Monday, 2 October 2023 at 02:47:37 UTC, Joel wrote:
```d
import std;
auto data=“I went for a walk, and fell down a hole.”;
You can improve it further by inlining
```d
import std;
auto data = "I went for a walk, and fell down a hole.";
void main(string[] args)
{
int[string] dic;
On Monday, 2 October 2023 at 02:47:37 UTC, Joel wrote:
```d
import std;
auto data=“I went for a walk, and fell down a hole.”;
void main(string[] args) {
int[string] dic;
struct WordCnt {
string word;
ulong count;
string toString() const {
return
11 matches
Mail list logo