Duplicate class/interface/struct completely

2019-03-25 Thread Michelle Long via Digitalmars-d-learn
Given a class/interface/struct, I'd like to duplicate it's design exactly, as if I copied and pasted directly from the source and just changed the name. I need to inspect the contents too. Is this possible with D? Main things I'm thinking will fail are (multiple) alias this unless there is a

Re: Issues with std.net.curl on Win 10 x64

2019-03-25 Thread Boris Carvajal via Digitalmars-d-learn
On Monday, 25 March 2019 at 16:25:37 UTC, cptgrok wrote: Am I doing something wrong or is there some issue with curl or something else? I'm pretty new to D and I'm not sure if I need to go right down to raw sockets and re-invent the wheel or if there is some other library that can help. If I ge

Re: Derive from interface

2019-03-25 Thread Daniel Kozak via Digitalmars-d-learn
It depends on what you want. But you can always use composition instead of inheritance for B. I have been using things like alias this, mixin and ufcs to achive multiple iheritence and it works ok for me. On Mon, Mar 25, 2019 at 10:40 PM Michelle Long via Digitalmars-d-learn < digitalmars-d-learn

Derive from interface

2019-03-25 Thread Michelle Long via Digitalmars-d-learn
Since D does not support multiple inheritance, is there any way to effectively achieve this? class A; class B; class C : A, interface!B; Then it is as if I have done class A; interface iB; class B : iB; class C : A, iB; But I can then do C c = new B; (but since I can't make B inherit iB

design question, gtkd object interdependence

2019-03-25 Thread number via Digitalmars-d-learn
I have a design question about (i guess) object interdependence using gtkd. There is an application class which sets its property mAppWin. The app is passed as an argument to the window constructor. During the window constructor a scale (trackbar) is created which also receives and stores an

Re: Issues with std.net.curl on Win 10 x64

2019-03-25 Thread Seb via Digitalmars-d-learn
On Monday, 25 March 2019 at 19:02:18 UTC, cptgrok wrote: On Monday, 25 March 2019 at 16:44:12 UTC, Andre Pany wrote: First idea, please switch to x86_64 if possible. This will also be the default of Dub in the next dmd release or the release after. Kind regards Andrew Figured out --arch=x86

Re: Issues with std.net.curl on Win 10 x64

2019-03-25 Thread cptgrok via Digitalmars-d-learn
On Monday, 25 March 2019 at 16:44:12 UTC, Andre Pany wrote: First idea, please switch to x86_64 if possible. This will also be the default of Dub in the next dmd release or the release after. Kind regards Andrew Figured out --arch=x86_64, thanks! Sadly I don't see any change. I'm not having

Re: Emulating DLL

2019-03-25 Thread Craig via Digitalmars-d-learn
On Thursday, 21 March 2019 at 02:27:46 UTC, SrMordred wrote: On Tuesday, 19 March 2019 at 19:50:15 UTC, Craig wrote: Take a look at my lib, its a simple hot-reload external dll lib: https://github.com/SrMordred/reloaded I did´nt use it extensively, but its simple enough to be tweaked at your

Re: Issues with std.net.curl on Win 10 x64

2019-03-25 Thread Andre Pany via Digitalmars-d-learn
On Monday, 25 March 2019 at 16:25:37 UTC, cptgrok wrote: I need to review syslogs for over 160 systems monthly, and I am trying to write a utility to automate bulk downloads from a custom web service where they are hosted. I need to calculate a date range for the prior month, add start and end

Issues with std.net.curl on Win 10 x64

2019-03-25 Thread cptgrok via Digitalmars-d-learn
I need to review syslogs for over 160 systems monthly, and I am trying to write a utility to automate bulk downloads from a custom web service where they are hosted. I need to calculate a date range for the prior month, add start and end date and a serial number to the query string for each sys

Re: "if" statement

2019-03-25 Thread Michelle Long via Digitalmars-d-learn
On Sunday, 24 March 2019 at 12:45:13 UTC, Francesco Mecca wrote: https://run.dlang.io/is/zRcj59 ``` alias Alg = Algebraic!(int, string); void main() { int n = 2; Alg value; value = n == 2 ? 2 : "string"; } ``` The original code used SumType but the effect is the same. I suppo

Re: Calling D library from other languages on linux using foreign threads

2019-03-25 Thread tchaloupka via Digitalmars-d-learn
On Saturday, 23 March 2019 at 17:33:31 UTC, tchaloupka wrote: I've no idea what should be done with C's main thread as it can't be attached because it'll hang. In one of forum threads I've also read the idea to not using foreign threads with GC but somehow delegate their work to D's thread. Can

Re: Why this eponymous template does not compile?

2019-03-25 Thread Bastiaan Veelo via Digitalmars-d-learn
On Monday, 25 March 2019 at 09:27:03 UTC, Victor Porton wrote: /tmp/temp_7F3C101460D0.d(9,5): Error: template instance `synchronizedMemoize!f` template `synchronizedMemoize` is not defined, did you mean sychronizedMemoize(alias fun)()? Why the error? Sometimes, template error messages are ha

Re: Why this eponymous template does not compile?

2019-03-25 Thread aliak via Digitalmars-d-learn
On Monday, 25 March 2019 at 09:27:03 UTC, Victor Porton wrote: /// template sychronizedMemoize(alias fun) { void sychronizedMemoize() { } } void f() { } void main() { synchronizedMemoize!f(); } /// /tmp/temp_7F3C101460D0.d(9,5): Error: template instance `synchronizedMemoize!f` templat

Why this eponymous template does not compile?

2019-03-25 Thread Victor Porton via Digitalmars-d-learn
/// template sychronizedMemoize(alias fun) { void sychronizedMemoize() { } } void f() { } void main() { synchronizedMemoize!f(); } /// /tmp/temp_7F3C101460D0.d(9,5): Error: template instance `synchronizedMemoize!f` template `synchronizedMemoize` is not defined, did you mean sychronize

Re: "if" statement

2019-03-25 Thread Benjamin Schaaf via Digitalmars-d-learn
On Sunday, 24 March 2019 at 12:45:13 UTC, Francesco Mecca wrote: https://run.dlang.io/is/zRcj59 ``` alias Alg = Algebraic!(int, string); void main() { int n = 2; Alg value; value = n == 2 ? 2 : "string"; } ``` The original code used SumType but the effect is the same. I suppo