On Sunday, 8 December 2019 at 06:42:22 UTC, Paul Backus wrote:
You can use the `require` function [1] for this:
with (userHistory.require(host).require(user)) {
if (isOk) ++ok; // renamed to avoid shadowing
else ++evil;
}
Many "methods" for built-in AAs are located in the `object`
On Sunday, 8 December 2019 at 04:17:45 UTC, mipri wrote:
Hello,
I've got this code:
struct UserStats {
int ok, evil;
}
// module-level variable
UserStats[string][string] userHistory;
and this code that populates it:
// loop over DB query
if (host !in userHistory)
Hello,
I've got this code:
struct UserStats {
int ok, evil;
}
// module-level variable
UserStats[string][string] userHistory;
and this code that populates it:
// loop over DB query
if (host !in userHistory)
userHistory[host] = typeof(userHistory[host]).init;
if
On Sunday, 8 December 2019 at 01:10:21 UTC, AA wrote:
I'd like to accept the return type of map. From some previous
questions that I should accept a template?
In general this is what you want to do with any kind of range
code, because you're not working with definite types, but with
types that
I'd like to accept the return type of map. From some previous
questions that I should accept a template?
So for something like:
```
void mapAccepter(Range)(Range r)
{
import std.array : array;
import std.stdio : writeln;
auto collected = r.array;
writeln(collected);
}
void
On 07/12/2019 12:20, cc wrote:
> Given the following program:
[...]
> But when both FREE and COLLECT are enabled, things seem to spiral out of
> control:
> // FREE, COLLECT
> Stats(16, 1048560, 16)
> 848 4096
> 40960832 40964096
> 81920832 81924096
> 122880832
On Wednesday, 4 December 2019 at 22:51:45 UTC, Steven
Schveighoffer wrote:
I localized that the leak was actually being caused by
websockets. I want to write down my experience because I did some
weird stuff which seems to be working but I want to learn how it
actually make sense and works.
On Saturday, 7 December 2019 at 15:57:14 UTC, Jonathan M Davis
wrote:
There may have been some tweaks to std.encoding here and there,
but for the most part, it's pretty ancient. Looking at the
history, it's Seb who marked some if it as being a replacement
for std.utf, which is just plain
On Saturday, December 7, 2019 5:23:30 AM MST Joseph Rushton Wakeling via
Digitalmars-d-learn wrote:
> On Saturday, 7 December 2019 at 03:23:00 UTC, Jonathan M Davis
>
> wrote:
> > The module to look at here is std.utf, not std.encoding.
>
> Hmmm, docs may need updating then -- several functions
On Saturday, 7 December 2019 at 03:23:00 UTC, Jonathan M Davis
wrote:
The module to look at here is std.utf, not std.encoding.
Hmmm, docs may need updating then -- several functions in
`std.encoding` explicitly state they are replacements for
`std.utf`. Did you mean `std.uni`?
It is
Given the following program:
//version=FREE;
//version=COLLECT;
import std.stdio;
import std.datetime.stopwatch;
import core.memory;
immutable int[] intZ =
11 matches
Mail list logo