Re: what exactly is string length?

2021-04-01 Thread Computermatronic via Digitalmars-d-learn
On Friday, 2 April 2021 at 05:02:52 UTC, mw wrote: Ahh, I got what I see (from writeln) is not what get string here ;-) And I just tried: string t = text("head-", strip(s), "-tail"); It's the same behavior. So how can I trim the leading & trailing `\0` from the static char array? strip

Re: what exactly is string length?

2021-04-01 Thread Computermatronic via Digitalmars-d-learn
On Friday, 2 April 2021 at 04:49:22 UTC, mw wrote: So you mean inside the writeln() call, the 0s are skipped? Well, if I use `string t` as filename, it will try to looking for a file called: "head-abc\0\0\0-tail" instead of just "head-abc-tail" ? or it's platform dependent? I would

Re: using tuple as value type for associative array

2018-06-20 Thread Computermatronic via Digitalmars-d-learn
On Thursday, 21 June 2018 at 02:44:12 UTC, Flaze07 wrote: when I do Tuple!(uint, "first", uint, "second")[string] what; //I tried aliasing the tuple as well what["something"].first = 20; I get range error but when I do uint[string] what2; what2 = 20; I get none of those range error, so...how

How to task pool in vibe.d?

2018-06-09 Thread Computermatronic via Digitalmars-d-learn
I'd like to create a bunch of tasks in vibe.d, then wait for them all to complete. Using std.concurrency and std.parallelism this is trivial. I could just spawn a bunch of vibe.d tasks and then iteratively join them, but I would think vibe.d would provide some primitives for task-pooling.

Re: Confusion/trying to understand CTFE keywords

2018-06-03 Thread Computermatronic via Digitalmars-d-learn
On Sunday, 3 June 2018 at 21:32:06 UTC, gdelazzari wrote: I'm trying to understand why keywords such as "static" or "enum" are used to denote compile time "things". What I mean is that those keywords are also used for other purposes, so I find it a bit confusing. Couldn't a keyword like "ctfe"