On 6/2/20 3:32 AM, BoQsc wrote:
I want to read a file, put it into an array, make some search and
replace on the content and output the modified text. However Associative
Arrays seem to be unsorted by default. Should I drop the Associative
Arrays and use something else? What are the ways to res
On 6/2/20 10:51 AM, realhet wrote:
On Tuesday, 2 June 2020 at 13:10:55 UTC, Paul Backus wrote:
On Tuesday, 2 June 2020 at 09:28:01 UTC, realhet wrote:
mixin("@property auto ", k, "() const { return ", v, "; }");
Wow, string mixin can process comma separated list, I gotta remember
this, th
On Tuesday, 2 June 2020 at 06:00:10 UTC, Виталий Фадеев wrote:
On Monday, 1 June 2020 at 18:55:03 UTC, Paul Backus wrote:
On Monday, 1 June 2020 at 16:18:44 UTC, Виталий Фадеев wrote:
I do it!
https://github.com/vitalfadeev/SublimeDlangAutoImport
What happens if you have the same symbol in
On Tuesday, 2 June 2020 at 06:00:10 UTC, Виталий Фадеев wrote:
On Monday, 1 June 2020 at 18:55:03 UTC, Paul Backus wrote:
On Monday, 1 June 2020 at 16:18:44 UTC, Виталий Фадеев wrote:
I do it!
https://github.com/vitalfadeev/SublimeDlangAutoImport
Cool. I dont use classe but I see how this k
On Tuesday, 2 June 2020 at 13:37:25 UTC, Stanislav Blinov wrote:
On Tuesday, 2 June 2020 at 09:28:01 UTC, realhet wrote:
Try UDAs instead of a map:
struct A {
struct G {
@("hauteur") int height;
}
Good idea, thx! I already using UDA's for range and measurement
units.
struc
On Tuesday, 2 June 2020 at 12:34:53 UTC, Q. Schroll wrote:
On Tuesday, 2 June 2020 at 11:44:10 UTC, Vladimirs Nordholm
wrote:
[...]
You might want to check out this:
https://en.wikipedia.org/wiki/Trie
Possibly, that's exactly what you're looking for.
Thank you!
I believe this is exactly
On Tuesday, 2 June 2020 at 13:10:55 UTC, Paul Backus wrote:
On Tuesday, 2 June 2020 at 09:28:01 UTC, realhet wrote:
mixin("@property auto ", k, "() const { return ", v, "; }");
Wow, string mixin can process comma separated list, I gotta
remember this, thanks!
On Tuesday, 2 June 2020 at 06:00:10 UTC, Виталий Фадеев wrote:
On Monday, 1 June 2020 at 18:55:03 UTC, Paul Backus wrote:
On Monday, 1 June 2020 at 16:18:44 UTC, Виталий Фадеев wrote:
I do it!
https://github.com/vitalfadeev/SublimeDlangAutoImport
Great! You should make a post about it in th
On Wednesday, 27 May 2020 at 11:40:00 UTC, Mike Parker wrote:
On Wednesday, 27 May 2020 at 10:30:36 UTC, wjoe wrote:
On Wednesday, 27 May 2020 at 10:01:33 UTC, Mike Parker wrote:
Could you please elaborate why checked exceptions are more
annoying?
For me, it's because they require all funct
On Tuesday, 2 June 2020 at 09:28:01 UTC, realhet wrote:
I did it that way:
private enum fieldMap = [ // simple names for descriptive and
structured fields
"hauteur" : "general.height",
"rayon" : "profile.radius",
"plage" : "profile.plage",
"offsetv"
On Tuesday, 2 June 2020 at 09:28:01 UTC, realhet wrote:
static foreach(k, v; fieldMap){ mixin("@property auto $()
const{ return #; }".replace("$", k).replace("#", v)); } //I
know, i know -> AliasSeq :D
You can use std.format.format to do it in one function call:
mixin("@property auto
On Tuesday, 2 June 2020 at 11:44:10 UTC, Vladimirs Nordholm wrote:
Hello.
I want to create a tree which maps sequences of numbers to
data. ex:
- [1, 2]-> 1
- [1, 3, 1] -> 2
- [1, 3, 2] -> 3
I have no prior knowledge of what makes a good tree, and I am
unsure if what I've got is good. I m
Hello.
I want to create a tree which maps sequences of numbers to data.
ex:
- [1, 2]-> 1
- [1, 3, 1] -> 2
- [1, 3, 2] -> 3
I have no prior knowledge of what makes a good tree, and I am
unsure if what I've got is good. I mean it works, but if anyone
with more knowledge of trees or D-lang
On Tuesday, 2 June 2020 at 09:28:01 UTC, realhet wrote:
On Tuesday, 2 June 2020 at 09:10:03 UTC, Ali Çehreli wrote:
On 6/2/20 1:56 AM, realhet wrote:
Oh and I can put that function generator mixin thing into a
template as well, that way it is reusable and much nicer.
There are a lot of poss
On Tuesday, 2 June 2020 at 06:53:47 UTC, Basile B. wrote:
Ok cool. I hesitate to report an issue because the bug was too
"simple".
This is a proof that dmd user use the GC a lot :).
Mmmmh I don't follow you, this has nothing to do with the GC.
It's rather a problem with the backend (i.e the
On Tuesday, 2 June 2020 at 09:10:03 UTC, Ali Çehreli wrote:
On 6/2/20 1:56 AM, realhet wrote:
> struct A{
>struct B{ int c; }
>B b;
>
>auto f(){
> alias d = b.c;
The spec explicitly says it's not legal: "Aliases cannot be
used for expressions" (Item 10):
https://dlang.org/
On 6/2/20 1:56 AM, realhet wrote:
> struct A{
>struct B{ int c; }
>B b;
>
>auto f(){
> alias d = b.c;
The spec explicitly says it's not legal: "Aliases cannot be used for
expressions" (Item 10):
https://dlang.org/spec/declaration.html#alias
I use nested functions for such
On Tuesday, 2 June 2020 at 09:07:08 UTC, Basile B. wrote:
On Tuesday, 2 June 2020 at 08:56:13 UTC, realhet wrote:
[...]
There's a language rule, expressions cant be aliased, however D
has a bug, some expressions
that look like type can be aliased, then when you use them you
have an error abo
On Tuesday, 2 June 2020 at 08:56:13 UTC, realhet wrote:
Hello,
I have a 2 level nested struct structure with nice descriptive
field names.
And I thought it will be easy to alias those identifierLists
with a few letter names and do some calculations on them.
But I'm having an error.
struct A{
On 6/2/20 12:32 AM, BoQsc wrote:
> I want to read a file, put it into an array, make some search and
> replace on the content and output the modified text.
How large is the data? If it fits into memory, just read the whole
thing, update it, sort the keys, and then output like this:
import s
Hello,
I have a 2 level nested struct structure with nice descriptive
field names.
And I thought it will be easy to alias those identifierLists with
a few letter names and do some calculations on them.
But I'm having an error.
struct A{
struct B{ int c; }
B b;
auto f(){
alias d = b
On Tuesday, 2 June 2020 at 07:32:56 UTC, BoQsc wrote:
I want to read a file, put it into an array, make some search
and replace on the content and output the modified text.
However Associative Arrays seem to be unsorted by default.
Should I drop the Associative Arrays and use something else?
W
I want to read a file, put it into an array, make some search and
replace on the content and output the modified text. However
Associative Arrays seem to be unsorted by default. Should I drop
the Associative Arrays and use something else? What are the ways
to resolve this randomness in Associat
23 matches
Mail list logo