Re: Modules ... "import" vs. "compilation" ... what is the real process here?

2021-09-27 Thread james.p.leblanc via Digitalmars-d-learn
On Tuesday, 28 September 2021 at 05:26:29 UTC, Ali Çehreli wrote: On 9/27/21 10:38 AM, james.p.leblanc wrote: In addition to what Mike Parker said, templates do complicate matters here: Templates are instantiated (i.e. compiled for a specific set of template arguments) by modules that actua

Re: Modules ... "import" vs. "compilation" ... what is the real process here?

2021-09-27 Thread james.p.leblanc via Digitalmars-d-learn
On Tuesday, 28 September 2021 at 02:05:43 UTC, Mike Parker wrote: On Monday, 27 September 2021 at 17:38:29 UTC, james.p.leblanc mpilations". Does that help? **Yes!...** === ... this helped immensely! This explanation gave me a much better understanding of how the whole process works.

Re: Modules ... "import" vs. "compilation" ... what is the real process here?

2021-09-27 Thread Ali Çehreli via Digitalmars-d-learn
On 9/27/21 10:38 AM, james.p.leblanc wrote: > I have trouble understanding "module imports" vs. "module compilations". In addition to what Mike Parker said, templates do complicate matters here: Templates are instantiated (i.e. compiled for a specific set of template arguments) by modules that

Re: Modules ... "import" vs. "compilation" ... what is the real process here?

2021-09-27 Thread Mike Parker via Digitalmars-d-learn
On Monday, 27 September 2021 at 17:38:29 UTC, james.p.leblanc wrote: Dear D-ers, I have trouble understanding "module imports" vs. "module compilations". A module is implemented in a source file. Though we often use the term "module" to refer to both, it may help to think in terms of import

Re: Inheriting function template from super class

2021-09-27 Thread Alexey via Digitalmars-d-learn
On Monday, 27 September 2021 at 16:10:54 UTC, Adam D Ruppe wrote: This is by design, overloads only consider things declared in the same place. see here https://dlang.org/articles/hijack.html thanks, Adam I'd also like to ask about similar code. If I'm writing code like so, I'm getting error

Re: better c fibers

2021-09-27 Thread Dukc via Digitalmars-d-learn
On Tuesday, 21 September 2021 at 09:37:30 UTC, Abby wrote: Hi there, I'm new in dlang I specially like betterC. I was hoping that d fibers would be implemented in without using classes, but there are not. Is there another way how to use async/await in dlang better c? Thank you for your help

Re: Mixin programming foreach

2021-09-27 Thread eXodiquas via Digitalmars-d-learn
On Monday, 27 September 2021 at 17:14:11 UTC, Ali Çehreli wrote: [...] Woah, thanks everyone for the ridiculous precise and helpful answers I got here. This forum never disappoints. :P I now try to fully understand the answers and implement the solution to the problem in a cleaner way. The

Re: Mixin programming foreach

2021-09-27 Thread Tejas via Digitalmars-d-learn
On Monday, 27 September 2021 at 17:43:22 UTC, Ali Çehreli wrote: On 9/27/21 10:26 AM, Tejas wrote: > On Monday, 27 September 2021 at 17:14:11 UTC, Ali Çehreli wrote: >> On 9/27/21 9:23 AM, eXodiquas wrote: >> >> > [...] >> >> Same here. :) >> >> > [...] >> >> Often repeated but there are no stupi

Re: abstract classes and interfaces

2021-09-27 Thread Ali Çehreli via Digitalmars-d-learn
On 9/27/21 9:30 AM, kyle wrote: That'd be great. Long live Beefconf. I miss it way too often. Gotta have some beet ready for the next BeetConf. :p Ali

Re: Mixin programming foreach

2021-09-27 Thread Ali Çehreli via Digitalmars-d-learn
On 9/27/21 10:26 AM, Tejas wrote: > On Monday, 27 September 2021 at 17:14:11 UTC, Ali Çehreli wrote: >> On 9/27/21 9:23 AM, eXodiquas wrote: >> >> > [...] >> >> Same here. :) >> >> > [...] >> >> Often repeated but there are no stupid questions. >> >> [...] > > Sometimes I wonder if I should bother

Re: abstract classes and interfaces

2021-09-27 Thread Tejas via Digitalmars-d-learn
On Monday, 27 September 2021 at 16:23:49 UTC, Adam D Ruppe wrote: On Monday, 27 September 2021 at 16:20:59 UTC, Steven Schveighoffer wrote: That's a regression. In 2.092.1, it reports: aye known bug here https://issues.dlang.org/show_bug.cgi?id=21321 maybe once dmd can compile C code we'll f

Modules ... "import" vs. "compilation" ... what is the real process here?

2021-09-27 Thread james.p.leblanc via Digitalmars-d-learn
Dear D-ers, I have trouble understanding "module imports" vs. "module compilations". For example, in the dlang.org/tour, we have: **"The import statement makes all public functions and types from the given module available."** And from the dlang.org/spec we have: **"Modules are always com

Re: Mixin programming foreach

2021-09-27 Thread Tejas via Digitalmars-d-learn
On Monday, 27 September 2021 at 17:14:11 UTC, Ali Çehreli wrote: On 9/27/21 9:23 AM, eXodiquas wrote: > [...] Same here. :) > [...] Often repeated but there are no stupid questions. [...] Sometimes I wonder if I should bother writing answers since one of you Old Guards make them redundant

Re: Mixin programming foreach

2021-09-27 Thread Tejas via Digitalmars-d-learn
On Monday, 27 September 2021 at 16:23:50 UTC, eXodiquas wrote: Howdy ho everyone, I found this forum very helpful for my (maybe) stupid questions, so I give it a try again because I don't understand what's happening here. First of all, I'm not exactly sure what this code here, from the docu

Re: Mixin programming foreach

2021-09-27 Thread Ali Çehreli via Digitalmars-d-learn
On 9/27/21 9:23 AM, eXodiquas wrote: > I found this forum very helpful Same here. :) > for my (maybe) stupid questions Often repeated but there are no stupid questions. > First of all, I'm not exactly sure what this code here, from the > documentation at https://dlang.org/articles/mixin.html,

Re: Mixin programming foreach

2021-09-27 Thread Dga123 via Digitalmars-d-learn
On Monday, 27 September 2021 at 16:59:16 UTC, eXodiquas wrote: But my last question still stands, how do I build functions that can work with those vectors because the type of those vectors is created at compile time. Here's another approach allowing to have a more obvious declaration name:

Re: Mixin programming foreach

2021-09-27 Thread eXodiquas via Digitalmars-d-learn
On Monday, 27 September 2021 at 16:49:15 UTC, Dga123 wrote: On Monday, 27 September 2021 at 16:23:50 UTC, eXodiquas wrote: Howdy ho everyone, I found this forum very helpful for my (maybe) stupid questions, so I give it a try again because I don't understand what's happening here. [...] But

Re: Mixin programming foreach

2021-09-27 Thread Dga123 via Digitalmars-d-learn
On Monday, 27 September 2021 at 16:23:50 UTC, eXodiquas wrote: Howdy ho everyone, I found this forum very helpful for my (maybe) stupid questions, so I give it a try again because I don't understand what's happening here. [...] But nevertheless, I copied the code and changed it a bit to some

Re: abstract classes and interfaces

2021-09-27 Thread kyle via Digitalmars-d-learn
On Monday, 27 September 2021 at 16:23:49 UTC, Adam D Ruppe wrote: On Monday, 27 September 2021 at 16:20:59 UTC, Steven Schveighoffer wrote: That's a regression. In 2.092.1, it reports: aye known bug here https://issues.dlang.org/show_bug.cgi?id=21321 maybe once dmd can compile C code we'll f

Mixin programming foreach

2021-09-27 Thread eXodiquas via Digitalmars-d-learn
Howdy ho everyone, I found this forum very helpful for my (maybe) stupid questions, so I give it a try again because I don't understand what's happening here. First of all, I'm not exactly sure what this code here, from the documentation at https://dlang.org/articles/mixin.html, does: ```d

Re: abstract classes and interfaces

2021-09-27 Thread Adam D Ruppe via Digitalmars-d-learn
On Monday, 27 September 2021 at 16:20:59 UTC, Steven Schveighoffer wrote: That's a regression. In 2.092.1, it reports: aye known bug here https://issues.dlang.org/show_bug.cgi?id=21321 maybe once dmd can compile C code we'll fix it so it compiles D code correctly again.

Re: abstract classes and interfaces

2021-09-27 Thread Salih Dincer via Digitalmars-d-learn
On Monday, 27 September 2021 at 16:11:31 UTC, kyle wrote: DMD compiles this providing no notice... What is the version of your DMD?

Re: abstract classes and interfaces

2021-09-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/27/21 12:11 PM, kyle wrote: I'm attempting Markdown for the first time so forgive me if that doesn't go well. Consider the following: ```d interface A {     bool broken(); } abstract class B : A { } class C : B { } void main() {     import std.stdio;     C test = new C();     writ

abstract classes and interfaces

2021-09-27 Thread kyle via Digitalmars-d-learn
I'm attempting Markdown for the first time so forgive me if that doesn't go well. Consider the following: ```d interface A { bool broken(); } abstract class B : A { } class C : B { } void main() { import std.stdio; C test = new C(); writeln(test); } ``` DMD compiles this p

Re: Inheriting function template from super class

2021-09-27 Thread Adam D Ruppe via Digitalmars-d-learn
On Monday, 27 September 2021 at 14:54:41 UTC, Alexey wrote: I'm not sure if this is my incorrect code or incorrect dmd behavior. This is by design, overloads only consider things declared in the same place. see here https://dlang.org/articles/hijack.html

Re: Inheriting function template from super class

2021-09-27 Thread Alexey via Digitalmars-d-learn
On Monday, 27 September 2021 at 14:54:41 UTC, Alexey wrote: hello. here I have some code sample. consequently, If I want C3 to inherit form C2, I'll have to forward template to from C1 to C2 by hand: ```D import std.stdio; class C1 { void writetext() { this.writetext!(typeof

Re: write struct as raw data to file

2021-09-27 Thread Vitaliy Fadeev via Digitalmars-d-learn
On Monday, 27 September 2021 at 13:45:19 UTC, Paul wrote: Vitaliy, Thanks for your assistance. I was looking at your serialization package. Is your example correct? struct MyStruct { ubyte mybyte1; @NoCereal uint nocereal1; //won't be serialised @Bits!4 ubyte nibble;

Inheriting function template from super class

2021-09-27 Thread Alexey via Digitalmars-d-learn
hello. here I have some code sample. I'm not sure if this is my incorrect code or incorrect dmd behavior. Intention is C2 to inherit C1's `void writetext(alias A1)()` and instantiate it with `this.writetext!(typeof(this))();` ```D import std.stdio; class C1 { void writetext() {

Re: write struct as raw data to file

2021-09-27 Thread Paul via Digitalmars-d-learn
Vitaliy, Thanks for your assistance. I was looking at your serialization package. Is your example correct? struct MyStruct { ubyte mybyte1; @NoCereal uint nocereal1; //won't be serialised @Bits!4 ubyte nibble; @Bits!1 ubyte bit; @Bits!3 ubyte bits3;