Re: Pass field as a template parameter

2019-05-08 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 8 May 2019 at 18:01:53 UTC, Ben Jones wrote: I'm trying to write a template function like the below... is it possible without using string mixins? void fun( alias(?) field, alias p1, alias p2)() { if(p1.field) use(p2.field); } called with something like static forea

Re: static this() not executed

2019-05-08 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-05-08 17:47:35 +, Robert M. Münch said: However, A.app is still NULL even after the static constructor run. Forget that... I used my (quite complex code, not exactly reflected in the example) not correctly... works now. -- Robert M. Münch http://www.saphirion.com smarter | bette

Pass field as a template parameter

2019-05-08 Thread Ben Jones via Digitalmars-d-learn
I'm trying to write a template function like the below... is it possible without using string mixins? void fun( alias(?) field, alias p1, alias p2)() { if(p1.field) use(p2.field); } called with something like static foreach( list of fields){ fun!(field, p1, p2)(); } I have no i

Re: static this() not executed

2019-05-08 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-05-08 17:37:38 +, Robert M. Münch said: // a.d module a; claas A { static myTemplate!A app; static this() { app = new myTemplate!A; } } void startup(State s){ s.app = A.app; } // b.d main(){ State mainState = new State;

static this() not executed

2019-05-08 Thread Robert M. Münch via Digitalmars-d-learn
// a.d module a; claas A { static myTemplate!A app; static this() { app = new myTemplate!A; } } void startup(State s){ s.app = A.app; } // b.d main(){ State mainState = new State; startup(mainState); } The first problem I have

Re: Function reference accross modules => link error: unresolved external

2019-05-08 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-05-08 17:02:07 +, Adam D. Ruppe said: Those are two *entirely different* functions, `a.otherFunc` and `myapp.otherFunc`. That's what I expected... Generally the answer here is "don't do that". Just have module a `import myapp` and then call otherFunc. That's exactly what I want

Re: Function reference accross modules => link error: unresolved external

2019-05-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 8 May 2019 at 16:20:22 UTC, Robert M. Münch wrote: Sometimes a simple thing should be obvious but... // a.d module a; int otherFunc(); main(){ otherFunc(); } // myapp.d import a; int otherFunc(){ return(1); } Those are two *entirely different* functions, `a.o

Re: Function reference accross modules => link error: unresolved external

2019-05-08 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-05-08 16:20:22 +, Robert M. Münch said: Sometimes a simple thing should be obvious but... // a.d module a; int otherFunc(); main(){ otherFunc(); } // myapp.d import a; int otherFunc(){ return(1); } Gives me an "unresolved external symbol" for otherFunc() in mya

Re: Meson build system user new to D.

2019-05-08 Thread Firstname Lastname via Digitalmars-d-learn
On Monday, 6 May 2019 at 19:52:23 UTC, Mike Brockus wrote: Hello everyone I am a Meson build system user and I am new to the D language, just wondering if there are compiler flags that I should add, unit testing frameworks, any good practices I can follow and or anything like that also some res

Function reference accross modules => link error: unresolved external

2019-05-08 Thread Robert M. Münch via Digitalmars-d-learn
Sometimes a simple thing should be obvious but... // a.d module a; int otherFunc(); main(){ otherFunc(); } // myapp.d import a; int otherFunc(){ return(1); } Gives me an "unresolved external symbol" for otherFunc() in myapp.d So, the compiler can see the reference but not t

Re: Blog Post #0032 - Menu Accelerator Keys

2019-05-08 Thread number via Digitalmars-d-learn
On Tuesday, 7 May 2019 at 17:41:42 UTC, Ron Tarrant wrote: It always makes me happy when you point out the small stuff. It means I got the big stuff right. :) I do feel a bit pedantic about it too :), on the other hand wrong comments are worse than no comments. I guess you've been away a whi

Re: Framework design, initialization and framework usage

2019-05-08 Thread Ron Tarrant via Digitalmars-d-learn
On Wednesday, 8 May 2019 at 10:21:34 UTC, Robert M. Münch wrote: However, I'm happy to post some updates/screenrecordings to show our progress. Works for me. What are you interested in or what would you do with such a framework? You sparked my interest because it sounds like you're working

Re: Compiler/Phobos/Types problem — panic level due to timing.

2019-05-08 Thread Russel Winder via Digitalmars-d-learn
On Wed, 2019-05-08 at 11:56 +, Alex via Digitalmars-d-learn wrote: > On Wednesday, 8 May 2019 at 11:53:34 UTC, Russel Winder wrote: > > On Mon, 2019-05-06 at 15:53 +, John Colvin via > > Digitalmars-d-learn wrote: > > > […] > > > > > > pretty please show people it with UFCS: > > > > > >

Re: Compiler/Phobos/Types problem — panic level due to timing.

2019-05-08 Thread Alex via Digitalmars-d-learn
On Wednesday, 8 May 2019 at 11:53:34 UTC, Russel Winder wrote: On Mon, 2019-05-06 at 15:53 +, John Colvin via Digitalmars-d-learn wrote: […] pretty please show people it with UFCS: recurrence!((a, n) => a[n-1] + a[n-2])(zero, one) .dropExactly(n) .front Any particular reason fo

Re: Compiler/Phobos/Types problem — panic level due to timing.

2019-05-08 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2019-05-06 at 15:53 +, John Colvin via Digitalmars-d-learn wrote: > […] > > pretty please show people it with UFCS: > > recurrence!((a, n) => a[n-1] + a[n-2])(zero, one) > .dropExactly(n) > .front Any particular reason for preferring this form over the original? -- Russel

Re: Framework design, initialization and framework usage

2019-05-08 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-05-08 09:15:41 +, Ron Tarrant said: This sounds like a complete replacement for either QT, MFC, or GTK as well as Glade/QT Designer all rolled into one. Let's say it's an alternative ;-) All the ones you listed are either too big, too complicated, bring too much stuff that we don

Re: Meson build system user new to D.

2019-05-08 Thread Andre Pany via Digitalmars-d-learn
On Monday, 6 May 2019 at 19:52:23 UTC, Mike Brockus wrote: Hello everyone I am a Meson build system user and I am new to the D language, just wondering if there are compiler flags that I should add, unit testing frameworks, any good practices I can follow and or anything like that also some res

Re: Framework design, initialization and framework usage

2019-05-08 Thread Ron Tarrant via Digitalmars-d-learn
On Wednesday, 8 May 2019 at 06:30:56 UTC, Robert M. Münch wrote: The goal is to have a generic framework for desktop apps where you can directly start to work on the app and don't have to care about getting all the necessary environment and building-blocks up & running. * High speed 2D grap