Re: May be a simple dub answer if my question even makes sense?

2016-09-23 Thread rikki cattermole via Digitalmars-d-learn
On 24/09/2016 2:33 PM, WhatMeWorry wrote: I have D opengl/glfw3 program that I wrote which compiles and runs fine, but I always felt it was a bit of a Visual Studio hack. So I thought I'd start anew but this time use dub from the get go. So I did dub int...etc. And put my existing code into

May be a simple dub answer if my question even makes sense?

2016-09-23 Thread WhatMeWorry via Digitalmars-d-learn
I have D opengl/glfw3 program that I wrote which compiles and runs fine, but I always felt it was a bit of a Visual Studio hack. So I thought I'd start anew but this time use dub from the get go. So I did dub int...etc. And put my existing code into the app.d file. But when I try to

Re: Vibe.d help

2016-09-23 Thread Gestalt Theory via Digitalmars-d-learn
On Thursday, 22 September 2016 at 09:14:46 UTC, Martin Tschierschke wrote: On Thursday, 22 September 2016 at 01:38:12 UTC, Gestalt Theory wrote: 3. How to serve static files properly? sendFile(req, res, Path(req.path)); Does the trick inside the handler. @5. There is a solution,

Re: Member not accessible in delegate body

2016-09-23 Thread Yuxuan Shui via Digitalmars-d-learn
On Friday, 23 September 2016 at 15:29:43 UTC, Rene Zwanenburg wrote: On Friday, 23 September 2016 at 07:54:15 UTC, John C wrote: How is it possible that "onTextChanged" isn't accessible but the private method "changeSize" *is*? Smells like an oversight. I guess the compiler doesn't see the

Re: Member not accessible in delegate body

2016-09-23 Thread John C via Digitalmars-d-learn
On Friday, 23 September 2016 at 18:20:24 UTC, Martin Nowak wrote: Please file a bug report issues.dlang.org, shouldn't be difficult to fix. Done: https://issues.dlang.org/show_bug.cgi?id=16531

Re: Member not accessible in delegate body

2016-09-23 Thread Martin Nowak via Digitalmars-d-learn
On Friday, 23 September 2016 at 07:54:15 UTC, John C wrote: If I try to call the protected method of a superclass from inside the body of a delegate, the compiler won't allow it. void layoutTransaction(Control c, void delegate() action) { // do stuff action(); // do more stuff } class

Re: Member not accessible in delegate body

2016-09-23 Thread Rene Zwanenburg via Digitalmars-d-learn
On Friday, 23 September 2016 at 07:54:15 UTC, John C wrote: How is it possible that "onTextChanged" isn't accessible but the private method "changeSize" *is*? Smells like an oversight. I guess the compiler doesn't see the delegate as a member of a Control subclass, so it can't access

Re: Vibe.d compilation error: backend/cgelem.c 5018 dmd failed with exit code 1.

2016-09-23 Thread Rene Zwanenburg via Digitalmars-d-learn
On Friday, 23 September 2016 at 08:39:44 UTC, llaine wrote: Okay I tried yesterday, after 4hours of process, I never went through the end of minification. At the beginning I enter YES should I enter NO instead? Hmm that's strange. I don't get any yes or no questions. What is the exact

Re: Meta-programming: iterating over a container with different types

2016-09-23 Thread deed via Digitalmars-d-learn
On Friday, 23 September 2016 at 09:21:56 UTC, Claude wrote: ... // Maybe you can try using std.variant? import std.variant; alias Component = Variant; class Entity { void register (Component v) { components ~= v; } void unregister (T) () { foreach (i, c; components) if

Meta-programming: iterating over a container with different types

2016-09-23 Thread Claude via Digitalmars-d-learn
It's more a general meta-programming question than a specific D stuff. For an entity-component engine, I am trying to do some run-time composition: registering a certain type (component) to a structure (entity). I would like to know how I can iterate an entity and get the different type

Re: Vibe.d compilation error: backend/cgelem.c 5018 dmd failed with exit code 1.

2016-09-23 Thread llaine via Digitalmars-d-learn
On Thursday, 22 September 2016 at 14:40:10 UTC, Saurabh Das wrote: On Thursday, 22 September 2016 at 10:44:29 UTC, llaine wrote: dub dustmite ./dustmite_output/ --compiler-regex="Internal Error" -b release Okay I tried yesterday, after 4hours of process, I never went through the end of

Member not accessible in delegate body

2016-09-23 Thread John C via Digitalmars-d-learn
If I try to call the protected method of a superclass from inside the body of a delegate, the compiler won't allow it. void layoutTransaction(Control c, void delegate() action) { // do stuff action(); // do more stuff } class Control { protected void onTextChanged() {} } class Label :