I can't see the logic in AA foreach order. Consider this code:
```
void main() {
string[string] test = [
"one": "1",
"two": "2",
"three": "3",
"four": "4"
];
import std.stdio:writeln;
foreach(k, v; test) {
writeln(k);
}
}
Output:
thre
On Tuesday, 28 February 2017 at 15:44:46 UTC, bachmeier wrote:
On Tuesday, 28 February 2017 at 15:33:46 UTC, ikod wrote:
AA implemented as hash table, so it doesn't preserve insertion
order. You have to sort keys when you need:
import std.algorithm;
import std.stdio;
void main() {
aut
On Tuesday, 28 February 2017 at 17:16:43 UTC, Daniel Kozák wrote:
V Tue, 28 Feb 2017 15:15:00 +
Anton Pastukhov via Digitalmars-d-learn
napsáno:
I can't see the logic in AA foreach order. Consider this code:
...
Output:
three
two
one
four
I was sure output should be
one
two
three
On Wednesday, 1 March 2017 at 19:26:23 UTC, Mike Wey wrote:
On 02/28/2017 07:16 PM, Anton Pastukhov wrote:
On Tuesday, 28 February 2017 at 17:16:43 UTC, Daniel Kozák
wrote:
[...]
Thank you for the link, it was informative reading. It's a
pity that
still there is no ordered AA at least as a
On Wednesday, 23 October 2024 at 18:39:15 UTC, H. S. Teoh wrote:
The key here is to understand that "alias" != "macro".
Re-reading this topic today and indeed that was the missing
piece. I was sure that alias is just a compile-time string
replacement akin to C macros, just with some niceties
On Wednesday, 23 October 2024 at 14:50:44 UTC, Paul Backus wrote:
On Wednesday, 23 October 2024 at 12:46:24 UTC, Paul Backus
wrote:
You can't use an `alias` to refer to a member variable like
this. When you write
alias myAlias = myStruct.test;
...it is silently rewritten by the compile
I'm struggling with this code. Why `countUntil` won't work with
aliases?
```
import std.traits : EnumMembers;
import std.algorithm : countUntil;
enum Test: string {
One = "one",
Two = "two",
Three = "three"
}
struct MyStruct {
Test test = Test.Three;
}
void main() {
auto my
On Wednesday, 23 October 2024 at 12:46:24 UTC, Paul Backus wrote:
snip
Thanks, that's a good catch. `alias myAlias = MyStruct.test` is
really just a typo, I meant `alias myAlias = myStruct.test`, so
I actually have an instance. It's still not compiling
On Wednesday, 23 October 2024 at 18:05:15 UTC, monkyyy wrote:
Its intended and probably the right decision, but good luck
finding relivent docs.
What's the motivation behind it? For me, it looks like a weird
edge case but I'm just probably missing something here
On Wednesday, 23 October 2024 at 18:39:15 UTC, H. S. Teoh wrote:
On Wed, Oct 23, 2024 at 06:10:07PM +, Anton Pastukhov via
Digitalmars-d-learn wrote:
On Wednesday, 23 October 2024 at 18:05:15 UTC, monkyyy wrote:
>
> Its intended and probably the right decision, but good luck
>
On Wednesday, 23 October 2024 at 19:10:05 UTC, Jonathan M Davis
wrote:
On Wednesday, October 23, 2024 11:18:47 AM MDT Anton Pastukhov
via Digitalmars-d-learn wrote:
On Wednesday, 23 October 2024 at 14:50:44 UTC, Paul Backus
wrote:
> On Wednesday, 23 October 2024 at 12:46:24 UTC, Paul Bac
On Monday, 23 December 2024 at 23:46:33 UTC, Jim Balter wrote:
I had the exact same issue yesterday. Allow me to quote ChatGPT:
Thanks. That sounds plausible but I got burned by ChatGPT more
than once, so I still would like to hear from a human being.
Generally GhatGPT is not very good with D
I'm stuck on a simple problem.
There is this string enum of MIME types:
```d
enum BodyType: string {
PlainText = "text/plain",
JSON = "apllication/json",
FormUrlencoded = "application/x-www-form-urlencoded",
Multipart = "multipart/form-data",
Other = "Other",
None = "None"
On Monday, 23 December 2024 at 20:26:47 UTC, bauss wrote:
Simply cast el to a string instead of using std.conv.to
Thanks much, it worked! Though I'm confused why. Could you please
elaborate?
14 matches
Mail list logo