repl like interface with D app

2017-06-16 Thread Mike B Johnson via Digitalmars-d-learn
I am developing a D app and I have a need to test things out. I do not want to have to recompile the app every time I want to test some functionality out. Suppose I have an app with some functions like foo, bar, etc... in some module m. I would like to be able to do basic stuff like write

Re: Implementing interfaces using alias this

2017-06-16 Thread Biotronic via Digitalmars-d-learn
On Thursday, 15 June 2017 at 18:49:58 UTC, Jesse Phillips wrote: wrap!IDuck Ah, so it does exist in Phobos. I thought it should be there, but didn't find it. Thanks! -- Biotronic

How can I make typeof(this) return the type of a calling derrived class from a function in a base class?

2017-06-16 Thread Lester via Digitalmars-d-learn
If I have something like the following: class A { void foo(){ writeln(typeof(this)); } ... } class B : A { ... } And I want the results: A a = new A; B b = new B; a.foo(); // prints "A" b.foo(); // prints "B" How would I go about doing that? At the moment b.foo() is printing "A".

Re: How can I make typeof(this) return the type of a calling derrived class from a function in a base class?

2017-06-16 Thread Milan Suk via Digitalmars-d-learn
On Friday, 16 June 2017 at 13:46:14 UTC, Lester wrote: If I have something like the following: class A { void foo(){ writeln(typeof(this)); } ... } class B : A { ... } And I want the results: A a = new A; B b = new B; a.foo(); // prints "A" b.foo(); // prints "B" How would I go a

Re: How can I make typeof(this) return the type of a calling derrived class from a function in a base class?

2017-06-16 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 16 June 2017 at 13:46:14 UTC, Lester wrote: If I have something like the following: class A { void foo(){ writeln(typeof(this)); } try one of these: http://dlang.org/spec/template.html#TemplateThisParameter Though note that the this in there is still the static type at the u

Re: How can I make typeof(this) return the type of a calling derrived class from a function in a base class?

2017-06-16 Thread Lester via Digitalmars-d-learn
Thanks for the responses guys :) I ended up using a foo(this T) and it works! Thanks again for your help.

Re: GStreamer and D

2017-06-16 Thread Jay Norwood via Digitalmars-d-learn
On Friday, 16 June 2017 at 06:45:38 UTC, Russel Winder wrote: Welcome to the group of people using GStreamer from D. I suspect I may be the only other member of that club. Looks like gst-inspect hasn't been ported... I'm looking at that now.

Re: GStreamer and D

2017-06-16 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2017-06-16 at 16:11 +, Jay Norwood via Digitalmars-d-learn wrote: > On Friday, 16 June 2017 at 06:45:38 UTC, Russel Winder wrote: > > Welcome to the group of people using GStreamer from D. I > > suspect I may be the only other member of that club. > > Looks like gst-inspect hasn't bee

Re: repl like interface with D app

2017-06-16 Thread Seb via Digitalmars-d-learn
On Friday, 16 June 2017 at 07:57:46 UTC, Mike B Johnson wrote: I am developing a D app and I have a need to test things out. I do not want to have to recompile the app every time I want to test some functionality out. [...] There is drepl, it's not fancy, but works for basic use cases... ht

Re: repl like interface with D app

2017-06-16 Thread Sameer Pradhan via Digitalmars-d-learn
On Friday, 16 June 2017 at 07:57:46 UTC, Mike B Johnson wrote: I am developing a D app and I have a need to test things out. I do not want to have to recompile the app every time I want to test some functionality out. Suppose I have an app with some functions like foo, bar, etc... in some mo

Re: Implementing interfaces using alias this

2017-06-16 Thread Jesse Phillips via Digitalmars-d-learn
On Friday, 16 June 2017 at 08:34:21 UTC, Biotronic wrote: On Thursday, 15 June 2017 at 18:49:58 UTC, Jesse Phillips wrote: wrap!IDuck Ah, so it does exist in Phobos. I thought it should be there, but didn't find it. Thanks! -- Biotronic Yeah, when Andrei introduced the wrap function I w

Calling delegate in a dll callback fails silently

2017-06-16 Thread Andre Pany via Digitalmars-d-learn
Hi, my D application uses a Dll written in another language. In my D code I retrieve the address of a delegate as integer: int dgRef = cast(int) &(dg); This integer I pass to a function in the dll together with the address of a callback function. extern(C) static void notifyEventCallback(int r

Re: GStreamer and D

2017-06-16 Thread Jay Norwood via Digitalmars-d-learn
On Friday, 16 June 2017 at 16:33:56 UTC, Russel Winder wrote: gst-inspect-1.0 is an executable that comes with the installation, however that is done. What are you thinking of when saying "ported"? gst-inspect is a good demonstration of iteration through the available gstreamer elements and

Linking external *.lib files

2017-06-16 Thread Jolly James via Digitalmars-d-learn
Let's assume, I have the following 2 dub packages: pkgBASE: source/ lib/ pkgAPP:

Re: Linking external *.lib files

2017-06-16 Thread Jolly James via Digitalmars-d-learn
Let's assume, I have the following 2 dub packages: pkgBASE: (depends on public DUB package) source/ lib/ pkgAPP: (depends on pkgBASE) source/ I have added pkgBASE via add-path. This wasn't a problem at all. Unfortunately, the public DUB package requires to be linked with

Re: Linking external *.lib files

2017-06-16 Thread Jolly James via Digitalmars-d-learn
On Saturday, 17 June 2017 at 00:09:41 UTC, Jolly James wrote: Let's assume, I have the following 2 dub packages: pkgBASE: (depends on public DUB package) source/ lib/ pkgAPP: (depends on pkgBASE) source/ I have added pkgBASE via add-path. This wasn't a problem at all. Unf

Re: Linking external *.lib files

2017-06-16 Thread Jolly James via Digitalmars-d-learn
On Saturday, 17 June 2017 at 00:33:01 UTC, Jolly James wrote: On Saturday, 17 June 2017 at 00:09:41 UTC, Jolly James wrote: Let's assume, I have the following 2 dub packages: pkgBASE: (depends on public DUB package) source/ lib/ pkgAPP: (depends on pkgBASE) source/ I have

Re: Calling delegate in a dll callback fails silently

2017-06-16 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 16 June 2017 at 22:17:07 UTC, Andre Pany wrote: int dgRef = cast(int) &(dg); What is the type of dg there? This looks horribly, horribly wrong to me. If it is type delegate, you took the address of a local variable, which is likely overwritten by the time the callback triggers.

Re: repl like interface with D app

2017-06-16 Thread Mike B Johnson via Digitalmars-d-learn
On Friday, 16 June 2017 at 18:43:24 UTC, Sameer Pradhan wrote: On Friday, 16 June 2017 at 07:57:46 UTC, Mike B Johnson wrote: [...] Please check out: https://github.com/DlangScience/PydMagic/blob/master/README.md I haven't used it myself, but fits right in the Jupyter/IPython ecosystem.

Re: repl like interface with D app

2017-06-16 Thread Mike B Johnson via Digitalmars-d-learn
On Friday, 16 June 2017 at 18:13:33 UTC, Seb wrote: On Friday, 16 June 2017 at 07:57:46 UTC, Mike B Johnson wrote: I am developing a D app and I have a need to test things out. I do not want to have to recompile the app every time I want to test some functionality out. [...] There is drepl,