Re: Building GUI projects with D

2018-10-21 Thread dangbinghoo via Digitalmars-d-learn
On Saturday, 20 October 2018 at 15:40:07 UTC, karis njiru wrote: Hi. Am a computer science student from Kenya and decided to use D for my class project on Principles of Programming Languages. Am having a lot of fun with D but have come across an issue. I have been using Visual D for the past 2

Re: assigment to null class object member compiled? is this a bug?

2018-10-21 Thread dangbinghoo via Digitalmars-d-learn
On Friday, 19 October 2018 at 09:08:32 UTC, Vijay Nayar wrote: Technically the code you have is syntactically correct. You are permitted to create a class variable without assigning it to a class object. (Assigning it to a class object would look like "A a = new A();") Which section of The

Re: Can this recursive template type with named type parameters be simplified or improved?

2018-10-21 Thread Hakan Aras via Digitalmars-d-learn
On Sunday, 21 October 2018 at 21:23:35 UTC, aliak wrote: Hi, I'm playing around with a recursive template type that allows for named template parameters. The problem is that it requires a lot of repetition and becomes more error prone as the number of named arguments increase. So 1) Any

error initializing an immutable struct member with a function that takes a lazy param

2018-10-21 Thread aliak via Digitalmars-d-learn
Hi, The code below fails with "Error: delegate `onlineapp.A!int.A.__dgliteral2` cannot be struct members": T f(T)(lazy T value) { return value; } struct A(T) { immutable a = f("hi"); } void main() { A!int i; } Removing the lazy keyword fixes the error. But I'm wondering if I can

Can this recursive template type with named type parameters be simplified or improved?

2018-10-21 Thread aliak via Digitalmars-d-learn
Hi, I'm playing around with a recursive template type that allows for named template parameters. The problem is that it requires a lot of repetition and becomes more error prone as the number of named arguments increase. So 1) Any ideas on how to make it less error prone? less repetition? a

Re: Which Docker to use?

2018-10-21 Thread Jon Degenhardt via Digitalmars-d-learn
On Sunday, 21 October 2018 at 18:11:37 UTC, Jacob Carlborg wrote: On 2018-10-18 01:15, Jon Degenhardt wrote: I need to use docker to build static linked Linux executables. My reason is specific, may be different than the OP's. I'm using Travis-CI to build executables. Travis-CI uses Ubuntu

Re: Can opApply be made @nogc?

2018-10-21 Thread welkam via Digitalmars-d-learn
DIP 1000 says: Delegates currently defensively allocate closures with the GC. Few actually escape, and with scope only those that actually escape need to have the closures allocated. https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md#benefits

Re: Which Docker to use?

2018-10-21 Thread Jacob Carlborg via Digitalmars-d-learn
On 2018-10-18 01:15, Jon Degenhardt wrote: I need to use docker to build static linked Linux executables. My reason is specific, may be different than the OP's. I'm using Travis-CI to build executables. Travis-CI uses Ubuntu 14.04, but static linking fails on 14.04. The standard C library from

Re: Why is dynamic array length required here?

2018-10-21 Thread Samir via Digitalmars-d-learn
Stanislav, Ali, Mike -- Thank you all for your thoughtful and helpful replies to my queries. Apologies that it has taken this long to reply to you. I still haven't been able to find time to go through all of the code examples provided but hope to do so later this week. If I have additional

Re: Building GUI projects with D

2018-10-21 Thread Jacob Carlborg via Digitalmars-d-learn
On 2018-10-20 17:40, karis njiru wrote: Hi. Am a computer science student from Kenya and decided to use D for my class project on Principles of Programming Languages. Am having a lot of fun with D but have come across an issue. I have been using Visual D for the past 2 months for my coding but