Re: modules and mains

2021-08-22 Thread Brian Tiffin via Digitalmars-d-learn
On Sunday, 22 August 2021 at 10:24:13 UTC, Mathias LANG wrote: On Sunday, 22 August 2021 at 03:22:02 UTC, Brian Tiffin wrote: ... IIUC, you want to generate multiple binaries, too ? In which case, I think you need more of a build tool solution than a language solution. Recent-ish versions

Re: implimenting interface function by inheriting from other class

2021-08-22 Thread Alexey via Digitalmars-d-learn
On Sunday, 22 August 2021 at 12:20:56 UTC, Alexey wrote: On Saturday, 21 August 2021 at 20:35:43 UTC, Alexey wrote: Hello ```D interface Int { void coolFunc(); } class C1 { void coolFunc() { return; } } class C2 : C1, Int { } void main() { auto c = new C2; } ```

Re: Potential strategy for avoiding problems with copy of a struct (maybe??)

2021-08-22 Thread jfondren via Digitalmars-d-learn
On Sunday, 22 August 2021 at 14:40:29 UTC, james.p.leblanc wrote: It is a bit scary how you guessed very closely what I am trying to do. I have a AVX aligned pointers (obtained from fftw_malloc), that I want to protect. To be a bit more specific. The code that reads/writes from to/from

Re: Potential strategy for avoiding problems with copy of a struct (maybe??)

2021-08-22 Thread james.p.leblanc via Digitalmars-d-learn
On Sunday, 22 August 2021 at 14:35:48 UTC, Ali Çehreli wrote: On 8/22/21 6:03 AM, james.p.leblanc wrote: > struct Foo { > int a, b, c; > Foo* myadd; > > this(int a, int b, int c) { > this.a = a; > this.b = b; > this.c = c; >

Re: Potential strategy for avoiding problems with copy of a struct (maybe??)

2021-08-22 Thread james.p.leblanc via Digitalmars-d-learn
On Sunday, 22 August 2021 at 13:37:50 UTC, jfondren wrote: this(this) { unique = null; } ~this() { pureFree(unique); } } Dear jfondren, I truly appreciate you taking the time to help me with my question! **This bit of magic with the postblit may hold the

Re: Potential strategy for avoiding problems with copy of a struct (maybe??)

2021-08-22 Thread Ali Çehreli via Digitalmars-d-learn
On 8/22/21 6:03 AM, james.p.leblanc wrote: > struct Foo { > int a, b, c; > Foo* myadd; > > this(int a, int b, int c) { > this.a = a; > this.b = b; > this.c = c; > this.myadd = As Matthias Lang mentioned,

Re: dlang opengl / gl / glu /glut library.

2021-08-22 Thread Виталий Фадеев via Digitalmars-d-learn
On Sunday, 22 August 2021 at 13:28:24 UTC, Mike Parker wrote: On Sunday, 22 August 2021 at 12:22:41 UTC, Виталий Фадеев wrote: https://forum.dlang.org/post/s5pvtq$2q83$1...@digitalmars.com On Wednesday, 21 April 2021 at 19:54:35 UTC, rikki cattermole wrote: On 22/04/2021 7:51 AM, Alain De

Re: Potential strategy for avoiding problems with copy of a struct (maybe??)

2021-08-22 Thread jfondren via Digitalmars-d-learn
On Sunday, 22 August 2021 at 13:03:20 UTC, james.p.leblanc wrote: On Sunday, 22 August 2021 at 11:10:33 UTC, jfondren wrote: On Sunday, 22 August 2021 at 07:58:12 UTC, james.p.leblanc wrote: Hello, If you don't get an answer that you like, I suggesting posting functional code and then

Re: dlang opengl / gl / glu /glut library.

2021-08-22 Thread Виталий Фадеев via Digitalmars-d-learn
On Sunday, 22 August 2021 at 13:28:24 UTC, Mike Parker wrote: On Sunday, 22 August 2021 at 12:22:41 UTC, Виталий Фадеев wrote: https://forum.dlang.org/post/s5pvtq$2q83$1...@digitalmars.com On Wednesday, 21 April 2021 at 19:54:35 UTC, rikki cattermole wrote: On 22/04/2021 7:51 AM, Alain De

Re: dlang opengl / gl / glu /glut library.

2021-08-22 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 22 August 2021 at 12:22:41 UTC, Виталий Фадеев wrote: https://forum.dlang.org/post/s5pvtq$2q83$1...@digitalmars.com On Wednesday, 21 April 2021 at 19:54:35 UTC, rikki cattermole wrote: On 22/04/2021 7:51 AM, Alain De Vos wrote: import bindc.opengl; bindbc bindbc-opengl

Re: Potential strategy for avoiding problems with copy of a struct (maybe??)

2021-08-22 Thread james.p.leblanc via Digitalmars-d-learn
On Sunday, 22 August 2021 at 11:10:33 UTC, jfondren wrote: On Sunday, 22 August 2021 at 07:58:12 UTC, james.p.leblanc wrote: Hello, If you don't get an answer that you like, I suggesting posting functional code and then stating your dissastisfactions with it. Mattias, jfondren, Thanks both

dlang opengl / gl / glu /glut library.

2021-08-22 Thread Виталий Фадеев via Digitalmars-d-learn
https://forum.dlang.org/post/s5pvtq$2q83$1...@digitalmars.com On Wednesday, 21 April 2021 at 19:54:35 UTC, rikki cattermole wrote: On 22/04/2021 7:51 AM, Alain De Vos wrote: import bindc.opengl; bindbc bindbc-opengl provides glu* functions ? gluNewTess gluTessCallback gluTessProperty

Re: implimenting interface function by inheriting from other class

2021-08-22 Thread Alexey via Digitalmars-d-learn
On Saturday, 21 August 2021 at 20:35:43 UTC, Alexey wrote: Hello ```D interface Int { void coolFunc(); } class C1 { void coolFunc() { return; } } class C2 : C1, Int { } void main() { auto c = new C2; } ``` dmd says it's not Ok: t.d(14): Error: class `t.C2`

Re: Potential strategy for avoiding problems with copy of a struct (maybe??)

2021-08-22 Thread jfondren via Digitalmars-d-learn
On Sunday, 22 August 2021 at 07:58:12 UTC, james.p.leblanc wrote: Hello, Question about a possible strategy to avoid problems with undesired/unintended copying of a structure: 1) We have a struct, call this **Foo**. 2) We instantiate it with, **x = Foo(a,b,c);** a. our constructor

Re: Potential strategy for avoiding problems with copy of a struct (maybe??)

2021-08-22 Thread Mathias LANG via Digitalmars-d-learn
On Sunday, 22 August 2021 at 07:58:12 UTC, james.p.leblanc wrote: Is there a better way? Best Regards, James ``` public mixin template NonMovableOrCopyable () { @disable this (); @disable this (this); @disable ref typeof (this) opAssign () (auto ref typeof(this) rhs); } ```

Re: modules and mains

2021-08-22 Thread Mathias LANG via Digitalmars-d-learn
On Sunday, 22 August 2021 at 03:22:02 UTC, Brian Tiffin wrote: Is this wrong thinking? I'm ~~working on~~ playing with a first project. Meant to be a suite of tools, each usable from the command line, i.e. with a `main`. Then a manager program that accepts subcommands for dispatch *and

Potential strategy for avoiding problems with copy of a struct (maybe??)

2021-08-22 Thread james.p.leblanc via Digitalmars-d-learn
Hello, Question about a possible strategy to avoid problems with undesired/unintended copying of a structure: 1) We have a struct, call this **Foo**. 2) We instantiate it with, **x = Foo(a,b,c);** a. our constructor will initialize a field: **this.myadd = ** b. this capture

Re: modules and mains

2021-08-22 Thread Brian Tiffin via Digitalmars-d-learn
On Sunday, 22 August 2021 at 04:38:58 UTC, Ali Çehreli wrote: On 8/21/21 8:46 PM, Brian Tiffin wrote: > prompt$ cat B.d > module B; > version = boss; A cannot know about 'version' condition inside B. The solution is to provide version on the command line. This is how I do it with dmd: $