Re: std.logger issue

2023-01-26 Thread Krzysztof Jajeśnica via Digitalmars-d-learn
On Thursday, 26 January 2023 at 17:17:28 UTC, o3o wrote: how can I enable `trace` level? Set `sharedLog.logLevel` instead of `globalLogLevel`. ```d // Note: the cast is needed because sharedLog is shared (cast()sharedLog).logLevel = LogLevel.all; ``` Explanation: logging functions (`trace`,

Re: what wrong with this alias

2023-01-08 Thread Krzysztof Jajeśnica via Digitalmars-d-learn
On Sunday, 8 January 2023 at 05:42:46 UTC, Qusatlegadus wrote: auto s = 1234.to!string.map!q{a - '0'}.sum; works fine. but if i do an alias alias comb = to!string.map!q{a - '0'} Error: unknown, please file report on issues.dlang.org What's wrong with this ## Simple explanation

Re: DConf '22: No-Allocated 0-terminated path strings

2022-10-21 Thread Krzysztof Jajeśnica via Digitalmars-d-learn
On Friday, 21 October 2022 at 14:34:47 UTC, ag0aep6g wrote: Nitpick: You cannot iterate a true input range twice. You need a forward range for that. Nitpick²: you don't actually need to iterate the range twice ```d //version=AllowMalloc; auto toCStringThen(alias dg, Range)(Range src)

Re: Does D actually support flexible array members?

2022-08-18 Thread Krzysztof Jajeśnica via Digitalmars-d-learn
No, D does not support flexible array members or dynamically sized structs. `char[]` is a D slice, which is NOT equivalent to a C array. A slice is basically a pointer+length pair: ```d // you can't actually name a struct `char[]`, it's just for explanation purposes struct char[] { char*

Re: Execute the Shell command and continue executing the algorithm

2022-05-30 Thread Krzysztof Jajeśnica via Digitalmars-d-learn
On Monday, 30 May 2022 at 11:18:42 UTC, Alexander Zhirov wrote: I want to run a command in the background during the execution of the algorithm, and without waiting for its actual execution, because it is "infinite", while continuing the execution of the algorithm and then, knowing the ID of