Re: A GtkD issue

2022-08-18 Thread frame via Digitalmars-d-learn
On Friday, 19 August 2022 at 00:40:40 UTC, pascal111 wrote: Now, I used cmd.exe and found this new errors: "lld-link: error: undefined symbol: __D3gio5FileT12__ModuleInfoZ referenced by If you don't post the exact command you are using we can just assume what you did wrong: The linker is

Re: Programs in D are huge

2022-08-18 Thread Patrick Schluter via Digitalmars-d-learn
On Thursday, 18 August 2022 at 17:15:12 UTC, rikki cattermole wrote: On 19/08/2022 4:56 AM, IGotD- wrote: BetterC means no arrays or strings library and usually in terminal tools you need to process text. Full D is wonderful for such task but betterC would be limited unless you want to write

Re: This code completely breaks the compiler:

2022-08-18 Thread Mike Parker via Digitalmars-d-learn
On Friday, 19 August 2022 at 04:25:25 UTC, Ruby The Roobster wrote: So that's why it compiled. Still, I believe that stuff like this ought to be detected at compile time, as supposed to in a unittest or, if someone forgot to write the tests, in production. If the template is never instanti

Re: This code completely breaks the compiler:

2022-08-18 Thread Ruby The Roobster via Digitalmars-d-learn
On Friday, 19 August 2022 at 04:16:28 UTC, JG wrote: On Friday, 19 August 2022 at 03:13:03 UTC, Ruby The Roobster wrote: On Friday, 19 August 2022 at 03:10:38 UTC, Ruby The Roobster wrote: This snippet compiles. Even if `dsds` and `sadsad` are defined nowhere, this code compiles. [SNIP] The

Re: This code completely breaks the compiler:

2022-08-18 Thread JG via Digitalmars-d-learn
On Friday, 19 August 2022 at 03:13:03 UTC, Ruby The Roobster wrote: On Friday, 19 August 2022 at 03:10:38 UTC, Ruby The Roobster wrote: This snippet compiles. Even if `dsds` and `sadsad` are defined nowhere, this code compiles. [SNIP] The reason why this compiles is because of the varidic t

Re: This code completely breaks the compiler:

2022-08-18 Thread Ruby The Roobster via Digitalmars-d-learn
On Friday, 19 August 2022 at 03:10:38 UTC, Ruby The Roobster wrote: This snippet compiles. Even if `dsds` and `sadsad` are defined nowhere, this code compiles. [SNIP] The reason why this compiles is because of the varidic template parameter, `Mtypes`. Either there is something I'm missing,

This code completely breaks the compiler:

2022-08-18 Thread Ruby The Roobster via Digitalmars-d-learn
This snippet compiles. Even if `dsds` and `sadsad` are defined nowhere, this code compiles. ```d import std.typecons : Tuple; sadsad executeFunction(Mtypes...)(dstring func, Tuple!(Mtypes) args) { static foreach(type; typel.keys) { mixin(typel[type] ~ " ret"d ~ type ~ ";");

Re: Recommendation for parallelism with nested for loops?

2022-08-18 Thread Ali Çehreli via Digitalmars-d-learn
On 8/18/22 18:49, Shriramana Sharma wrote: > Hello. I want to parallelize a computation which has two for loops An option is to add tasks individually but I am not sure how wise doing this and I don't know how to determine whether all tasks are completed. In any case, Roy Margalit's DConf 2022

Re: Recommendation for parallelism with nested for loops?

2022-08-18 Thread Adam D Ruppe via Digitalmars-d-learn
On Friday, 19 August 2022 at 01:49:43 UTC, Shriramana Sharma wrote: Also, what is the best way to do parallelism in such a situation? If the inner loops are about the same size for each pass of the outer loop, you can just simply parallel on the outer loop and get the same benefit. Even if

Recommendation for parallelism with nested for loops?

2022-08-18 Thread Shriramana Sharma via Digitalmars-d-learn
Hello. I want to parallelize a computation which has two for loops, one nested within another. All inner-loop-param+outer-loop-param combinations can be computed independent of one another. As I suspected, [https://forum.dlang.org/post/xysyidbkjdinclmrx...@forum.dlang.org](this forum post) sa

Re: A GtkD issue

2022-08-18 Thread pascal111 via Digitalmars-d-learn
On Monday, 15 August 2022 at 17:33:25 UTC, frame wrote: On Saturday, 13 August 2022 at 01:14:09 UTC, pascal111 wrote: I was following instructions from this link https://gtkdcoding.com/2019/01/11/-introduction-to-gtkDcoding.html to setup GtkD, and tried to run the example with VSCode and fou

Re: Compile time int to string conversion in BetterC

2022-08-18 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 17 August 2022 at 11:38:31 UTC, Steven Schveighoffer wrote: On 8/17/22 6:38 AM, Dennis wrote: On Wednesday, 17 August 2022 at 08:44:30 UTC, Ogi wrote: Maybe I’m missing something? I had the same problem, and came up with the following trick: ```D enum itoa(int i) = i.stringof;

Re: Programs in D are huge

2022-08-18 Thread rikki cattermole via Digitalmars-d-learn
On 19/08/2022 4:56 AM, IGotD- wrote: BetterC means no arrays or strings library and usually in terminal tools you need to process text. Full D is wonderful for such task but betterC would be limited unless you want to write your own array and string functionality. Unicode support in Full D

Re: Programs in D are huge

2022-08-18 Thread IGotD- via Digitalmars-d-learn
On Wednesday, 17 August 2022 at 17:25:51 UTC, Ali Çehreli wrote: On 8/17/22 09:28, Diego wrote: > I'm writing a little terminal tool, so i think `-betterC` is the best > and simple solution in my case. It depends on what you mean with terminal tool bun in general, no, full features of D is the

Re: Programs in D are huge

2022-08-18 Thread Diego via Digitalmars-d-learn
On Wednesday, 17 August 2022 at 17:25:51 UTC, Ali Çehreli wrote: On 8/17/22 09:28, Diego wrote: > I'm writing a little terminal tool, so i think `-betterC` is the best > and simple solution in my case. It depends on what you mean with terminal tool bun in general, no, full features of D is the

Re: Does D actually support flexible array members?

2022-08-18 Thread Paul Backus via Digitalmars-d-learn
On Thursday, 18 August 2022 at 08:41:02 UTC, LinguisticMystic wrote: I'm porting some C code for arena allocator to D, and somehow the flexible array members (a feature of C99 for dynamically-sized structs) work in D without significant changes in the code. Here's my arena definition: ``` str

Re: Does D actually support flexible array members?

2022-08-18 Thread LinguisticMystic via Digitalmars-d-learn
On Thursday, 18 August 2022 at 09:48:48 UTC, Krzysztof Jajeśnica wrote: ... Okay, got it, thanks.

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* p

Does D actually support flexible array members?

2022-08-18 Thread LinguisticMystic via Digitalmars-d-learn
I'm porting some C code for arena allocator to D, and somehow the flexible array members (a feature of C99 for dynamically-sized structs) work in D without significant changes in the code. Here's my arena definition: ``` struct ArenaChunk { size_t size; ArenaChunk* next; char[] mem