Re: Design by Introspection - Looking for examples

2019-01-14 Thread Petar via Digitalmars-d-learn
On Tuesday, 15 January 2019 at 00:42:37 UTC, Tony A wrote: Hi, I just watched the Andrei's talk about Design by Introspection and for what I see this is used in D. Could anyone point out some good Github examples that I can see this in action and the benefits? Thanks. Basically, look for

Design by Introspection - Looking for examples

2019-01-14 Thread Tony A via Digitalmars-d-learn
Hi, I just watched the Andrei's talk about Design by Introspection and for what I see this is used in D. Could anyone point out some good Github examples that I can see this in action and the benefits? Thanks.

Re: problem extracting data from GtkSourceView using Gtkd

2019-01-14 Thread Neia Neutuladh via Digitalmars-d-learn
On Mon, 14 Jan 2019 22:52:48 +, Chris Bare wrote: > auto start = new TextIter(); > auto end = new TextIter(); You shouldn't need to new these. `out` means that the function is going to overwrite the variables. Other than that, I'm not sure.

problem extracting data from GtkSourceView using Gtkd

2019-01-14 Thread Chris Bare via Digitalmars-d-learn
I would have posted this in the Gtkd forum, but it has been down for a while. I'm porting a GTK2/C program to Gtkd. I'm trying to read the data from a GtkSourceView, but when I try to get the bounds, it's always zero. Here's the c version that works: GtkSourceBuffer *bf;

Re: Building Libraries in the face of API and ABI changes

2019-01-14 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-01-14 15:07, Russel Winder wrote: Wilco. But I'll try and create test cases rather than just point at the full project. Reduced test cases are definitely appreciated. Unfortunately I don't use DStep enough to find all bugs and enhancements. Hopefully that will change. -- /Jacob

Re: What is the Utility of Parent Class Method Hiding in Inheritance?

2019-01-14 Thread Neia Neutuladh via Digitalmars-d-learn
On Mon, 14 Jan 2019 09:10:39 +, Vijay Nayar wrote: > a.foo(1); // issues runtime error (instead of calling > A.foo(int)) Calling the function doesn't issue any sort of error. Overriding one overload without overloading or explicitly aliasing in the rest issues a compile-time error.

How to include curl.lib?

2019-01-14 Thread Head Scratcher via Digitalmars-d-learn
The following text is in the source code for curl.d: Windows x86 note: A DMD compatible libcurl static library can be downloaded from the dlang.org $(LINK2 http://downloads.dlang.org/other/index.html, download archive page). I downloaded that static library. How do I link it into my D

Re: one path skips constructor

2019-01-14 Thread Johan Engelen via Digitalmars-d-learn
On Sunday, 13 January 2019 at 16:29:27 UTC, Kagamin wrote: --- struct A { int a; this(int) { if(__ctfe)this(0,0); //Error: one path skips constructor else a=0; } this(int,int){ a=1; } } --- Is this supposed to not compile? Yes. See spec 14.14.8.1:

Re: Building Libraries in the face of API and ABI changes

2019-01-14 Thread Russel Winder via Digitalmars-d-learn
On Sun, 2019-01-13 at 21:56 +0100, Jacob Carlborg via Digitalmars-d-learn wrote: > On 2019-01-11 06:31, Russel Winder wrote: > > > DStep generated bindings tend to need some manual tweaking that cannot be > > automated, which is surprising given that bindgen can do things without > > manual > >

Re: What is the Utility of Parent Class Method Hiding in Inheritance?

2019-01-14 Thread ag0aep6g via Digitalmars-d-learn
On 14.01.19 10:10, Vijay Nayar wrote: After a bit of reading, I understood the rule and how it works, but what I'm missing is the "why".  Why is it desirable to hide methods from a parent class which have the same name (but different arguments) as a method in a class?

What is the Utility of Parent Class Method Hiding in Inheritance?

2019-01-14 Thread Vijay Nayar via Digitalmars-d-learn
https://dlang.org/spec/function.html#function-inheritance Consider this snippet from the documentation: class A { int foo(int x) { ... } int foo(long y) { ... } } class B : A { override int foo(long x) { ... } } void test() { B b = new B(); b.foo(1); // calls B.foo(long),