Re: Why DUB do not import local D modules dependencies?

2021-04-09 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 10 April 2021 at 02:10:48 UTC, Marcone wrote: How make dub import local D modules (mymodule.d) dependencies? Could you please provide more details about your scenario, otherwise it is quite hard to understand your question. Kind regards Andre

Why DUB do not import local D modules dependencies?

2021-04-09 Thread Marcone via Digitalmars-d-learn
How make dub import local D modules (mymodule.d) dependencies?

Re: weird formattedRead

2021-04-09 Thread Ali Çehreli via Digitalmars-d-learn
On 4/9/21 11:17 AM, Berni44 wrote: > I'm on reworking completely the docs of `std.format`. Awesome! :) Ali

Re: KQueue and Fibers

2021-04-09 Thread Jacob Carlborg via Digitalmars-d-learn
On 2021-04-09 11:00, rashir wrote: Goodmorning everyone, I'm trying to understand both Kqueue and Fiber's operation on Mac. Why don't I get the correct data as long as I read from the socket? It seems to be reading too early, but Kquue tells me that the socket is readable. ```D    const

Re: weird formattedRead

2021-04-09 Thread Berni44 via Digitalmars-d-learn
On Friday, 9 April 2021 at 16:11:26 UTC, Oleg B wrote: valid '1/1/1': 0001-Jan-01 00:00:00 <<< see here [...] Is space a special char for `formattedRead` and it simple stop parse without throwing exception if not found space (that represented in fmt string)? Have `formattedRead` any other

Re: weird formattedRead

2021-04-09 Thread frame via Digitalmars-d-learn
On Friday, 9 April 2021 at 16:11:26 UTC, Oleg B wrote: Is space a special char for `formattedRead` and it simple stop parse without throwing exception if not found space (that represented in fmt string)? Have `formattedRead` any other special chars? Or it's bug? I think it's a bug: The

Re: weird formattedRead

2021-04-09 Thread Ali Çehreli via Digitalmars-d-learn
On 4/9/21 9:11 AM, Oleg B wrote: > Is space a special char for `formattedRead` and it simple stop parse > without throwing exception if not found space Yes: The space character means "zero or more white space". Ali P.S. I can't check whether the D standard library documentation includes that

weird formattedRead

2021-04-09 Thread Oleg B via Digitalmars-d-learn
Hello, I have some doubts about working `formattedRead` with space chars. Example: ```d import std : formattedRead, DateTime, stderr, each; DateTime parseDT(string str) { int d,mo,y, h,m,s; formattedRead!"%d/%d/%d %d:%d:%d"(str, d,mo,y, h,m,s); return DateTime(y,mo,d, h,m,s); }

Re: Counting number of regular expressions matches

2021-04-09 Thread Mitacha via Digitalmars-d-learn
On Friday, 9 April 2021 at 15:01:58 UTC, Alain De Vos wrote: I've got, import std.regex: regex,matchAll; ... string regfiltertext="\\b"~entryfilter.getText()~"\\b"; auto reg = regex(regfiltertext); auto result = name.strip("_").matchAll(reg); int t=0; foreach (c; result) t+=1; This make t the

Counting number of regular expressions matches

2021-04-09 Thread Alain De Vos via Digitalmars-d-learn
I've got, import std.regex: regex,matchAll; ... string regfiltertext="\\b"~entryfilter.getText()~"\\b"; auto reg = regex(regfiltertext); auto result = name.strip("_").matchAll(reg); int t=0; foreach (c; result) t+=1; This make t the number of regular expressions matches. Is there a better way to

Re: DMD64 2.095.1 unresolved _D4core8internal7switch___T14__switch_error in optimized build only

2021-04-09 Thread x3g6h7k8 via Digitalmars-d-learn
On Friday, 9 April 2021 at 12:41:02 UTC, MoonlightSentinel wrote: On Friday, 9 April 2021 at 11:36:21 UTC, x3g6h7k8 wrote: The interesting point is this happens only in optimized builds. In debug builds everything is fine. Looks like DMD skips the codegen for this template instance because

Re: Is there a more elegant way to do this in D?

2021-04-09 Thread ddcovery via Digitalmars-d-learn
On Thursday, 8 April 2021 at 04:02:26 UTC, Ali Çehreli wrote: On 4/7/21 8:57 PM, Brad wrote:     auto a = [1,0,1,1,1,0,1,0,1,1,1,1,0]; I want to come out of this with a string that looks like this: 101110100 Me, me, me, me! :) import std; void main() { auto a =

Re: Asking about performance of std concatenation vs. Appender vs. custom class

2021-04-09 Thread ludo via Digitalmars-d-learn
reserving cuts down on the reallocations, but that only takes some of the time. Appending a 1000-element int array is going to go from a 16-byte block, to a 32-byte block, etc. up to a 4096 byte block. This involves roughly 8 reallocations per test. But every append requires an opaque

Re: DMD64 2.095.1 unresolved _D4core8internal7switch___T14__switch_error in optimized build only

2021-04-09 Thread MoonlightSentinel via Digitalmars-d-learn
On Friday, 9 April 2021 at 11:36:21 UTC, x3g6h7k8 wrote: The interesting point is this happens only in optimized builds. In debug builds everything is fine. Looks like DMD skips the codegen for this template instance because it erroneously assumes that the template is already emitted in

DMD64 2.095.1 unresolved _D4core8internal7switch___T14__switch_error in optimized build only

2021-04-09 Thread x3g6h7k8 via Digitalmars-d-learn
Working on a project with some dozen source files and an external dependency on botan building with integrated dub. There is only minimal templating used on my side. Using DMD 64bit 2.095.1 I get the following error: ``` app_win_dmd_a64_rel.obj : error LNK2019: unresolved external symbol

Re: KQueue and Fibers

2021-04-09 Thread rashir via Digitalmars-d-learn
On Friday, 9 April 2021 at 09:49:24 UTC, Arjan wrote: On Friday, 9 April 2021 at 09:00:17 UTC, rashir wrote: Goodmorning everyone, I'm trying to understand both Kqueue and Fiber's operation on Mac. Why don't I get the correct data as long as I read from the socket? It seems to be reading too

Re: KQueue and Fibers

2021-04-09 Thread Arjan via Digitalmars-d-learn
On Friday, 9 April 2021 at 09:00:17 UTC, rashir wrote: Goodmorning everyone, I'm trying to understand both Kqueue and Fiber's operation on Mac. Why don't I get the correct data as long as I read from the socket? It seems to be reading too early, but Kquue tells me that the socket is readable.

Re: Is there a more elegant way to do this in D?

2021-04-09 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 8 April 2021 at 22:27:38 UTC, Alain De Vos wrote: So which concrete types do you give for the two auto's. Like Paul said. But if you really wanted to type it out: a is int[], conv is ubyte[] and the map is lazy, so add .array and it evaluates to char[]